diff --git a/tests/playwright-test/reporter-html.spec.ts b/tests/playwright-test/reporter-html.spec.ts
index d55d710f9f..78d550ab52 100644
--- a/tests/playwright-test/reporter-html.spec.ts
+++ b/tests/playwright-test/reporter-html.spec.ts
@@ -903,8 +903,8 @@ for (const useIntermediateMergeReport of [false] as const) {
body: Buffer.from('
step attachment
'),
});
- await testInfo.attach('foo', { body: 'a' });
- await testInfo.attach('foo', { body: 'b' });
+ await testInfo.attach('foo', { body: 'body-a' });
+ await testInfo.attach('foo', { body: 'body-b' });
});
});
`,
@@ -921,7 +921,13 @@ for (const useIntermediateMergeReport of [false] as const) {
await testSteps.getByText('step with attachment').click();
- await expect(testSteps.getByText('attach "foo"'), 'uses normal rendering when it cannot correlate by name').toHaveCount(2);
+ await expect(testSteps).not.toContainText('body-a');
+ await testSteps.getByText('foo').nth(0).click();
+ await expect(testSteps).toContainText('body-a');
+
+ await expect(testSteps).not.toContainText('body-b');
+ await testSteps.getByText('foo').nth(1).click();
+ await expect(testSteps).toContainText('body-b');
const [newTab] = await Promise.all([
page.waitForEvent('popup'),