allure-js icon indicating copy to clipboard operation
allure-js copied to clipboard

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

Open EgorBodnar opened this issue 2 years ago • 1 comments

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',
          )
        })
  1. 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

EgorBodnar avatar Sep 08 '23 14:09 EgorBodnar

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

baev avatar Sep 11 '23 17:09 baev