diff --git a/docs/src/api/class-tracing.md b/docs/src/api/class-tracing.md index c00debbb4a53b..54cfddf8fea3a 100644 --- a/docs/src/api/class-tracing.md +++ b/docs/src/api/class-tracing.md @@ -147,13 +147,6 @@ To specify the final trace zip file name, you need to pass `path` option to Whether to capture screenshots during tracing. Screenshots are used to build a timeline preview. -### option: Tracing.start.coverage -* since: v1.64 -* langs: js -- `coverage` <[boolean]> - -Whether to collect code coverage from istanbul-instrumented application code. Build the application with an istanbul instrumentation plugin, for example [`vite-plugin-istanbul`](https://www.npmjs.com/package/vite-plugin-istanbul) or [`babel-plugin-istanbul`](https://www.npmjs.com/package/babel-plugin-istanbul), so that pages expose the `window.__coverage__` object. Playwright collects accumulated counters from all pages and frames, including right before navigations and page closes, and stores them in istanbul format inside the trace file. - ### option: Tracing.start.snapshots * since: v1.12 * langs: js diff --git a/docs/src/test-api/class-testoptions.md b/docs/src/test-api/class-testoptions.md index 879fa624170cb..f4c3c1e936dcd 100644 --- a/docs/src/test-api/class-testoptions.md +++ b/docs/src/test-api/class-testoptions.md @@ -694,7 +694,6 @@ export default defineConfig({ - `dom` ?<[boolean]> Capture DOM snapshot on every action and record network activity. Optional. - `aria` ?<[boolean]> Capture aria snapshot of the page on every action. Optional. - `screen` ?<[boolean]> Capture a screenshot of the page on every action. Optional. - - `coverage` ?<[boolean]> Whether to collect coverage from istanbul-instrumented application code into the trace. Defaults to false. Optional. - `sources` ?<[boolean]> Whether to include source files for trace actions. Defaults to true. Optional. Whether to record trace for each test. Defaults to `'off'`. The initial run of a test is the "first run"; subsequent runs caused by [retries](../test-retries.md) are "retries". diff --git a/packages/playwright-client/types/types.d.ts b/packages/playwright-client/types/types.d.ts index 34b649bf75716..f331cdcfe5d4e 100644 --- a/packages/playwright-client/types/types.d.ts +++ b/packages/playwright-client/types/types.d.ts @@ -23429,16 +23429,6 @@ export interface Tracing { * @param options */ start(options?: { - /** - * Whether to collect code coverage from istanbul-instrumented application code. Build the application with an - * istanbul instrumentation plugin, for example - * [`vite-plugin-istanbul`](https://www.npmjs.com/package/vite-plugin-istanbul) or - * [`babel-plugin-istanbul`](https://www.npmjs.com/package/babel-plugin-istanbul), so that pages expose the - * `window.__coverage__` object. Playwright collects accumulated counters from all pages and frames, including right - * before navigations and page closes, and stores them in istanbul format inside the trace file. - */ - coverage?: boolean; - /** * When enabled, the trace is written to an unarchived file that is updated in real time as actions occur, instead of * caching changes and archiving them into a zip file at the end. This is useful for live trace viewing during test diff --git a/packages/playwright-core/src/client/tracing.ts b/packages/playwright-core/src/client/tracing.ts index b191bc99db459..705a6c3369ded 100644 --- a/packages/playwright-core/src/client/tracing.ts +++ b/packages/playwright-core/src/client/tracing.ts @@ -42,7 +42,7 @@ export class Tracing extends ChannelOwner implements ap super(parent, type, guid, initializer); } - async start(options: { name?: string, title?: string, snapshots?: boolean | { dom?: boolean, aria?: boolean, screen?: boolean }, screenshots?: boolean, coverage?: boolean, sources?: boolean, live?: boolean } = {}) { + async start(options: { name?: string, title?: string, snapshots?: boolean | { dom?: boolean, aria?: boolean, screen?: boolean }, screenshots?: boolean, _coverage?: boolean, sources?: boolean, live?: boolean } = {}) { await this._wrapApiCall(async () => { this._includeSources = !!options.sources; this._isLive = !!options.live; @@ -53,7 +53,7 @@ export class Tracing extends ChannelOwner implements ap snapshotAria: snapshots.aria, snapshotScreen: snapshots.screen, screencast: options.screenshots, - coverage: options.coverage, + coverage: options._coverage, live: options.live, }, kNoTimeout); const { traceName } = await this._channel.tracingStartChunk({ name: options.name, title: options.title }, kNoTimeout); diff --git a/packages/playwright-core/types/types.d.ts b/packages/playwright-core/types/types.d.ts index 34b649bf75716..f331cdcfe5d4e 100644 --- a/packages/playwright-core/types/types.d.ts +++ b/packages/playwright-core/types/types.d.ts @@ -23429,16 +23429,6 @@ export interface Tracing { * @param options */ start(options?: { - /** - * Whether to collect code coverage from istanbul-instrumented application code. Build the application with an - * istanbul instrumentation plugin, for example - * [`vite-plugin-istanbul`](https://www.npmjs.com/package/vite-plugin-istanbul) or - * [`babel-plugin-istanbul`](https://www.npmjs.com/package/babel-plugin-istanbul), so that pages expose the - * `window.__coverage__` object. Playwright collects accumulated counters from all pages and frames, including right - * before navigations and page closes, and stores them in istanbul format inside the trace file. - */ - coverage?: boolean; - /** * When enabled, the trace is written to an unarchived file that is updated in real time as actions occur, instead of * caching changes and archiving them into a zip file at the end. This is useful for live trace viewing during test diff --git a/packages/playwright/src/worker/testTracing.ts b/packages/playwright/src/worker/testTracing.ts index 8b8637544eece..700be901a7d69 100644 --- a/packages/playwright/src/worker/testTracing.ts +++ b/packages/playwright/src/worker/testTracing.ts @@ -38,7 +38,7 @@ const version: trace.VERSION = 10; let traceOrdinal = 0; type TraceFixtureValue = PlaywrightWorkerOptions['trace'] | undefined; -type TraceOptions = { screenshots: boolean, snapshots: boolean | { dom?: boolean, aria?: boolean, screen?: boolean }, coverage: boolean, sources: boolean, attachments: boolean, live: boolean, mode: TraceMode }; +type TraceOptions = { screenshots: boolean, snapshots: boolean | { dom?: boolean, aria?: boolean, screen?: boolean }, _coverage: boolean, sources: boolean, attachments: boolean, live: boolean, mode: TraceMode }; export class TestTracing { private _testInfo: TestInfoImpl; @@ -93,7 +93,7 @@ export class TestTracing { } async startIfNeeded(value: TraceFixtureValue) { - const defaultTraceOptions: TraceOptions = { screenshots: true, snapshots: true, coverage: false, sources: true, attachments: true, live: false, mode: 'off' }; + const defaultTraceOptions: TraceOptions = { screenshots: true, snapshots: true, _coverage: false, sources: true, attachments: true, live: false, mode: 'off' }; if (!value) { this._options = defaultTraceOptions; diff --git a/packages/playwright/types/test.d.ts b/packages/playwright/types/test.d.ts index 30ac1fbc3065b..033029cc5a12f 100644 --- a/packages/playwright/types/test.d.ts +++ b/packages/playwright/types/test.d.ts @@ -961,7 +961,7 @@ interface TestConfig { * ``` * */ - reporter?: LiteralUnion<'list'|'dot'|'line'|'github'|'json'|'junit'|'null'|'html'|'blob'|'perfetto'|'coverage', string> | ReporterDescription[]; + reporter?: LiteralUnion<'list'|'dot'|'line'|'github'|'json'|'junit'|'null'|'html'|'blob'|'perfetto', string> | ReporterDescription[]; /** * Global options for all tests, for example * [testOptions.browserName](https://playwright.dev/docs/api/class-testoptions#test-options-browser-name). Learn more @@ -7260,7 +7260,7 @@ export interface PlaywrightWorkerOptions { * * Learn more about [recording trace](https://playwright.dev/docs/test-use-options#recording-options). */ - trace: TraceMode | /** deprecated */ 'retry-with-trace' | { mode: TraceMode, snapshots?: boolean | { dom?: boolean, aria?: boolean, screen?: boolean }, screenshots?: boolean, coverage?: boolean, sources?: boolean, attachments?: boolean }; + trace: TraceMode | /** deprecated */ 'retry-with-trace' | { mode: TraceMode, snapshots?: boolean | { dom?: boolean, aria?: boolean, screen?: boolean }, screenshots?: boolean, sources?: boolean, attachments?: boolean }; /** * Whether to record video for each test. Defaults to `'off'`. The initial run of a test is the "first run"; * subsequent runs caused by [retries](https://playwright.dev/docs/test-retries) are "retries". diff --git a/tests/config/traceViewerFixtures.ts b/tests/config/traceViewerFixtures.ts index 949dc08549bca..da6b48b3b87f4 100644 --- a/tests/config/traceViewerFixtures.ts +++ b/tests/config/traceViewerFixtures.ts @@ -186,7 +186,7 @@ export const traceViewerFixtures: Fixtures `