Skip to content

[BUG] attachment steps are not hidden inside expect.toHaveScreenshot() #23693

@aslushnikov

Description

@aslushnikov
  1. The following test snippet:
import { test, expect } from '@playwright/test';

test('should work', async ({ page }) => {
  await page.goto('https://playwright.dev');
  await expect(page).toHaveScreenshot();
});
  1. Execute with --trace on:
npx playwright test --trace on
  1. Open trace with npx playwright show-trace:
image

Actual / Expected

The "attach" step (focused on the screenshot) is a top-level step. I'd expect it to be hidden inside the expect.toHaveScreenshot step.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions