Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
chore: make tracing before/after test more robust (#24136)
Pavel Feldmane234a6a037f1
diff --git a/tests/library/tracing.spec.ts b/tests/library/tracing.spec.tsindex f9df80587a..980b9706ed 100644--- a/tests/library/tracing.spec.ts+++ b/tests/library/tracing.spec.ts@@ -735,32 +735,40 @@ test('should not emit after w/o before', async ({ browserType, mode }, testInfo)}};+ let call1: number;{const { events } = await parseTraceRaw(testInfo.outputPath('trace1.zip'));expect(events.map(sanitize).filter(Boolean)).toEqual([{type: 'before',- callId: 0,+ callId: expect.any(Number),apiName: 'page.evaluate'}]);+ call1 = events.map(sanitize).filter(Boolean)[0].callId;}+ let call2before: number;+ let call2after: number;{const { events } = await parseTraceRaw(testInfo.outputPath('trace2.zip'));expect(events.map(sanitize).filter(Boolean)).toEqual([{type: 'before',- callId: 6,+ callId: expect.any(Number),apiName: 'page.evaluateHandle'},{type: 'after',- callId: 6,+ callId: expect.any(Number),apiName: undefined}]);+ call2before = events.map(sanitize).filter(Boolean)[0].callId;+ call2after = events.map(sanitize).filter(Boolean)[1].callId;}+ expect(call2before).toBeGreaterThan(call1);+ expect(call2after).toBe(call2before);});function expectRed(pixels: Buffer, offset: number) {