@piwitests/reporter 0.12.0 → 0.14.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/dist/global-setup-module.d.ts +2 -1
- package/dist/global-setup-module.js +432 -3
- package/dist/index.d.ts +204 -8
- package/dist/index.js +4724 -23
- package/dist/internal/capture/attachments.d.ts +8 -3
- package/dist/internal/capture/attachments.js +46 -21
- package/dist/internal/capture/capture-fixtures.d.ts +16 -14
- package/dist/internal/capture/capture-fixtures.js +2211 -971
- package/dist/internal/capture/inspect-on-failure.d.ts +50 -0
- package/dist/internal/capture/inspect-on-failure.js +66 -0
- package/dist/internal/capture/locator-healing.d.ts +33 -190
- package/dist/internal/capture/locator-healing.js +599 -815
- package/dist/internal/capture/pick-on-failure.d.ts +198 -0
- package/dist/internal/capture/pick-on-failure.js +1203 -0
- package/package.json +9 -4
- package/dist/internal/collect/error-text.d.ts +0 -18
- package/dist/internal/collect/error-text.js +0 -79
- package/dist/internal/collect/metadata-collector.d.ts +0 -32
- package/dist/internal/collect/metadata-collector.js +0 -246
- package/dist/internal/collect/skip-classify.d.ts +0 -27
- package/dist/internal/collect/skip-classify.js +0 -40
- package/dist/internal/collect/step-analyzer.d.ts +0 -103
- package/dist/internal/collect/step-analyzer.js +0 -221
- package/dist/internal/config/env.d.ts +0 -46
- package/dist/internal/config/env.js +0 -162
- package/dist/internal/files/compression.d.ts +0 -5
- package/dist/internal/files/compression.js +0 -69
- package/dist/internal/files/file-handler.d.ts +0 -38
- package/dist/internal/files/file-handler.js +0 -207
- package/dist/internal/streaming/crash-recovery.d.ts +0 -23
- package/dist/internal/streaming/crash-recovery.js +0 -106
- package/dist/internal/streaming/stream-buffer.d.ts +0 -17
- package/dist/internal/streaming/stream-buffer.js +0 -102
- package/dist/internal/streaming/stream-manager.d.ts +0 -88
- package/dist/internal/streaming/stream-manager.js +0 -395
- package/dist/internal/submit/run-submitter.d.ts +0 -67
- package/dist/internal/submit/run-submitter.js +0 -190
- package/dist/internal/submit/serializer.d.ts +0 -45
- package/dist/internal/submit/serializer.js +0 -108
- package/dist/internal/submit/uploader.d.ts +0 -89
- package/dist/internal/submit/uploader.js +0 -226
- package/dist/internal/support/ci.d.ts +0 -2
- package/dist/internal/support/ci.js +0 -32
- package/dist/internal/support/cli-filters.d.ts +0 -1
- package/dist/internal/support/cli-filters.js +0 -51
- package/dist/internal/support/errors.d.ts +0 -8
- package/dist/internal/support/errors.js +0 -15
- package/dist/internal/support/instance-id.d.ts +0 -4
- package/dist/internal/support/instance-id.js +0 -48
- package/dist/internal/support/limiter.d.ts +0 -2
- package/dist/internal/support/limiter.js +0 -27
- package/dist/internal/support/logger.d.ts +0 -26
- package/dist/internal/support/logger.js +0 -43
- package/dist/internal/support/reporter-version.d.ts +0 -2
- package/dist/internal/support/reporter-version.js +0 -54
- package/dist/internal/support/setup-file.d.ts +0 -13
- package/dist/internal/support/setup-file.js +0 -61
- package/dist/internal/support/source-snippet.d.ts +0 -12
- package/dist/internal/support/source-snippet.js +0 -97
- package/dist/internal/support/worker-index.d.ts +0 -7
- package/dist/internal/support/worker-index.js +0 -14
- package/dist/internal/transport/http-client.d.ts +0 -52
- package/dist/internal/transport/http-client.js +0 -201
- package/dist/public/config-wrapper.d.ts +0 -21
- package/dist/public/config-wrapper.js +0 -64
- package/dist/public/global-setup.d.ts +0 -13
- package/dist/public/global-setup.js +0 -146
- package/dist/public/options.d.ts +0 -86
- package/dist/public/options.js +0 -2
- package/dist/public/reporter.d.ts +0 -68
- package/dist/public/reporter.js +0 -376
- package/dist/types/collected.d.ts +0 -97
- package/dist/types/collected.js +0 -10
- package/dist/types/wire.d.ts +0 -176
- package/dist/types/wire.js +0 -14
- package/dist/types.d.ts +0 -11
- package/dist/types.js +0 -27
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* the dogfooding `application/tests/fixtures.ts`, so producer and consumer can
|
|
6
6
|
* never drift on a name.
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
declare const ATTACHMENT_NAMES: {
|
|
9
9
|
readonly locators: "piwi-locators";
|
|
10
10
|
readonly ariaSnapshot: "piwi-aria-snapshot";
|
|
11
11
|
readonly console: "piwi-console";
|
|
@@ -13,8 +13,13 @@ export declare const ATTACHMENT_NAMES: {
|
|
|
13
13
|
readonly webVitals: "piwi-web-vitals";
|
|
14
14
|
readonly locatorSuggestion: "piwi-locator-suggestion";
|
|
15
15
|
readonly pageState: "piwi-page-state";
|
|
16
|
+
readonly userPick: "piwi-user-pick";
|
|
16
17
|
};
|
|
17
18
|
/** Set of every internal attachment name — used to skip them when collecting user attachments. */
|
|
18
|
-
|
|
19
|
+
declare const INTERNAL_ATTACHMENT_NAMES: ReadonlySet<string>;
|
|
19
20
|
/** Annotation type that surfaces a locator-healing suggestion in the report/trace. */
|
|
20
|
-
|
|
21
|
+
declare const LOCATOR_SUGGESTION_ANNOTATION: "piwi-locator-suggestion";
|
|
22
|
+
/** Annotation type that surfaces a human-confirmed replacement locator in the report/trace. */
|
|
23
|
+
declare const USER_PICK_ANNOTATION: "piwi-user-pick";
|
|
24
|
+
|
|
25
|
+
export { ATTACHMENT_NAMES, INTERNAL_ATTACHMENT_NAMES, LOCATOR_SUGGESTION_ANNOTATION, USER_PICK_ANNOTATION };
|
|
@@ -1,23 +1,48 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
* never drift on a name.
|
|
10
|
-
*/
|
|
11
|
-
exports.ATTACHMENT_NAMES = {
|
|
12
|
-
locators: 'piwi-locators',
|
|
13
|
-
ariaSnapshot: 'piwi-aria-snapshot',
|
|
14
|
-
console: 'piwi-console',
|
|
15
|
-
network: 'piwi-network',
|
|
16
|
-
webVitals: 'piwi-web-vitals',
|
|
17
|
-
locatorSuggestion: 'piwi-locator-suggestion',
|
|
18
|
-
pageState: 'piwi-page-state',
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
9
|
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/internal/capture/attachments.ts
|
|
21
|
+
var attachments_exports = {};
|
|
22
|
+
__export(attachments_exports, {
|
|
23
|
+
ATTACHMENT_NAMES: () => ATTACHMENT_NAMES,
|
|
24
|
+
INTERNAL_ATTACHMENT_NAMES: () => INTERNAL_ATTACHMENT_NAMES,
|
|
25
|
+
LOCATOR_SUGGESTION_ANNOTATION: () => LOCATOR_SUGGESTION_ANNOTATION,
|
|
26
|
+
USER_PICK_ANNOTATION: () => USER_PICK_ANNOTATION
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(attachments_exports);
|
|
29
|
+
var ATTACHMENT_NAMES = {
|
|
30
|
+
locators: "piwi-locators",
|
|
31
|
+
ariaSnapshot: "piwi-aria-snapshot",
|
|
32
|
+
console: "piwi-console",
|
|
33
|
+
network: "piwi-network",
|
|
34
|
+
webVitals: "piwi-web-vitals",
|
|
35
|
+
locatorSuggestion: "piwi-locator-suggestion",
|
|
36
|
+
pageState: "piwi-page-state",
|
|
37
|
+
userPick: "piwi-user-pick"
|
|
38
|
+
};
|
|
39
|
+
var INTERNAL_ATTACHMENT_NAMES = new Set(Object.values(ATTACHMENT_NAMES));
|
|
40
|
+
var LOCATOR_SUGGESTION_ANNOTATION = ATTACHMENT_NAMES.locatorSuggestion;
|
|
41
|
+
var USER_PICK_ANNOTATION = ATTACHMENT_NAMES.userPick;
|
|
42
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
43
|
+
0 && (module.exports = {
|
|
44
|
+
ATTACHMENT_NAMES,
|
|
45
|
+
INTERNAL_ATTACHMENT_NAMES,
|
|
46
|
+
LOCATOR_SUGGESTION_ANNOTATION,
|
|
47
|
+
USER_PICK_ANNOTATION
|
|
48
|
+
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { TestType, Fixtures, PlaywrightTestArgs, PlaywrightTestOptions, PlaywrightWorkerArgs, PlaywrightWorkerOptions, Locator } from '@playwright/test';
|
|
2
|
+
|
|
2
3
|
type FixtureArgs = {
|
|
3
4
|
[key: string]: any;
|
|
4
5
|
};
|
|
@@ -42,7 +43,7 @@ interface CapturedAttrs {
|
|
|
42
43
|
}>;
|
|
43
44
|
}
|
|
44
45
|
/** Plain-object projection of a performance entry, shipped out of the page. */
|
|
45
|
-
|
|
46
|
+
interface RawVitalEntry {
|
|
46
47
|
startTime?: number;
|
|
47
48
|
value?: number;
|
|
48
49
|
hadRecentInput?: boolean;
|
|
@@ -55,13 +56,13 @@ export interface RawVitalEntry {
|
|
|
55
56
|
* A null entry list means the entry type is unsupported (non-Chromium) — the
|
|
56
57
|
* metric is null rather than 0 so absence is distinguishable from "no shifts".
|
|
57
58
|
*/
|
|
58
|
-
|
|
59
|
+
declare function computeCoreVitals(lcpEntries: RawVitalEntry[] | null, shiftEntries: RawVitalEntry[] | null, eventEntries: RawVitalEntry[] | null): {
|
|
59
60
|
lcp: number | null;
|
|
60
61
|
cls: number | null;
|
|
61
62
|
inp: number | null;
|
|
62
63
|
} | null;
|
|
63
64
|
/** Page state captured at test end. Storage values and cookie values are NEVER included. */
|
|
64
|
-
|
|
65
|
+
interface PageState {
|
|
65
66
|
url: string;
|
|
66
67
|
hash: string | null;
|
|
67
68
|
/** `history.state` as JSON, capped and token-masked. */
|
|
@@ -87,7 +88,7 @@ export interface PageState {
|
|
|
87
88
|
}>;
|
|
88
89
|
}
|
|
89
90
|
/** Raw in-page reads shipped out of the evaluate (see `readPageState`). */
|
|
90
|
-
|
|
91
|
+
interface RawPageState {
|
|
91
92
|
url: string;
|
|
92
93
|
hash: string | null;
|
|
93
94
|
historyState: string | null;
|
|
@@ -105,7 +106,7 @@ export interface RawPageState {
|
|
|
105
106
|
* Pure and Node-side so the sanitization (token masking, caps, value-free
|
|
106
107
|
* cookies) is unit-testable.
|
|
107
108
|
*/
|
|
108
|
-
|
|
109
|
+
declare function buildPageState(raw: RawPageState, cookies: Array<Record<string, unknown>> | null): PageState;
|
|
109
110
|
/**
|
|
110
111
|
* Everything the in-page probe needs, serialized into the browser on every
|
|
111
112
|
* action. `tagRoles`/`inputRoles` are the shared role maps (single source of
|
|
@@ -114,14 +115,14 @@ export declare function buildPageState(raw: RawPageState, cookies: Array<Record<
|
|
|
114
115
|
* nothing is hand-maintained twice. Exported so the dogfood mirror
|
|
115
116
|
* (`application/tests/fixtures.ts`) reuses the same assembled object.
|
|
116
117
|
*/
|
|
117
|
-
|
|
118
|
+
interface ProbeArg {
|
|
118
119
|
keep: string[];
|
|
119
120
|
tagRoles: Record<string, string>;
|
|
120
121
|
inputRoles: Record<string, string>;
|
|
121
122
|
roleSources: string;
|
|
122
123
|
}
|
|
123
124
|
/** Built once — passed verbatim into evaluate() on every action. */
|
|
124
|
-
|
|
125
|
+
declare const CAPTURED_ATTRS_ARG: ProbeArg;
|
|
125
126
|
/**
|
|
126
127
|
* ARIA snapshot that tolerates every Playwright version the reporter supports,
|
|
127
128
|
* returning null instead of throwing so a capture can never fail the test. The
|
|
@@ -135,7 +136,7 @@ export declare const CAPTURED_ATTRS_ARG: ProbeArg;
|
|
|
135
136
|
* server-side, so the first call already returns a plain flat snapshot.
|
|
136
137
|
* - < 1.49: `locator.ariaSnapshot` does not exist — returns null up front.
|
|
137
138
|
*/
|
|
138
|
-
|
|
139
|
+
declare function ariaSnapshotBestEffort(target: Locator, timeout?: number): Promise<string | null>;
|
|
139
140
|
/**
|
|
140
141
|
* Runs inside the browser via `evaluate()` — probes a captured element for its
|
|
141
142
|
* attributes, geometry, label association, and selector-uniqueness counts.
|
|
@@ -144,7 +145,7 @@ export declare function ariaSnapshotBestEffort(target: Locator, timeout?: number
|
|
|
144
145
|
* `el` is browser-context (no DOM lib in this Node package), hence `any`.
|
|
145
146
|
* Exported for unit testing; still passed directly to `evaluate()` below.
|
|
146
147
|
*/
|
|
147
|
-
|
|
148
|
+
declare function probeElementAttrs(el: any, arg: ProbeArg): CapturedAttrs;
|
|
148
149
|
/**
|
|
149
150
|
* The fixtures `piwiFixtures` / `extendPiwiFixtures` contribute. The single
|
|
150
151
|
* added fixture is `piwiCapture`: an auto, test-scoped teardown hook that
|
|
@@ -153,7 +154,7 @@ export declare function probeElementAttrs(el: any, arg: ProbeArg): CapturedAttrs
|
|
|
153
154
|
* all capture. Exported so `piwiFixtures` and the extended `test` carry it in
|
|
154
155
|
* their types (and a collision surfaces to the type checker).
|
|
155
156
|
*/
|
|
156
|
-
|
|
157
|
+
interface PiwiFixtures {
|
|
157
158
|
piwiCapture: void;
|
|
158
159
|
}
|
|
159
160
|
/**
|
|
@@ -165,7 +166,7 @@ export interface PiwiFixtures {
|
|
|
165
166
|
* `browser.newContext()`. Collected data is attached as `piwi-*`
|
|
166
167
|
* test-info attachments which the Piwi Dashboard reporter parses on `onTestEnd`.
|
|
167
168
|
*/
|
|
168
|
-
|
|
169
|
+
declare const piwiFixtures: Fixtures<PiwiFixtures, {}, PlaywrightTestArgs & PlaywrightTestOptions, PlaywrightWorkerArgs & PlaywrightWorkerOptions>;
|
|
169
170
|
/**
|
|
170
171
|
* Extend a Playwright `test` object with the Piwi capture fixtures. The
|
|
171
172
|
* returned `test` carries the existing fixtures plus {@link PiwiFixtures}.
|
|
@@ -182,5 +183,6 @@ export declare const piwiFixtures: Fixtures<PiwiFixtures, {}, PlaywrightTestArgs
|
|
|
182
183
|
* export const test = extendPiwiFixtures(base);
|
|
183
184
|
* ```
|
|
184
185
|
*/
|
|
185
|
-
|
|
186
|
-
|
|
186
|
+
declare function extendPiwiFixtures<TestArgs extends FixtureArgs, WorkerArgs extends FixtureArgs>(test: TestType<TestArgs, WorkerArgs>): TestType<TestArgs & PiwiFixtures, WorkerArgs>;
|
|
187
|
+
|
|
188
|
+
export { CAPTURED_ATTRS_ARG, type PageState, type PiwiFixtures, type ProbeArg, type RawPageState, type RawVitalEntry, ariaSnapshotBestEffort, buildPageState, computeCoreVitals, extendPiwiFixtures, piwiFixtures, probeElementAttrs };
|