From 9f22ae9aa9c77f8d69f81a8aadde5107b98cffa3 Mon Sep 17 00:00:00 2001 From: Elizaveta Bezyaikna Date: Mon, 15 Aug 2022 19:28:21 +0300 Subject: [PATCH] chore: add id for each test to JSONReporter (#16494) --- packages/playwright-test/src/reporters/json.ts | 1 + packages/playwright-test/types/testReporter.d.ts | 1 + utils/generate_types/overrides-testReporter.d.ts | 1 + 3 files changed, 3 insertions(+) diff --git a/packages/playwright-test/src/reporters/json.ts b/packages/playwright-test/src/reporters/json.ts index 7bb3f4d8d3..36fd5495b0 100644 --- a/packages/playwright-test/src/reporters/json.ts +++ b/packages/playwright-test/src/reporters/json.ts @@ -150,6 +150,7 @@ class JSONReporter implements Reporter { ok: test.ok(), tags: (test.title.match(/@[\S]+/g) || []).map(t => t.substring(1)), tests: [ this._serializeTest(test) ], + id: test.id, ...this._relativeLocation(test.location), }; } diff --git a/packages/playwright-test/types/testReporter.d.ts b/packages/playwright-test/types/testReporter.d.ts index cc3a731b22..0b63983017 100644 --- a/packages/playwright-test/types/testReporter.d.ts +++ b/packages/playwright-test/types/testReporter.d.ts @@ -469,6 +469,7 @@ export interface JSONReportSpec { title: string; ok: boolean; tests: JSONReportTest[]; + id: string; file: string; line: number; column: number; diff --git a/utils/generate_types/overrides-testReporter.d.ts b/utils/generate_types/overrides-testReporter.d.ts index 019417fb95..9ad45f2b3b 100644 --- a/utils/generate_types/overrides-testReporter.d.ts +++ b/utils/generate_types/overrides-testReporter.d.ts @@ -80,6 +80,7 @@ export interface JSONReportSpec { title: string; ok: boolean; tests: JSONReportTest[]; + id: string; file: string; line: number; column: number;