-
-
Notifications
You must be signed in to change notification settings - Fork 747
CodeceptJs passes test when unknown methode #4935
-
What are you trying to achieve?
First off: we could manage to archieve autocompletion in our ide
So there can be some mistakes while writing a test. like in this example my coworker had a spelling in a method which lead to a passing test, even though it was all not valid (text was not there, button was not pressed).
We tried to call a methode that definitly doesnt exist. "sfslfdsflkds" and if we do so, the test always passes.
can we change this behaviour to failing? or an error message or something?
What do you get instead?
Error message or failing test or something related..
CodeceptJS v3.1.1 Using test root "C:\dev\TestConnectSuite\Frontend" @SapInputMaskTom -- √ Approve SAP Test parameter in 17907ms OK | 1 passed // 21s Execution time (hr): 20s 728.7074ms
Provide test source code if related
I.sfslfdsflkds(); I.see('somethingNotthere') I.seeElement(....) // unkown element, which is definitly not there
Details
- CodeceptJS version: v3.1.1
- NodeJS Version: 14.16
- Operating System: Windows
- puppeteer
- Configuration file:
const {setHeadlessWhen} = require('@codeceptjs/configure'); const testFolder = './e2e/pages'; const fs = require('fs'); let include = fs.readdirSync(testFolder) // get access to file and path .map(file => ({file, path: file})) // replace snake case to camel case .map(({file, path}) => ({file: file.replace(/([-_]\w)/g, g => g[1].toUpperCase()), path})) // remove .js extension .map(({file, path}) => ({file: file.slice(0, -3), path})) // convert to object with key as file + "Page", value as "file location" .reduce((obj, {file, path}) => (obj[`${file}Page`] = `${testFolder}/${path}`, obj), {}); include = {I: './e2e/steps/steps_file.js', ...include}; // turn on headless mode when running with HEADLESS=true environment variable // HEADLESS=true npx codecept run setHeadlessWhen(process.env.HEADLESS); exports.config = { tests: './e2e/tests/*_test.js', output: './e2e/output/', helpers: { Puppeteer: { url: process.env.profile, show: true, waitForNavigation: 'networkidle0', waitForAction: 500, smartWait: 10000, getPageTimeout: 0, windowSize: '1280x960', chrome: { executablePath: 'C:/Program Files/Chromium/Application/chrome.exe', args: ['--window-size=1280,1080'], defaultViewport: { width: 1280, height: 960 } }, }, }, include, mocha: { "reporterOptions": { "codeceptjs-cli-reporter": { "stdout": "-", "options": { "verbose": false, "steps": true } }, "mocha-junit-reporter": { "stdout": "./output/console.log", "options": { "mochaFile": "./e2e/output/result.xml" } } } }, name: 'Frontend', plugins: { retryFailedStep: { enabled: true }, screenshotOnFail: { enabled: true }, pauseOnFail: { enabled: false }, tryTo: { enabled: true } }, bootstrap: require('./e2e/hooks/bootstrap.js'), teardown: require('./e2e/hooks/teardown.js') }
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 6 comments
-
hi @deinlieblingskevin may you happen to reproduce the same issue with latest version?
Beta Was this translation helpful? Give feedback.
All reactions
-
its a big software and right now we cannot upgrade. maybe in january we will be able to do so and try the latest version
Beta Was this translation helpful? Give feedback.
All reactions
-
its a big software and right now we cannot upgrade. maybe in january we will be able to do so and try the latest version
thanks for your prompt reply! My guess is that using TS would prevent us from having this kinda issue.
Beta Was this translation helpful? Give feedback.
All reactions
-
thanks for the fast answer. how much efford is it to switch to typescript?
Beta Was this translation helpful? Give feedback.
All reactions
-
thanks for the fast answer. how much efford is it to switch to typescript?
https://codecept.io/typescript/#getting-started
I could not say for sure. But as the documentation, it doesn't sound much complicated.
Beta Was this translation helpful? Give feedback.
All reactions
-
Thanks a @kobenguyent, i tried it on a spike to switch to ts and its really helpful! <3
Beta Was this translation helpful? Give feedback.
All reactions
-
❤️ 1