Repository navigation
Mochawesome HTML report: Missing scenario steps (stack) in CodeceptJS 3 when scenario fails #2727
Description
Activity
yep, I see this error too on 3.0.2
For failed tests there are error stack and recorder code

For successful tests - some code

I am using WebDriver helper without gherkin steps.
Do you use gherkin, @mirao ?
@elukoyanov No, I do not. I'm also using WebDriver without gherkin
- changed the title
[-]Mochawesome HTML report: Missing scenario steps (stack) in CodeceptJS 3[/-][+]Mochawesome HTML report: Missing scenario steps (stack) in CodeceptJS 3 when scenario fails[/+]on Dec 21, 2020 ktryniszewski-mdsol commented
on Jan 4, 2021 ContributorMore actionsI 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
Reacted by BazicoI'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
},- locked and limited conversation to collaborators
on Sep 5, 2021

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:
# codeceptjs run --grep "Test login screen" --profile jobr --reporter mocha-multiDetails