From 0e9eaf2134e7274182833d5f810deaa4a9137d09 Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Wed, 16 Oct 2024 12:12:33 +0200 Subject: [PATCH] fix test --- tests/playwright-test/reporter-html.spec.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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'),