-
-
Notifications
You must be signed in to change notification settings - Fork 747
-
What are you trying to achieve?
Mochawesome report shows scenario steps (stack) when a scenario fails. It's useful because of context - when it's not clear in which step it occurred.
This is how it looks in CodeeceptJS 2.6.11:
What do you get instead?
Missing scenario steps in CodeceptJS 3.0.3. There is only an "internal" stack from node modules which isn't too much useful:
Provide console output if related. Use
--verbose
mode for more details.
# codeceptjs run --grep "Test login screen" --profile jobr --reporter mocha-multi
Details
- CodeceptJS version: 3.0.3
- NodeJS Version: v12.20.0
- mocha-multi: 1.1.3
- mochawesome: 6.1.1
- Operating System: Ubuntu 20.04/20.10
- Configuration file:
mocha: { reporterOptions: { "codeceptjs-cli-reporter": { stdout: "-", options: { verbose: false, debug: true, steps: true } }, mochawesome: { stdout: "./output/console.log", options: { reportDir: "./output", reportFilename: "report" } }, "mocha-junit-reporter": { stdout: "./output/console.log", options: { mochaFile: "./output/result.xml", jenkinsMode: true, attachments: true //add screenshot for a failed test }, } } },
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 6 comments 1 reply
-
yep, I see this error too on 3.0.2
For failed tests there are error stack and recorder code
image
For successful tests - some code
image
I am using WebDriver helper without gherkin steps.
Do you use gherkin, @mirao ?
Beta Was this translation helpful? Give feedback.
All reactions
-
@elukoyanov No, I do not. I'm also using WebDriver without gherkin
Beta Was this translation helpful? Give feedback.
All reactions
-
I think I accidentally suppressed the gherkin error in 3.0.3 when i was adding logic for bddStep event. Instead of throwing the error it was returning on the whole step when error is encountered. I am not sure if this is related, but I have a fix for that here: #2745
Beta Was this translation helpful? Give feedback.
All reactions
-
🎉 1
-
Hi, I face the same issue. I can not see any steps/verbose information in the report.
Beta Was this translation helpful? Give feedback.
All reactions
-
I'm having the same issue, in the json file, context becomes null and the code is replaced with the same recorder.errHandler blob you posted.
Using the latest versions of mochawesome (6.2.2) and codeceptjs (3.0.6)
This only happens if you retry the test. The old data is replaced with this incorrect data.
Screenshots remain in the folder, but are also not displayed.
This was not a problem with 2.x.x
"context": null,
"code": "recorder.errHandler((err) => {\n recorder.session.start('teardown');\n recorder.cleanAsyncErr();\n if (test.throws) { // check that test should actually fail\n try {\n assertThrown(err, test.throws);\n event.emit(event.test.passed, test);\n event.emit(event.test.finished, test);\n recorder.add(() => done());\n return;\n } catch (newErr) {\n err = newErr;\n }\n }\n event.emit(event.test.failed, test, err);\n event.emit(event.test.finished, test);\n recorder.add(() => done(err));\n});\nif (isAsyncFunction(testFn)) {\n event.emit(event.test.started, test);\n const catchError = e => {\n recorder.throw(e);\n recorder.catch((e) => {\n const err = (recorder.getAsyncErr() === null) ? e : recorder.getAsyncErr();\n recorder.session.start('teardown');\n recorder.cleanAsyncErr();\n event.emit(event.test.failed, test, err);\n event.emit(event.test.finished, test);\n recorder.add(() => done(err));\n });\n };\n let injectedArguments;\n try {\n injectedArguments = getInjectedArguments(testFn, test);\n } catch (e) {\n catchError(e);\n return;\n }\n testFn.call(test, injectedArguments).then(() => {\n recorder.add('fire test.passed', () => {\n event.emit(event.test.passed, test);\n event.emit(event.test.finished, test);\n });\n recorder.add('finish test', () => done());\n recorder.catch();\n }).catch(catchError);\n return;\n}\ntry {\n event.emit(event.test.started, test);\n testFn.call(test, getInjectedArguments(testFn, test));\n} catch (err) {\n recorder.throw(err);\n} finally {\n recorder.add('fire test.passed', () => {\n event.emit(event.test.passed, test);\n event.emit(event.test.finished, test);\n });\n recorder.add('finish test', () => done());\n recorder.catch();\n}",
"err": {
"message": "Error: Text "We've sent your info to" was not found on page after 10 sec\nwaiting for function failed: timeout 10000ms exceeded",
"estack": "Error: Text "We've sent your info to" was not found on page after 10 sec\nwaiting for function failed: timeout 10000ms exceeded\n at C:\PLM\auto-quote-and-buy-ui\node_modules\codeceptjs\lib\helper\Puppeteer.js:2091:13\n at async Actor.takeScreenshot (e2e\src\steps\basic.steps.js:118:5)\n at async Test. (e2e\src\tests\features\send-to-agent_test.js:43:3)",
"diff": null
},
Beta Was this translation helpful? Give feedback.
All reactions
-
still repoduces
3.1.3 + 6.2.3 and 3.2.3 + 7.0.1 with retries >=1
Beta Was this translation helpful? Give feedback.
All reactions
-
Related issue: #3274
Beta Was this translation helpful? Give feedback.