allure-framework / allure-js

Allure integrations for JavaScript test frameworks
https://allurereport.org/
Apache License 2.0
225 stars 122 forks source link

Bug: attachments in steps. Creates redundant extra sub-step and meta step. `allure-playwright 2.7.0` #771

Closed EgorBodnar closed 4 months ago

EgorBodnar commented 1 year ago

await allure.attachment() from allure-playwright 2.7.0 version produces an extra step with the name of the attachment and meta step

To Reproduce Steps to reproduce the behavior:

  1. Code:

        await allure.step('Created step', async () => {
          await allure.attachment(
            'Some data',
            JSON.stringify({ data: { name: 'Bob' } }),
            'application/json',
          )
        })
  2. Creates the step: 2023-09-08_22-28-51 (2)

Expected behavior Don't create this extra sub-step with name of the attachment and don't show this meta step it in the report. Should create attachment only attached to the step 'Created step', not to the sub-step

baev commented 1 year ago

There are two issues in there:

  1. Since 2.7.0 detail and suiteTitle are now set to true by default. Because of that system attach steps are now reported. I completely disabled attach steps reporting in https://github.com/allure-framework/allure-js/pull/773 as we already display attachments in the report.
  2. When using allure.attachment method, an additional wrapping step is created for each attachment. We plan to release visual improvement in the next release of the Allure Report. See the change here: https://github.com/allure-framework/allure2/pull/2107

For more details on Playwright changes, please refer https://github.com/orgs/allure-framework/discussions/2103