Description
Describe the bug
After updating allure-playwright
package to version 3.2.1 from version 2.15.1, an issue was discovered that in case of using the attachment
function inside allure steps in any of the playwright hooks (beforeAll / beforeEach / afterEach / afterAll) as a result in Allure report these attachments are not displayed inside the steps
To Reproduce
Steps to reproduce the behavior:
-
Install
allure-playwright
package version 3.2.1 -
In any spec file add any playwright hook, for example
beforeAll
-
Inside the added hook add the following step with an attachment, example:
test.beforeAll(async () => { await allure.step('test step', async () => { await allure.attachment('test key', 'test value', 'application/json'); }); });
-
Generate Allure report
-
Observe that attachments aren't nested in steps for
beforeAll
hooks
Expected behavior
Attachments added inside a step should have a corresponding nesting in the Allure report, how it worked, for example, in version 2.15.1:
Screenshots
Actual behaviour in allure-playwright
package version 3.2.1:
Desktop (please complete the following information):
- OS: MacOS Sequoia 15.3.2
- Browser: Google Chrome
- Version:
- allure-playwright: 3.2.1
- @playwright/test: 1.51.1
- Google Chrome: 134.0.6998.166
Additional context
The same result of the display in allure report, namely the mismatch of attachments nesting in a step is displayed in case of using the allure-playwright
package version 3.2.1 and the built-in step logging functionality in playwright, example:
test.beforeAll(async () => {
await test.step('test step', async step => {
await step.attach('test key', { body: 'test value' });
});
});