@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.
- package/README.md +3 -3
- package/dist/cli/index.js +3794 -511
- package/dist/global-setup-module.js +5 -0
- package/dist/index.d.ts +24 -2
- package/dist/index.js +3675 -2155
- package/dist/internal/capture/attachments.d.ts +2 -0
- package/dist/internal/capture/attachments.js +2 -0
- package/dist/internal/capture/capture-fixtures.d.ts +75 -2
- package/dist/internal/capture/capture-fixtures.js +1453 -144
- package/dist/internal/capture/locator-healing.js +9 -2
- package/dist/internal/capture/pick-on-failure.js +15 -2
- package/package.json +1 -1
- package/templates/skills/fix-a-reported-bug/SKILL.md +47 -0
- package/templates/skills/run-the-right-tests/SKILL.md +13 -1
|
@@ -13,6 +13,8 @@ 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";
|
|
17
|
+
readonly codeReach: "piwi-code-reach";
|
|
16
18
|
readonly webVitals: "piwi-web-vitals";
|
|
17
19
|
readonly locatorSuggestion: "piwi-locator-suggestion";
|
|
18
20
|
readonly pageState: "piwi-page-state";
|
|
@@ -34,6 +34,8 @@ var ATTACHMENT_NAMES = {
|
|
|
34
34
|
dialogs: "piwi-dialogs",
|
|
35
35
|
network: "piwi-network",
|
|
36
36
|
pageInventory: "piwi-page-inventory",
|
|
37
|
+
locatorPages: "piwi-locator-pages",
|
|
38
|
+
codeReach: "piwi-code-reach",
|
|
37
39
|
webVitals: "piwi-web-vitals",
|
|
38
40
|
locatorSuggestion: "piwi-locator-suggestion",
|
|
39
41
|
pageState: "piwi-page-state",
|
|
@@ -1,6 +1,70 @@
|
|
|
1
1
|
import { ProbeArg } from '@piwitests/picker-dom';
|
|
2
2
|
export { ProbeArg, ProbedAttrs, probeElementAttrs } from '@piwitests/picker-dom';
|
|
3
|
-
import { TestType, Fixtures, PlaywrightTestArgs, PlaywrightTestOptions, PlaywrightWorkerArgs, PlaywrightWorkerOptions, Locator } from '@playwright/test';
|
|
3
|
+
import { Page, TestType, Fixtures, PlaywrightTestArgs, PlaywrightTestOptions, PlaywrightWorkerArgs, PlaywrightWorkerOptions, Locator } from '@playwright/test';
|
|
4
|
+
import { LocatorPageUse } from '@piwitests/core/wire';
|
|
5
|
+
import { JsCoverageEntry } from '@piwitests/core/code-reach';
|
|
6
|
+
|
|
7
|
+
/** A main-frame navigation, full or same-document: the page starts over. */
|
|
8
|
+
declare function noteNavigation(page: object): void;
|
|
9
|
+
/**
|
|
10
|
+
* A locator call starts on `page`: returns whether it is on arrival, and counts
|
|
11
|
+
* it when it is an interaction (every action but `waitFor`; assertions are not).
|
|
12
|
+
*/
|
|
13
|
+
declare function noteLocatorCall(page: object, method: string, assertion?: boolean): boolean;
|
|
14
|
+
declare class LocatorPageLog {
|
|
15
|
+
private readonly entries;
|
|
16
|
+
/** Record one call. Silently skipped without a call site, off an http(s) page, or past the limits. */
|
|
17
|
+
record(call: {
|
|
18
|
+
location: string | null;
|
|
19
|
+
locator: string;
|
|
20
|
+
url: string;
|
|
21
|
+
arrival: boolean;
|
|
22
|
+
}): void;
|
|
23
|
+
get size(): number;
|
|
24
|
+
/** The entries in the order the calls first happened. */
|
|
25
|
+
list(): LocatorPageUse[];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Register this package's `dist/` directory as a boxed stack prefix — the list
|
|
30
|
+
* Playwright filters its own frames with — so a wrapped action's step location
|
|
31
|
+
* and error stack name the test's line instead of the wrapper. `extraPrefixes`
|
|
32
|
+
* adds more: a fixtures file of your own that wraps locators the same way.
|
|
33
|
+
* Playwright's own package stays in the list. A missing hook or an unexpected
|
|
34
|
+
* layout leaves Playwright's defaults untouched.
|
|
35
|
+
*/
|
|
36
|
+
declare function boxCaptureFrames(extraPrefixes?: readonly string[]): void;
|
|
37
|
+
/**
|
|
38
|
+
* Run a page read as an internal Playwright call: every API call made inside
|
|
39
|
+
* `run` is kept out of the test's steps and the trace. `owner` is the page (or
|
|
40
|
+
* any Playwright channel object) the reads go through; without the hook the
|
|
41
|
+
* read simply runs.
|
|
42
|
+
*/
|
|
43
|
+
declare function internalCall<T>(owner: unknown, run: () => Promise<T>): Promise<T>;
|
|
44
|
+
|
|
45
|
+
/** Where code reach resolves paths. */
|
|
46
|
+
interface CodeReachRoots {
|
|
47
|
+
/** Directories a module path or a map source is tried against, first match wins; the repository root is last. */
|
|
48
|
+
roots: string[];
|
|
49
|
+
/** Paths go out relative to it. */
|
|
50
|
+
repoRoot: string;
|
|
51
|
+
}
|
|
52
|
+
/** Fetches a source map's text; null when it cannot. */
|
|
53
|
+
type MapFetcher = (url: string) => Promise<string | null>;
|
|
54
|
+
/**
|
|
55
|
+
* The roots for a test: `codeReachRoots` when set, else the Playwright config's
|
|
56
|
+
* directory; the repository root always comes last, since bundlers name
|
|
57
|
+
* sources from the project root (Turbopack's `[project]/`).
|
|
58
|
+
*/
|
|
59
|
+
declare function codeReachRoots(configDir: string, configured: string[] | null | undefined): CodeReachRoots;
|
|
60
|
+
/** The repository-relative files the covered scripts reached, sorted and capped. */
|
|
61
|
+
declare function resolveCodeReach(entries: JsCoverageEntry[], roots: CodeReachRoots, fetchMap: MapFetcher): Promise<string[]>;
|
|
62
|
+
/** A map fetcher through the page's request context, bounded in size and time. */
|
|
63
|
+
declare function pageMapFetcher(page: Page): MapFetcher;
|
|
64
|
+
/** Start JavaScript coverage on a page; false when the browser has none or it fails. */
|
|
65
|
+
declare function startCodeReach(page: Page): Promise<boolean>;
|
|
66
|
+
/** Stop JavaScript coverage and return its entries; null when it cannot be read. */
|
|
67
|
+
declare function stopCodeReach(page: Page): Promise<JsCoverageEntry[] | null>;
|
|
4
68
|
|
|
5
69
|
type FixtureArgs = {
|
|
6
70
|
[key: string]: any;
|
|
@@ -24,6 +88,8 @@ declare function computeCoreVitals(lcpEntries: RawVitalEntry[] | null, shiftEntr
|
|
|
24
88
|
cls: number | null;
|
|
25
89
|
inp: number | null;
|
|
26
90
|
} | null;
|
|
91
|
+
/** The code reach roots from `PIWI_CODE_REACH_ROOTS` (a JSON array or a path list). */
|
|
92
|
+
declare function configuredCodeReachRoots(): string[] | null;
|
|
27
93
|
/** Page state captured at test end. Storage values and cookie values are NEVER included. */
|
|
28
94
|
interface PageState {
|
|
29
95
|
url: string;
|
|
@@ -100,6 +166,13 @@ declare function ariaSnapshotBestEffort(target: Locator, timeout?: number): Prom
|
|
|
100
166
|
* yields null and the capture proceeds with the YAML alone.
|
|
101
167
|
*/
|
|
102
168
|
declare function ariaSnapshotJSONBestEffort(target: Locator, timeout?: number): Promise<string | null>;
|
|
169
|
+
/**
|
|
170
|
+
* Call a Playwright method on its own receiver. Playwright names an API call
|
|
171
|
+
* after the method frame the call enters, so the call keeps its real name
|
|
172
|
+
* (`locator.fill: Timeout …`); a call through `Function.prototype.apply` is
|
|
173
|
+
* named `apply`.
|
|
174
|
+
*/
|
|
175
|
+
declare function callMethod(target: object, prop: string | symbol, args: unknown[]): unknown;
|
|
103
176
|
/**
|
|
104
177
|
* The fixtures `piwiFixtures` / `extendPiwiFixtures` contribute. The single
|
|
105
178
|
* added fixture is `piwiCapture`: an auto, test-scoped teardown hook that
|
|
@@ -139,4 +212,4 @@ declare const piwiFixtures: Fixtures<PiwiFixtures, {}, PlaywrightTestArgs & Play
|
|
|
139
212
|
*/
|
|
140
213
|
declare function extendPiwiFixtures<TestArgs extends FixtureArgs, WorkerArgs extends FixtureArgs>(test: TestType<TestArgs, WorkerArgs>): TestType<TestArgs & PiwiFixtures, WorkerArgs>;
|
|
141
214
|
|
|
142
|
-
export { CAPTURED_ATTRS_ARG, type PageState, type PiwiFixtures, type RawPageState, type RawVitalEntry, ariaSnapshotBestEffort, ariaSnapshotJSONBestEffort, buildPageState, computeCoreVitals, extendPiwiFixtures, piwiFixtures };
|
|
215
|
+
export { CAPTURED_ATTRS_ARG, LocatorPageLog, type PageState, type PiwiFixtures, type RawPageState, type RawVitalEntry, ariaSnapshotBestEffort, ariaSnapshotJSONBestEffort, boxCaptureFrames, buildPageState, callMethod, codeReachRoots, computeCoreVitals, configuredCodeReachRoots, extendPiwiFixtures, internalCall, noteLocatorCall, noteNavigation, pageMapFetcher, piwiFixtures, resolveCodeReach, startCodeReach, stopCodeReach };
|