From b04880d7b8caa079effce91fbaf15b90275c3258 Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Tue, 17 Dec 2024 10:00:52 +0100 Subject: [PATCH] fix more tests --- packages/playwright/src/isomorphic/teleReceiver.ts | 4 ++-- tests/playwright-test/to-have-screenshot.spec.ts | 4 ---- tests/playwright-test/ui-mode-trace.spec.ts | 2 -- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/packages/playwright/src/isomorphic/teleReceiver.ts b/packages/playwright/src/isomorphic/teleReceiver.ts index 2e00d1aa2c..00e801dd2c 100644 --- a/packages/playwright/src/isomorphic/teleReceiver.ts +++ b/packages/playwright/src/isomorphic/teleReceiver.ts @@ -108,7 +108,7 @@ export type JsonTestStepEnd = { id: string; duration: number; error?: reporterTypes.TestError; - attachments: number[]; // index of JsonTestResultEnd.attachments + attachments?: number[]; // index of JsonTestResultEnd.attachments }; export type JsonFullResult = { @@ -267,7 +267,7 @@ export class TeleReporterReceiver { const step = result._stepMap.get(payload.id)!; step.duration = payload.duration; step.error = payload.error; - step._attachmentIndices = payload.attachments; + step._attachmentIndices = payload.attachments ?? []; this._reporter.onStepEnd?.(test, result, step); } diff --git a/tests/playwright-test/to-have-screenshot.spec.ts b/tests/playwright-test/to-have-screenshot.spec.ts index 83642bd19e..9f1bd4c47c 100644 --- a/tests/playwright-test/to-have-screenshot.spec.ts +++ b/tests/playwright-test/to-have-screenshot.spec.ts @@ -263,11 +263,7 @@ test('should report toHaveScreenshot step with expectation name in title', async `end browserContext.newPage`, `end fixture: page`, `end Before Hooks`, - `end attach "foo-expected.png"`, - `end attach "foo-actual.png"`, `end expect.toHaveScreenshot(foo.png)`, - `end attach "is-a-test-1-expected.png"`, - `end attach "is-a-test-1-actual.png"`, `end expect.toHaveScreenshot(is-a-test-1.png)`, `end fixture: page`, `end fixture: context`, diff --git a/tests/playwright-test/ui-mode-trace.spec.ts b/tests/playwright-test/ui-mode-trace.spec.ts index ef7c8fcf65..0f803d1710 100644 --- a/tests/playwright-test/ui-mode-trace.spec.ts +++ b/tests/playwright-test/ui-mode-trace.spec.ts @@ -94,8 +94,6 @@ test('should merge screenshot assertions', async ({ runUITest }, testInfo) => { /Before Hooks[\d.]+m?s/, /page.setContent[\d.]+m?s/, /expect.toHaveScreenshot[\d.]+m?s/, - /attach "trace-test-1-expected.png/, - /attach "trace-test-1-actual.png/, /After Hooks[\d.]+m?s/, /Worker Cleanup[\d.]+m?s/, ]);