fix more tests

This commit is contained in:
Simon Knott 2024-12-17 10:00:52 +01:00
parent 0861d29630
commit b04880d7b8
No known key found for this signature in database
GPG key ID: 8CEDC00028084AEC
3 changed files with 2 additions and 8 deletions

View file

@ -108,7 +108,7 @@ export type JsonTestStepEnd = {
id: string; id: string;
duration: number; duration: number;
error?: reporterTypes.TestError; error?: reporterTypes.TestError;
attachments: number[]; // index of JsonTestResultEnd.attachments attachments?: number[]; // index of JsonTestResultEnd.attachments
}; };
export type JsonFullResult = { export type JsonFullResult = {
@ -267,7 +267,7 @@ export class TeleReporterReceiver {
const step = result._stepMap.get(payload.id)!; const step = result._stepMap.get(payload.id)!;
step.duration = payload.duration; step.duration = payload.duration;
step.error = payload.error; step.error = payload.error;
step._attachmentIndices = payload.attachments; step._attachmentIndices = payload.attachments ?? [];
this._reporter.onStepEnd?.(test, result, step); this._reporter.onStepEnd?.(test, result, step);
} }

View file

@ -263,11 +263,7 @@ test('should report toHaveScreenshot step with expectation name in title', async
`end browserContext.newPage`, `end browserContext.newPage`,
`end fixture: page`, `end fixture: page`,
`end Before Hooks`, `end Before Hooks`,
`end attach "foo-expected.png"`,
`end attach "foo-actual.png"`,
`end expect.toHaveScreenshot(foo.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 expect.toHaveScreenshot(is-a-test-1.png)`,
`end fixture: page`, `end fixture: page`,
`end fixture: context`, `end fixture: context`,

View file

@ -94,8 +94,6 @@ test('should merge screenshot assertions', async ({ runUITest }, testInfo) => {
/Before Hooks[\d.]+m?s/, /Before Hooks[\d.]+m?s/,
/page.setContent[\d.]+m?s/, /page.setContent[\d.]+m?s/,
/expect.toHaveScreenshot[\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/, /After Hooks[\d.]+m?s/,
/Worker Cleanup[\d.]+m?s/, /Worker Cleanup[\d.]+m?s/,
]); ]);