Question - test:after:run event
See original GitHub issueI am adding context to display screenshots and videos from failed test.
Cypress.on('test:after:run', (test, runnable) => {
if (test.state === 'failed') {
addContext({ test }, `screenshots/${Cypress.spec.name}/${runnable.parent.title} -- ${test.title} (failed).png``);
addContext({ test }, `videos/${Cypress.spec.name}.mp4`);
}
});
However when cypress-fast-fail plugin is enabled, adding context is not executed at all. Could you tell me what am I doing wrong or provide some workaround for this issue?
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
cy.task() calls do not fire in 'test:after:run' event block #4823
Current behavior: Attempting to fire cy.task() commands after a test completes appears to outright fail.
Read more >how to make proper async request inside cypress.on(test:after ...
The test works fine when I pass 'cypress run --no-exit' but the problem is this will leave the browser open and have to...
Read more >66 Event Design Questions - Modern Learners
Our list of event design questions is not all-inclusive. Thinking about these questions early on will make the designing and planning much more...
Read more >Jul 25 2019 12:35 UTC - cypress-io/cypress - Gitter
Hello all! Anyone know why cy.task() commands fail to run within a 'test:after:run' event block? Cypress.on(' ...
Read more >Catalog of Events - Cypress Documentation
Cypress emits a series of events as it runs in your browser. These events are useful not only to control your application's behavior,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I saw this issue as well, thanks for investigating @javierbrea
Hi @GabRog,
I will investigate it to fix it or provide a workaround as soon as possible.
Thanks for your feedback! 🙂