Skip to content

[Playwright][BUG][3.2.1] Attachments aren't nested in steps for beforeAll / beforeEach / afterEach / afterAll hooks #1278

Open
@MRichforth

Description

@MRichforth

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:

  1. Install allure-playwright package version 3.2.1

  2. In any spec file add any playwright hook, for example beforeAll

  3. 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');
         });
     });
    
  4. Generate Allure report

  5. 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:
Image

Screenshots
Actual behaviour in allure-playwright package version 3.2.1:
Image

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' });
        });
    });

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions