question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Question - test:after:run event

See original GitHub issue

I 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:closed
  • Created 3 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jmtimko5commented, Feb 18, 2021

I saw this issue as well, thanks for investigating @javierbrea

1reaction
javierbreacommented, Feb 9, 2021

Hi @GabRog,

I will investigate it to fix it or provide a workaround as soon as possible.

Thanks for your feedback! 🙂

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found