@piwitests/reporter 0.39.0 → 0.40.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.
@@ -13,6 +13,7 @@ declare const ATTACHMENT_NAMES: {
13
13
  readonly dialogs: "piwi-dialogs";
14
14
  readonly network: "piwi-network";
15
15
  readonly pageInventory: "piwi-page-inventory";
16
+ readonly locatorPages: "piwi-locator-pages";
16
17
  readonly webVitals: "piwi-web-vitals";
17
18
  readonly locatorSuggestion: "piwi-locator-suggestion";
18
19
  readonly pageState: "piwi-page-state";
@@ -34,6 +34,7 @@ var ATTACHMENT_NAMES = {
34
34
  dialogs: "piwi-dialogs",
35
35
  network: "piwi-network",
36
36
  pageInventory: "piwi-page-inventory",
37
+ locatorPages: "piwi-locator-pages",
37
38
  webVitals: "piwi-web-vitals",
38
39
  locatorSuggestion: "piwi-locator-suggestion",
39
40
  pageState: "piwi-page-state",
@@ -1,6 +1,45 @@
1
1
  import { ProbeArg } from '@piwitests/picker-dom';
2
2
  export { ProbeArg, ProbedAttrs, probeElementAttrs } from '@piwitests/picker-dom';
3
3
  import { TestType, Fixtures, PlaywrightTestArgs, PlaywrightTestOptions, PlaywrightWorkerArgs, PlaywrightWorkerOptions, Locator } from '@playwright/test';
4
+ import { LocatorPageUse } from '@piwitests/core/wire';
5
+
6
+ /** A main-frame navigation, full or same-document: the page starts over. */
7
+ declare function noteNavigation(page: object): void;
8
+ /**
9
+ * A locator call starts on `page`: returns whether it is on arrival, and counts
10
+ * it when it is an interaction (every action but `waitFor`; assertions are not).
11
+ */
12
+ declare function noteLocatorCall(page: object, method: string, assertion?: boolean): boolean;
13
+ declare class LocatorPageLog {
14
+ private readonly entries;
15
+ /** Record one call. Silently skipped without a call site, off an http(s) page, or past the limits. */
16
+ record(call: {
17
+ location: string | null;
18
+ locator: string;
19
+ url: string;
20
+ arrival: boolean;
21
+ }): void;
22
+ get size(): number;
23
+ /** The entries in the order the calls first happened. */
24
+ list(): LocatorPageUse[];
25
+ }
26
+
27
+ /**
28
+ * Register this package's `dist/` directory as a boxed stack prefix — the list
29
+ * Playwright filters its own frames with — so a wrapped action's step location
30
+ * and error stack name the test's line instead of the wrapper. `extraPrefixes`
31
+ * adds more: a fixtures file of your own that wraps locators the same way.
32
+ * Playwright's own package stays in the list. A missing hook or an unexpected
33
+ * layout leaves Playwright's defaults untouched.
34
+ */
35
+ declare function boxCaptureFrames(extraPrefixes?: readonly string[]): void;
36
+ /**
37
+ * Run a page read as an internal Playwright call: every API call made inside
38
+ * `run` is kept out of the test's steps and the trace. `owner` is the page (or
39
+ * any Playwright channel object) the reads go through; without the hook the
40
+ * read simply runs.
41
+ */
42
+ declare function internalCall<T>(owner: unknown, run: () => Promise<T>): Promise<T>;
4
43
 
5
44
  type FixtureArgs = {
6
45
  [key: string]: any;
@@ -100,6 +139,13 @@ declare function ariaSnapshotBestEffort(target: Locator, timeout?: number): Prom
100
139
  * yields null and the capture proceeds with the YAML alone.
101
140
  */
102
141
  declare function ariaSnapshotJSONBestEffort(target: Locator, timeout?: number): Promise<string | null>;
142
+ /**
143
+ * Call a Playwright method on its own receiver. Playwright names an API call
144
+ * after the method frame the call enters, so the call keeps its real name
145
+ * (`locator.fill: Timeout …`); a call through `Function.prototype.apply` is
146
+ * named `apply`.
147
+ */
148
+ declare function callMethod(target: object, prop: string | symbol, args: unknown[]): unknown;
103
149
  /**
104
150
  * The fixtures `piwiFixtures` / `extendPiwiFixtures` contribute. The single
105
151
  * added fixture is `piwiCapture`: an auto, test-scoped teardown hook that
@@ -139,4 +185,4 @@ declare const piwiFixtures: Fixtures<PiwiFixtures, {}, PlaywrightTestArgs & Play
139
185
  */
140
186
  declare function extendPiwiFixtures<TestArgs extends FixtureArgs, WorkerArgs extends FixtureArgs>(test: TestType<TestArgs, WorkerArgs>): TestType<TestArgs & PiwiFixtures, WorkerArgs>;
141
187
 
142
- export { CAPTURED_ATTRS_ARG, type PageState, type PiwiFixtures, type RawPageState, type RawVitalEntry, ariaSnapshotBestEffort, ariaSnapshotJSONBestEffort, buildPageState, computeCoreVitals, extendPiwiFixtures, piwiFixtures };
188
+ export { CAPTURED_ATTRS_ARG, LocatorPageLog, type PageState, type PiwiFixtures, type RawPageState, type RawVitalEntry, ariaSnapshotBestEffort, ariaSnapshotJSONBestEffort, boxCaptureFrames, buildPageState, callMethod, computeCoreVitals, extendPiwiFixtures, internalCall, noteLocatorCall, noteNavigation, piwiFixtures };