@piwitests/reporter 0.39.0 → 0.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -80,6 +80,8 @@ var DEFAULTS = {
80
80
  // Off by default: the page inventory reads control and link names from every
81
81
  // visited page, so it stays opt-in until a project turns it on.
82
82
  capturePageInventory: false,
83
+ // Off by default: JavaScript coverage slows the page, so a scheduled job opts in.
84
+ captureCodeReach: false,
83
85
  captureServerTraces: true,
84
86
  sampleAriaOnPass: true,
85
87
  uploadManifest: true,
@@ -116,6 +118,8 @@ var PIWI_ENV_KEYS = {
116
118
  captureLocators: "PIWI_CAPTURE_LOCATORS",
117
119
  capturePageState: "PIWI_CAPTURE_PAGE_STATE",
118
120
  capturePageInventory: "PIWI_CAPTURE_PAGE_INVENTORY",
121
+ captureCodeReach: "PIWI_CAPTURE_CODE_REACH",
122
+ codeReachRoots: "PIWI_CODE_REACH_ROOTS",
119
123
  captureServerTraces: "PIWI_CAPTURE_SERVER_TRACES",
120
124
  sampleAriaOnPass: "PIWI_SAMPLE_ARIA_ON_PASS",
121
125
  uploadManifest: "PIWI_UPLOAD_MANIFEST",
@@ -158,6 +162,7 @@ var ENV_FALLBACK_SPECS = [
158
162
  { option: "captureLocators", env: PIWI_ENV_KEYS.captureLocators, kind: "bool" },
159
163
  { option: "capturePageState", env: PIWI_ENV_KEYS.capturePageState, kind: "bool" },
160
164
  { option: "capturePageInventory", env: PIWI_ENV_KEYS.capturePageInventory, kind: "bool" },
165
+ { option: "captureCodeReach", env: PIWI_ENV_KEYS.captureCodeReach, kind: "bool" },
161
166
  { option: "captureServerTraces", env: PIWI_ENV_KEYS.captureServerTraces, kind: "bool" },
162
167
  { option: "sampleAriaOnPass", env: PIWI_ENV_KEYS.sampleAriaOnPass, kind: "bool" },
163
168
  { option: "uploadManifest", env: PIWI_ENV_KEYS.uploadManifest, kind: "bool" },
package/dist/index.d.ts CHANGED
@@ -3,6 +3,8 @@ import { PlaywrightTestConfig, Locator, TestType, Page, Fixtures, PlaywrightTest
3
3
  export { PlaywrightTestConfig } from '@playwright/test';
4
4
  export { PiwiFixtures, extendPiwiFixtures, piwiFixtures } from './internal/capture/capture-fixtures.js';
5
5
  import '@piwitests/picker-dom';
6
+ import '@piwitests/core/wire';
7
+ import '@piwitests/core/code-reach';
6
8
 
7
9
  /**
8
10
  * Options for configuring the Piwi Dashboard reporter.
@@ -59,6 +61,26 @@ interface PiwiDashboardOptions {
59
61
  * Automatically disabled when `collectPerformanceMetrics` is `false`.
60
62
  */
61
63
  capturePageInventory?: boolean;
64
+ /**
65
+ * Record which application source files each test executes: the files whose
66
+ * functions ran, from Chromium's JavaScript coverage, resolved through the
67
+ * dev server's module URLs or the bundle's source maps. It answers "which
68
+ * tests reach this file?" for test selection, change coverage and
69
+ * `piwi preflight`. Only repository-relative file paths are sent. Chromium only;
70
+ * other browsers record nothing. It slows the page's JavaScript, so run it on
71
+ * one scheduled job rather than every run. **Defaults to `false`** — opt in
72
+ * with `captureCodeReach: true` (or `PIWI_CAPTURE_CODE_REACH=true`).
73
+ * Automatically disabled when `collectPerformanceMetrics` is `false`.
74
+ */
75
+ captureCodeReach?: boolean;
76
+ /**
77
+ * The directories module paths and source-map sources are resolved against
78
+ * for `captureCodeReach`, relative to the Playwright config, before the
79
+ * repository root, which is always tried last. Defaults to the Playwright
80
+ * config's directory. Set it to the dev server's root when that is not the
81
+ * config's directory (Nuxt: `['app']`).
82
+ */
83
+ codeReachRoots?: string[];
62
84
  /**
63
85
  * Capture server-side spans for each API/document request the test makes,
64
86
  * read from the `X-Piwi-Trace` response header emitted by a Piwi
@@ -175,8 +197,8 @@ interface PiwiDashboardOptions {
175
197
  label?: string;
176
198
  /**
177
199
  * Keep this run forever: the dashboard's retention never deletes it. Set it
178
- * for the runs worth keeping, such as release or tag builds. Can also be set
179
- * with `PIWI_KEEP=true`.
200
+ * for the runs worth keeping, such as release or tag builds. Defaults to
201
+ * `false`. Can also be set with `PIWI_KEEP=true`.
180
202
  */
181
203
  keep?: boolean;
182
204
  /** Related issue reference, e.g. `"JIRA-123"` */