CodeceptJS
CodeceptJS copied to clipboard
how can I stop test suite when an assertions fails?
What are you trying to achieve?
stop tests when an assertion fails
What do you get instead?
my tests are keep running
Details
- CodeceptJS version: ^1.2.0
- NodeJS Version: v10.9.0
- Operating System: windows 10
- Configuration file:
{
"output": "./test/output",
"helpers": {
"Puppeteer": {
"url": "http://some-dev-url",
"show": true,
"windowSize": "1600x1200",
"chrome": {
"ignoreHTTPSErrors": true
}
}
},
"include": {
...
},
"mocha": {},
"bootstrap": false,
"teardown": null,
"hooks": [],
"tests": "./test/acceptance/*_test.js",
"timeout": 10000,
"name": "name"
}
Still nothing on this?
I have a preparation step, which must either succeed or if failed prevent all further steps. Is it possible to achieve? assert.fail() didn't work
Found that for my case I can put preparation steps inside BeforeSuite(). If an exception is thrown there it will interrupt further execution.
It seems that if I add --bail to codecept run command, it stops test execution after first failure