Closed lifanov-rza closed 2 months ago
I have a similar issue with Cypress, code allure.attachment
is not working when I put in hook afterEach
here is the sample code
afterEach(function () {
let path = Cypress.spec.absolute.split('/cypress/tests/')[0]
cy.readFile(`${path}/cypress/1.png`, null).then((file) => {
allure.step('Get screenshot', () => {
allure.attachment('fileName', file, "image/png");
});
});
This code will now show on the allure report.. Maybe someone can check it? or maybe you guys don't support this on this hook ?
@dimas-rymera support for Cypress hooks introduced in 3.0.0-beta.4, please give it a try
@dimas-rymera support for Cypress hooks introduced in 3.0.0-beta.4, please give it a try
@baev Do the fixes cover CodeceptJS hooks?
@lifanov-rza, we added support for beforeEach & afterEach CodeceptJS hooks; however, hook methods in helpers are not reported by CodeceptJS, so we're still figuring out how we should handle it.
Describe the bug
From PW documentation:
So, if we need to get video of failed test we should wait for browserContext to be closed.
The implementation for allure-legacy plugin is present below:
Tried this implementation for allure-codeceptjs plugin but faced with the problem that currentTest is equal to null when test finished (passed / failed). The step 'allure.addAttachment' copies video file to allure-results repository but don't update <%.result.json> file by adding one more attachment.
Expected result:
Actual result:
Tried to add an entry about the video attachment and run 'allure serve' -> the video was present in the report.
To Reproduce Steps to reproduce the behavior:
video: true
in codeceptJS configuration fileallure serve
Expected result The video is present
Actual result The video is NOT present
Desktop (please complete the following information):