Screenshots/Videos do not upload when setting `allureWriter(on, config);` before `after:spec`
See original GitHub issueDescribe the bug
Cypress screenshots and videos do not upload to the Allure test report when setting allureWriter(on, config);
before on('after:spec', ()
in /cypress/plugins/index.ts
.
allureWriter(on, config);
on('after:spec', (spec: { name: string }, results: { video: boolean; tests: number }) => {
// Send test metrics to Datadog after:spec as after:run results in the final metric sometimes not getting sent
if (process.env.BUILDKITE) {
reportSpecTestMetrics(spec);
}
if (results && results.video) {
// Do we have failures for any retry attempts?
const failures = _.some(results.tests, (test: { attempts: number }) => {
return _.some(test.attempts, { state: 'failed' });
});
if (!failures) {
// Delete the video if the spec passed and no tests retried
return del(results.video);
}
}
});
To Reproduce Steps to reproduce the behavior:
- Set
allureWriter(on, config);
beforeon('after:spec', ()
in/cypress/plugins/index.ts
Expected behavior
When allureWriter(on, config);
is set after after:spec
, the screenshots/videos get uploaded to the report. Placing it before after:spec
does not upload screenshots/videos.
Environment (please complete the following information):
- Cypress version: 9.0.0
- OS: Mac
** Developer Tools Console Output **
Additional context Add any other context about the problem here.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Video gets uploaded to report with videoUploadOnPasses ...
To Reproduce Video is uploaded to report even with option ... Screenshots/Videos do not upload when setting allureWriter(on, config); before ...
Read more >after:Spec not working as expected | Cypress - Stack Overflow
i can't seem to get the console.log to print out in this situation it can only be implemented if i remove allurewriter(on,config);.
Read more >@shelex/cypress-allure-plugin - npm
There is no need to set this plugin as reporter in Cypress or use any ... preprocessors please set allure writer before returning...
Read more >shelex/cypress-allure-plugin/README.md - UNPKG
Videos are attached for failed tests only from path specified in cypress config `videosFolder` and in case you have not passed video=false to...
Read more >Allure Report Integration with Cypress - The Geveo Blog
There are lots of cool testing frameworks for different programming languages. Unfortunately, only a few of them can provide good ...
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 FreeTop 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
Top GitHub Comments
@Shelex the fix looks good!! thank you again.
@Shelex, awesome - yes, will test it shortly. thank you