@empiricalrun/playwright-utils 0.62.1 → 0.63.1
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/CHANGELOG.md +26 -0
- package/dist/api-worker-client.d.ts +0 -13
- package/dist/api-worker-client.d.ts.map +1 -1
- package/dist/api-worker-client.js +0 -15
- package/dist/auth/google.d.ts.map +1 -1
- package/dist/auth/google.js +0 -1
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +0 -9
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +0 -8
- package/dist/generated/api-worker-openapi.d.ts +3031 -1420
- package/dist/generated/api-worker-openapi.d.ts.map +1 -1
- package/dist/overlay-tests/cache.spec.js +31 -17
- package/dist/overlay-tests/click.spec.js +2 -25
- package/dist/overlay-tests/dismiss-mechanics.spec.d.ts +2 -0
- package/dist/overlay-tests/dismiss-mechanics.spec.d.ts.map +1 -0
- package/dist/overlay-tests/dismiss-mechanics.spec.js +59 -0
- package/dist/overlay-tests/dropdown.spec.d.ts +2 -0
- package/dist/overlay-tests/dropdown.spec.d.ts.map +1 -0
- package/dist/overlay-tests/dropdown.spec.js +53 -0
- package/dist/overlay-tests/fixtures.d.ts +3 -1
- package/dist/overlay-tests/fixtures.d.ts.map +1 -1
- package/dist/overlay-tests/fixtures.js +15 -0
- package/dist/overlay-tests/typesafe-hit-check.spec.d.ts +2 -0
- package/dist/overlay-tests/typesafe-hit-check.spec.d.ts.map +1 -0
- package/dist/overlay-tests/typesafe-hit-check.spec.js +57 -0
- package/dist/overlay-tests/typesafe.spec.d.ts +2 -0
- package/dist/overlay-tests/typesafe.spec.d.ts.map +1 -0
- package/dist/overlay-tests/typesafe.spec.js +86 -0
- package/dist/playwright-extensions.d.ts.map +1 -1
- package/dist/playwright-extensions.js +0 -1
- package/dist/reporter/attachment-cleanup-test-reporter.d.ts +0 -6
- package/dist/reporter/attachment-cleanup-test-reporter.d.ts.map +1 -1
- package/dist/reporter/attachment-cleanup-test-reporter.js +0 -6
- package/dist/reporter/attachment-cleanup.d.ts +0 -33
- package/dist/reporter/attachment-cleanup.d.ts.map +1 -1
- package/dist/reporter/attachment-cleanup.js +2 -51
- package/dist/reporter/empirical-reporter.d.ts.map +1 -1
- package/dist/reporter/empirical-reporter.js +0 -9
- package/dist/reporter/harness.d.ts +0 -62
- package/dist/reporter/harness.d.ts.map +1 -1
- package/dist/reporter/harness.js +1 -53
- package/dist/reporter/ibr-utils.d.ts +0 -5
- package/dist/reporter/ibr-utils.d.ts.map +1 -1
- package/dist/reporter/ibr-utils.js +0 -5
- package/dist/reporter/incremental-blob-reporter.d.ts +0 -17
- package/dist/reporter/incremental-blob-reporter.d.ts.map +1 -1
- package/dist/reporter/incremental-blob-reporter.js +5 -35
- package/dist/reporter/lifecycle-events.d.ts.map +1 -1
- package/dist/reporter/lifecycle-events.js +0 -9
- package/dist/reporter/parity-utils.d.ts +0 -30
- package/dist/reporter/parity-utils.d.ts.map +1 -1
- package/dist/reporter/parity-utils.js +4 -28
- package/dist/reporter/reporter-state.d.ts +0 -12
- package/dist/reporter/reporter-state.d.ts.map +1 -1
- package/dist/reporter/reporter-state.js +0 -12
- package/dist/reporter/test-case-sync.d.ts.map +1 -1
- package/dist/reporter/test-case-sync.js +0 -12
- package/dist/reporter/uploader.d.ts.map +1 -1
- package/dist/reporter/uploader.js +0 -6
- package/dist/reporter/util.d.ts +0 -33
- package/dist/reporter/util.d.ts.map +1 -1
- package/dist/reporter/util.js +0 -37
- package/dist/telemetry.d.ts.map +1 -1
- package/dist/telemetry.js +1 -10
- package/dist/test/coverage.d.ts.map +1 -1
- package/dist/test/coverage.js +1 -3
- package/dist/test/expect/visual.d.ts.map +1 -1
- package/dist/test/expect/visual.js +1 -9
- package/dist/test/index.d.ts.map +1 -1
- package/dist/test/index.js +4 -21
- package/dist/test/scripts/agent-capabilities.js +2 -2
- package/dist/test/scripts/index.d.ts +2 -2
- package/dist/test/scripts/index.d.ts.map +1 -1
- package/dist/test/scripts/index.js +3 -16
- package/dist/test/scripts/pw-locator-patch/actions/click.d.ts.map +1 -0
- package/dist/test/scripts/pw-locator-patch/{highlight → actions}/click.js +8 -6
- package/dist/test/scripts/pw-locator-patch/actions/hover.d.ts.map +1 -0
- package/dist/test/scripts/pw-locator-patch/{highlight → actions}/hover.js +0 -3
- package/dist/test/scripts/pw-locator-patch/dismiss-overlays/cache.d.ts +1 -1
- package/dist/test/scripts/pw-locator-patch/dismiss-overlays/cache.d.ts.map +1 -1
- package/dist/test/scripts/pw-locator-patch/dismiss-overlays/cache.js +9 -13
- package/dist/test/scripts/pw-locator-patch/dismiss-overlays/index.d.ts +3 -0
- package/dist/test/scripts/pw-locator-patch/dismiss-overlays/index.d.ts.map +1 -1
- package/dist/test/scripts/pw-locator-patch/dismiss-overlays/index.js +14 -12
- package/dist/test/scripts/pw-locator-patch/dismiss-overlays/prompt.d.ts.map +1 -1
- package/dist/test/scripts/pw-locator-patch/dismiss-overlays/prompt.js +0 -1
- package/dist/test/scripts/pw-locator-patch/dismiss-overlays/typesafe.d.ts +38 -0
- package/dist/test/scripts/pw-locator-patch/dismiss-overlays/typesafe.d.ts.map +1 -0
- package/dist/test/scripts/pw-locator-patch/dismiss-overlays/typesafe.js +159 -0
- package/dist/test/scripts/pw-locator-patch/dismiss-overlays/utils.d.ts +3 -0
- package/dist/test/scripts/pw-locator-patch/dismiss-overlays/utils.d.ts.map +1 -1
- package/dist/test/scripts/pw-locator-patch/dismiss-overlays/utils.js +13 -5
- package/dist/test/scripts/pw-locator-patch/utils/index.d.ts +0 -1
- package/dist/test/scripts/pw-locator-patch/utils/index.d.ts.map +1 -1
- package/dist/test/scripts/pw-locator-patch/utils/index.js +0 -18
- package/dist/test/types.d.ts +2 -5
- package/dist/test/types.d.ts.map +1 -1
- package/dist/test/video-labels.d.ts.map +1 -1
- package/dist/test/video-labels.js +0 -1
- package/dist/webhook.d.ts.map +1 -1
- package/dist/webhook.js +0 -3
- package/docs/fixtures.md +4 -5
- package/package.json +6 -6
- package/playwright.config.ts +0 -4
- package/tsconfig.tsbuildinfo +1 -1
- package/upstream-oracle/ibr-adapter.js +0 -23
- package/upstream-oracle/run.mjs +1 -69
- package/dist/test/scripts/locator-highlights.d.ts +0 -4
- package/dist/test/scripts/locator-highlights.d.ts.map +0 -1
- package/dist/test/scripts/locator-highlights.js +0 -28
- package/dist/test/scripts/pw-locator-patch/highlight/click.d.ts.map +0 -1
- package/dist/test/scripts/pw-locator-patch/highlight/expect.d.ts +0 -5
- package/dist/test/scripts/pw-locator-patch/highlight/expect.d.ts.map +0 -1
- package/dist/test/scripts/pw-locator-patch/highlight/expect.js +0 -23
- package/dist/test/scripts/pw-locator-patch/highlight/hover.d.ts.map +0 -1
- package/dist/test/scripts/pw-locator-patch/highlight/inner-text.d.ts +0 -6
- package/dist/test/scripts/pw-locator-patch/highlight/inner-text.d.ts.map +0 -1
- package/dist/test/scripts/pw-locator-patch/highlight/inner-text.js +0 -30
- package/dist/test/scripts/pw-locator-patch/highlight/input-value.d.ts +0 -6
- package/dist/test/scripts/pw-locator-patch/highlight/input-value.d.ts.map +0 -1
- package/dist/test/scripts/pw-locator-patch/highlight/input-value.js +0 -30
- package/dist/test/scripts/pw-locator-patch/highlight/is-checked.d.ts +0 -6
- package/dist/test/scripts/pw-locator-patch/highlight/is-checked.d.ts.map +0 -1
- package/dist/test/scripts/pw-locator-patch/highlight/is-checked.js +0 -30
- package/dist/test/scripts/pw-locator-patch/highlight/is-disabled.d.ts +0 -6
- package/dist/test/scripts/pw-locator-patch/highlight/is-disabled.d.ts.map +0 -1
- package/dist/test/scripts/pw-locator-patch/highlight/is-disabled.js +0 -30
- package/dist/test/scripts/pw-locator-patch/highlight/is-editable.d.ts +0 -6
- package/dist/test/scripts/pw-locator-patch/highlight/is-editable.d.ts.map +0 -1
- package/dist/test/scripts/pw-locator-patch/highlight/is-editable.js +0 -29
- package/dist/test/scripts/pw-locator-patch/highlight/text-content.d.ts +0 -6
- package/dist/test/scripts/pw-locator-patch/highlight/text-content.d.ts.map +0 -1
- package/dist/test/scripts/pw-locator-patch/highlight/text-content.js +0 -30
- /package/dist/test/scripts/pw-locator-patch/{highlight → actions}/click.d.ts +0 -0
- /package/dist/test/scripts/pw-locator-patch/{highlight → actions}/hover.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lifecycle-events.d.ts","sourceRoot":"","sources":["../../src/reporter/lifecycle-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EACX,UAAU,EACV,KAAK,EACL,QAAQ,EACR,SAAS,EACT,UAAU,EACV,QAAQ,EACR,UAAU,EACX,MAAM,2BAA2B,CAAC;AAmBnC,MAAM,MAAM,SAAS,GAAG;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,UAAU,EAClB,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GAClB,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"lifecycle-events.d.ts","sourceRoot":"","sources":["../../src/reporter/lifecycle-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EACX,UAAU,EACV,KAAK,EACL,QAAQ,EACR,SAAS,EACT,UAAU,EACV,QAAQ,EACR,UAAU,EACX,MAAM,2BAA2B,CAAC;AAmBnC,MAAM,MAAM,SAAS,GAAG;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,UAAU,EAClB,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GAClB,SAAS,EAAE,CAkDb;AAGD,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,WAAW,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EAChC,OAAO,EAAE,MAAM,GACd,SAAS,CA4BX;AAED,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,QAAQ,EACd,MAAM,EAAE,UAAU,EAClB,IAAI,EAAE,QAAQ,EACd,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAChC,SAAS,EAAE,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,EAChC,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,qBAAqB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GACzC,SAAS,EAAE,CAkCb;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,UAAU,GAAG,SAAS,CAW7D"}
|
|
@@ -20,7 +20,6 @@ const BLOB_REPORT_VERSION = 2;
|
|
|
20
20
|
function buildOnBeginEvents(config, suite, shardIndex, totalShards) {
|
|
21
21
|
const events = [];
|
|
22
22
|
const rootDir = config.rootDir || "";
|
|
23
|
-
// 1. onBlobReportMetadata
|
|
24
23
|
const osName = process.platform === "darwin" ? "macOS" : process.platform;
|
|
25
24
|
const osVersion = os_1.default.release();
|
|
26
25
|
events.push({
|
|
@@ -43,9 +42,6 @@ function buildOnBeginEvents(config, suite, shardIndex, totalShards) {
|
|
|
43
42
|
maxFailures: config.maxFailures,
|
|
44
43
|
metadata: config.metadata,
|
|
45
44
|
rootDir: config.rootDir,
|
|
46
|
-
// Round-trips into the merged report's FullConfig: `shard` and
|
|
47
|
-
// `failOnFlakyTests` drive reporter behaviour after the merge, and
|
|
48
|
-
// `tags` carries the config-level global tag.
|
|
49
45
|
shard: config.shard,
|
|
50
46
|
version: config.version,
|
|
51
47
|
workers: config.workers,
|
|
@@ -57,7 +53,6 @@ function buildOnBeginEvents(config, suite, shardIndex, totalShards) {
|
|
|
57
53
|
},
|
|
58
54
|
},
|
|
59
55
|
});
|
|
60
|
-
// 3. onProject for each project
|
|
61
56
|
for (const projectSuite of suite.suites) {
|
|
62
57
|
const project = config.projects.find((p) => p.name === projectSuite.title);
|
|
63
58
|
if (!project) {
|
|
@@ -65,7 +60,6 @@ function buildOnBeginEvents(config, suite, shardIndex, totalShards) {
|
|
|
65
60
|
}
|
|
66
61
|
events.push(buildOnProjectEvent(project, projectSuite, rootDir));
|
|
67
62
|
}
|
|
68
|
-
// 4. onBegin (empty params per Playwright format)
|
|
69
63
|
events.push({ method: "onBegin" });
|
|
70
64
|
return events;
|
|
71
65
|
}
|
|
@@ -261,8 +255,6 @@ function buildOnStepBeginEvent(test, result, step, resultIdMap, stepIdMap, rootD
|
|
|
261
255
|
function buildOnStepEndEvents(test, result, step, resultIdMap, stepIdMap, rootDir, stagingDir, knownAttachmentCounts) {
|
|
262
256
|
const resultId = (0, ibr_utils_1.getOrCreateId)(resultIdMap, `${test.id}-${result.retry}`);
|
|
263
257
|
const stepId = (0, ibr_utils_1.getOrCreateStepId)(stepIdMap, step);
|
|
264
|
-
// Anything the step attached has to reach the receiver before the step end
|
|
265
|
-
// that indexes into it.
|
|
266
258
|
const events = buildNewAttachmentEvents(test, result, resultId, stagingDir, knownAttachmentCounts);
|
|
267
259
|
events.push({
|
|
268
260
|
method: "onStepEnd",
|
|
@@ -272,7 +264,6 @@ function buildOnStepEndEvents(test, result, step, resultIdMap, stepIdMap, rootDi
|
|
|
272
264
|
step: {
|
|
273
265
|
id: stepId,
|
|
274
266
|
duration: step.duration,
|
|
275
|
-
// Raw pass-through, like the result errors above.
|
|
276
267
|
error: step.error,
|
|
277
268
|
// Indices into the result's attachments, matching
|
|
278
269
|
// TeleReporterEmitter._serializeStepEnd.
|
|
@@ -2,12 +2,6 @@ import type { BlobEvent } from "./harness";
|
|
|
2
2
|
export interface NormalizedAttachment {
|
|
3
3
|
name: string;
|
|
4
4
|
contentType: string;
|
|
5
|
-
/**
|
|
6
|
-
* Whether the merged report still points at real content (path or inline
|
|
7
|
-
* body). Compared only where a scenario opts in: the empirical pipeline
|
|
8
|
-
* resolves attachment bytes through _empirical_urls.json, so name+type is
|
|
9
|
-
* the baseline parity contract.
|
|
10
|
-
*/
|
|
11
5
|
hasContent: boolean;
|
|
12
6
|
}
|
|
13
7
|
export interface NormalizedResult {
|
|
@@ -46,39 +40,15 @@ export interface NormalizedReport {
|
|
|
46
40
|
stats: Record<string, unknown>;
|
|
47
41
|
}
|
|
48
42
|
export interface NormalizeOptions {
|
|
49
|
-
/** Absolute fixture dir, replaced with a stable token in messages. */
|
|
50
43
|
cwd: string;
|
|
51
|
-
/** Include attachment `hasContent` in the comparison (see above). */
|
|
52
44
|
compareAttachmentContent?: boolean;
|
|
53
45
|
}
|
|
54
46
|
export declare function normalizeJsonReport(report: Record<string, unknown>, opts: NormalizeOptions): NormalizedReport;
|
|
55
|
-
/**
|
|
56
|
-
* Per-result step signatures from a raw blob event stream, keyed by
|
|
57
|
-
* `testId:retry` (stable across both reporters — they see the same run).
|
|
58
|
-
* The merged JSON report drops steps, so step parity is checked here.
|
|
59
|
-
*/
|
|
60
47
|
export declare function stepSignatures(events: BlobEvent[]): Map<string, string[]>;
|
|
61
|
-
/**
|
|
62
|
-
* What a reporter would see for `step.attachments` DURING onStepEnd, replayed
|
|
63
|
-
* from the raw event stream the way teleReceiver does it: onAttach pushes onto
|
|
64
|
-
* `result.attachments`, and a step end carries indices into that array
|
|
65
|
-
* (TeleTestStep.attachments resolves them at access time). An attachment that
|
|
66
|
-
* only arrives at test end therefore reads as `<missing>` here.
|
|
67
|
-
*
|
|
68
|
-
* Keyed by `testId:retry`; each entry is one `title -> [names]` line per
|
|
69
|
-
* onStepEnd, in stream order.
|
|
70
|
-
*/
|
|
71
48
|
export declare function stepAttachmentsAtStepEnd(events: BlobEvent[]): Map<string, string[]>;
|
|
72
|
-
/**
|
|
73
|
-
* The onConfigure config payload plus every onProject project payload, keyed
|
|
74
|
-
* by project name. The merged report's FullConfig/FullProject is rebuilt from
|
|
75
|
-
* exactly these, and normalizeJsonReport compares only the suite/stats body —
|
|
76
|
-
* so this is where config and project serialization drift shows up.
|
|
77
|
-
*/
|
|
78
49
|
export declare function configAndProjects(events: BlobEvent[]): {
|
|
79
50
|
config: unknown;
|
|
80
51
|
projects: Record<string, unknown>;
|
|
81
52
|
};
|
|
82
|
-
/** Event method names present in `reference` but absent from `candidate`. */
|
|
83
53
|
export declare function missingEventMethods(reference: BlobEvent[], candidate: BlobEvent[]): string[];
|
|
84
54
|
//# sourceMappingURL=parity-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parity-utils.d.ts","sourceRoot":"","sources":["../../src/reporter/parity-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"parity-utils.d.ts","sourceRoot":"","sources":["../../src/reporter/parity-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAyC3C,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,EAAE,oBAAoB,EAAE,CAAC;CACrC;AAED,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACtD,OAAO,EAAE,gBAAgB,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;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|
73
|
-
/**
|
|
74
|
-
* Per-result step signatures from a raw blob event stream, keyed by
|
|
75
|
-
* `testId:retry` (stable across both reporters — they see the same run).
|
|
76
|
-
* The merged JSON report drops steps, so step parity is checked here.
|
|
77
|
-
*/
|
|
78
73
|
function stepSignatures(events) {
|
|
79
|
-
const resultKey = new Map();
|
|
74
|
+
const resultKey = new Map();
|
|
80
75
|
for (const event of events) {
|
|
81
76
|
if (event.method !== "onTestBegin") {
|
|
82
77
|
continue;
|
|
@@ -95,8 +90,6 @@ function stepSignatures(events) {
|
|
|
95
90
|
continue;
|
|
96
91
|
}
|
|
97
92
|
const list = signatures.get(key) ?? [];
|
|
98
|
-
// The location is part of the signature: it travels relative to rootDir
|
|
99
|
-
// and the merged HTML report renders it as-is.
|
|
100
93
|
const location = params.step.location
|
|
101
94
|
? `${params.step.location.file}:${params.step.location.line}`
|
|
102
95
|
: "";
|
|
@@ -108,20 +101,10 @@ function stepSignatures(events) {
|
|
|
108
101
|
}
|
|
109
102
|
return signatures;
|
|
110
103
|
}
|
|
111
|
-
/**
|
|
112
|
-
* What a reporter would see for `step.attachments` DURING onStepEnd, replayed
|
|
113
|
-
* from the raw event stream the way teleReceiver does it: onAttach pushes onto
|
|
114
|
-
* `result.attachments`, and a step end carries indices into that array
|
|
115
|
-
* (TeleTestStep.attachments resolves them at access time). An attachment that
|
|
116
|
-
* only arrives at test end therefore reads as `<missing>` here.
|
|
117
|
-
*
|
|
118
|
-
* Keyed by `testId:retry`; each entry is one `title -> [names]` line per
|
|
119
|
-
* onStepEnd, in stream order.
|
|
120
|
-
*/
|
|
121
104
|
function stepAttachmentsAtStepEnd(events) {
|
|
122
|
-
const resultKey = new Map();
|
|
123
|
-
const attachmentNames = new Map();
|
|
124
|
-
const stepTitles = new Map();
|
|
105
|
+
const resultKey = new Map();
|
|
106
|
+
const attachmentNames = new Map();
|
|
107
|
+
const stepTitles = new Map();
|
|
125
108
|
const views = new Map();
|
|
126
109
|
for (const event of events) {
|
|
127
110
|
if (event.method === "onTestBegin") {
|
|
@@ -153,12 +136,6 @@ function stepAttachmentsAtStepEnd(events) {
|
|
|
153
136
|
}
|
|
154
137
|
return views;
|
|
155
138
|
}
|
|
156
|
-
/**
|
|
157
|
-
* The onConfigure config payload plus every onProject project payload, keyed
|
|
158
|
-
* by project name. The merged report's FullConfig/FullProject is rebuilt from
|
|
159
|
-
* exactly these, and normalizeJsonReport compares only the suite/stats body —
|
|
160
|
-
* so this is where config and project serialization drift shows up.
|
|
161
|
-
*/
|
|
162
139
|
function configAndProjects(events) {
|
|
163
140
|
let config;
|
|
164
141
|
const projects = {};
|
|
@@ -173,7 +150,6 @@ function configAndProjects(events) {
|
|
|
173
150
|
}
|
|
174
151
|
return { config, projects };
|
|
175
152
|
}
|
|
176
|
-
/** Event method names present in `reference` but absent from `candidate`. */
|
|
177
153
|
function missingEventMethods(reference, candidate) {
|
|
178
154
|
const candidateMethods = new Set(candidate.map((e) => e.method));
|
|
179
155
|
return [
|
|
@@ -1,16 +1,4 @@
|
|
|
1
1
|
export declare function isFinalized(): boolean;
|
|
2
2
|
export declare function setFinalized(): void;
|
|
3
|
-
/**
|
|
4
|
-
* Whether a result is a by-product of interruption shutdown rather than a
|
|
5
|
-
* finished attempt: an "interrupted" result is a test cut off mid-flight, and
|
|
6
|
-
* a post-signal "skipped" is a serial sibling Playwright marks off while
|
|
7
|
-
* shutting down. The resume shard re-runs both. A post-signal passed/failed is
|
|
8
|
-
* real, though: the test finished its body and only its aftermath overlapped
|
|
9
|
-
* the shutdown.
|
|
10
|
-
*
|
|
11
|
-
* Shared so the blob and the run ledger agree on which results count; when
|
|
12
|
-
* they disagree, the ledger calls a test unfinished that the blob already
|
|
13
|
-
* holds, and the merged report gets it twice.
|
|
14
|
-
*/
|
|
15
3
|
export declare function isShutdownArtifact(status: string, postSignal: boolean): boolean;
|
|
16
4
|
//# sourceMappingURL=reporter-state.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reporter-state.d.ts","sourceRoot":"","sources":["../../src/reporter/reporter-state.ts"],"names":[],"mappings":"AAEA,wBAAgB,WAAW,IAAI,OAAO,CAErC;AAED,wBAAgB,YAAY,IAAI,IAAI,CAEnC;AAED
|
|
1
|
+
{"version":3,"file":"reporter-state.d.ts","sourceRoot":"","sources":["../../src/reporter/reporter-state.ts"],"names":[],"mappings":"AAEA,wBAAgB,WAAW,IAAI,OAAO,CAErC;AAED,wBAAgB,YAAY,IAAI,IAAI,CAEnC;AAED,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,OAAO,GAClB,OAAO,CAET"}
|
|
@@ -10,18 +10,6 @@ function isFinalized() {
|
|
|
10
10
|
function setFinalized() {
|
|
11
11
|
_finalized = true;
|
|
12
12
|
}
|
|
13
|
-
/**
|
|
14
|
-
* Whether a result is a by-product of interruption shutdown rather than a
|
|
15
|
-
* finished attempt: an "interrupted" result is a test cut off mid-flight, and
|
|
16
|
-
* a post-signal "skipped" is a serial sibling Playwright marks off while
|
|
17
|
-
* shutting down. The resume shard re-runs both. A post-signal passed/failed is
|
|
18
|
-
* real, though: the test finished its body and only its aftermath overlapped
|
|
19
|
-
* the shutdown.
|
|
20
|
-
*
|
|
21
|
-
* Shared so the blob and the run ledger agree on which results count; when
|
|
22
|
-
* they disagree, the ledger calls a test unfinished that the blob already
|
|
23
|
-
* holds, and the merged report gets it twice.
|
|
24
|
-
*/
|
|
25
13
|
function isShutdownArtifact(status, postSignal) {
|
|
26
14
|
return status === "interrupted" || (postSignal && status === "skipped");
|
|
27
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-case-sync.d.ts","sourceRoot":"","sources":["../../src/reporter/test-case-sync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,oBAAoB,EAErB,MAAM,6CAA6C,CAAC;AACrD,OAAO,KAAK,EACV,UAAU,EAEV,KAAK,EAEN,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"test-case-sync.d.ts","sourceRoot":"","sources":["../../src/reporter/test-case-sync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,oBAAoB,EAErB,MAAM,6CAA6C,CAAC;AACrD,OAAO,KAAK,EACV,UAAU,EAEV,KAAK,EAEN,MAAM,2BAA2B,CAAC;AAMnC,YAAY,EACV,uBAAuB,EACvB,6BAA6B,EAC7B,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,6CAA6C,CAAC;AAoTrD,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,UAAU,EAClB,SAAS,EAAE,KAAK,GACf,oBAAoB,CAyBtB"}
|
|
@@ -108,12 +108,6 @@ function collectOutermostSerialGroup(rootDir, suite, state) {
|
|
|
108
108
|
}
|
|
109
109
|
return buildDependencyGroup(rootDir, suite, state, "playwright_serial", suite.allTests());
|
|
110
110
|
}
|
|
111
|
-
/**
|
|
112
|
-
* Tests under this suite that Playwright would place in its sequential
|
|
113
|
-
* ("general") group: everything except subtrees that opt back into
|
|
114
|
-
* parallelism. Order is declaration order, which is the order the group
|
|
115
|
-
* executes in.
|
|
116
|
-
*/
|
|
117
111
|
function sequentialTests(suite) {
|
|
118
112
|
const tests = [...suite.tests];
|
|
119
113
|
for (const child of suite.suites) {
|
|
@@ -170,9 +164,6 @@ function walkSuite(rootDir, suite, state, testCases, dependencyGroups) {
|
|
|
170
164
|
}
|
|
171
165
|
}
|
|
172
166
|
}
|
|
173
|
-
// A serial group is emitted even inside a default scope: the outer default
|
|
174
|
-
// group wins for scheduling, but serial membership carries extra semantics
|
|
175
|
-
// (failure cascade, re-expansion) its consumers still need.
|
|
176
167
|
const serialGroup = collectOutermostSerialGroup(rootDir, suite, nextState);
|
|
177
168
|
if (serialGroup) {
|
|
178
169
|
dependencyGroups.push(serialGroup);
|
|
@@ -186,9 +177,6 @@ function walkSuite(rootDir, suite, state, testCases, dependencyGroups) {
|
|
|
186
177
|
dependencyGroups.push(defaultGroup);
|
|
187
178
|
nextState.sequentialAncestor = suite;
|
|
188
179
|
}
|
|
189
|
-
// fullyParallel (project suite) or an explicit `mode: "parallel"` — every
|
|
190
|
-
// descendant is independently schedulable unless a sequential suite below
|
|
191
|
-
// says otherwise.
|
|
192
180
|
if (mode === "parallel") {
|
|
193
181
|
nextState.insideParallel = true;
|
|
194
182
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uploader.d.ts","sourceRoot":"","sources":["../../src/reporter/uploader.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,kBAAkB,EAElB,kBAAkB,EAEnB,MAAM,2BAA2B,CAAC;AAKnC,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,kBAAkB,CAAC;CACjC;AAED,qBAAa,QAAQ;IACnB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,YAAY,CAAqB;IAEzC,YAAY,MAAM,EAAE,cAAc,EASjC;IAED,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAgBhC,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAUhC,MAAM,CAAC,qBAAqB,CAAC,QAAQ,EAAE,OAAO,GAAG,kBAAkB,GAAG,IAAI,CAKzE;IAED,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,IAAI,cAAc,IAAI,MAAM,CAE3B;IAED,IAAI,SAAS,IAAI,MAAM,CAEtB;IAEK,UAAU,CACd,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,MAAM,EACvB,YAAY,CAAC,EAAE,kBAAkB,GAChC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAgCxB;IAEK,eAAe,CACnB,SAAS,EAAE,MAAM,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BAAgB,WAAW,IAAI,QAAQ,GAAG,IAAI,CAM7C;AAED,wBAAgB,cAAc,IAAI,QAAQ,GAAG,IAAI,CA6DhD"}
|
|
@@ -107,9 +107,6 @@ class Uploader {
|
|
|
107
107
|
await (0, r2_uploader_1.waitForTaskQueueToFinish)();
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
|
-
// This drain runs after the last test with no other output (observed at
|
|
111
|
-
// 4+ minutes on spot runs), so make it visible: count up front, progress
|
|
112
|
-
// every 30s, duration at the end.
|
|
113
110
|
const start = Date.now();
|
|
114
111
|
console.log(`[Uploader] Waiting for ${pending} pending uploads (${executing} executing, ${waiting} queued)...`);
|
|
115
112
|
const progress = setInterval(() => {
|
|
@@ -143,7 +140,6 @@ function createUploader() {
|
|
|
143
140
|
logger_1.logger.debug("[Uploader] PROJECT_NAME and TEST_RUN_GITHUB_ACTION_ID must be set");
|
|
144
141
|
return null;
|
|
145
142
|
}
|
|
146
|
-
// REPORT_STORAGE_BACKEND selects the upload target; anything else is a misconfig.
|
|
147
143
|
const backend = process.env.REPORT_STORAGE_BACKEND;
|
|
148
144
|
if (backend !== "s3" && backend !== "r2") {
|
|
149
145
|
logger_1.logger.debug(`[Uploader] REPORT_STORAGE_BACKEND must be "s3" or "r2" (got ${backend ?? "unset"})`);
|
|
@@ -165,8 +161,6 @@ function createUploader() {
|
|
|
165
161
|
logger_1.logger.debug("[Uploader] S3_REGION or S3_UPLOAD_BUCKET not configured");
|
|
166
162
|
return null;
|
|
167
163
|
}
|
|
168
|
-
// Upload through the task role to S3, but persist CDN URLs so the bucket
|
|
169
|
-
// can stay private. Direct S3 is the fallback for envs without a CDN.
|
|
170
164
|
baseUrl =
|
|
171
165
|
process.env.REPORTS_BASE_URL?.replace(/\/+$/, "") ||
|
|
172
166
|
`https://${bucket}.s3.${region}.amazonaws.com`;
|
package/dist/reporter/util.d.ts
CHANGED
|
@@ -20,40 +20,7 @@ export declare function suitesAndProjectForTest(test: TestCase): {
|
|
|
20
20
|
export declare function sendTestCaseUpdateToDashboard(params: TestCaseRunEndEventV2): Promise<void>;
|
|
21
21
|
export declare function safelySerialiseJSON(obj: any, keyFilter?: (key: string) => boolean): any;
|
|
22
22
|
export declare function updateHtmlZipFileAttachmentPaths(jsonFilePath: string, htmlFilePath: string, repoPath: string): Promise<void>;
|
|
23
|
-
/**
|
|
24
|
-
* Replaces media paths in test results with normalized paths from the test attachment map.
|
|
25
|
-
* This function updates the attachments array in each test result with the corresponding
|
|
26
|
-
* normalized attachments from the test attachment map.
|
|
27
|
-
*
|
|
28
|
-
* @param jsonData - The JSON data containing test results, which can be either in the format
|
|
29
|
-
* of { files: [{ tests: [...] }] } or { tests: [...] }
|
|
30
|
-
* @param testAttachmentMap - A Map where the key is the test ID and the value is an array of
|
|
31
|
-
* objects containing attachments with updated path for each test result
|
|
32
|
-
* @returns void
|
|
33
|
-
*/
|
|
34
|
-
/**
|
|
35
|
-
* Builds a map from test ID to an array of objects containing attachments for each result (retry).
|
|
36
|
-
* The attachments are normalized to use relative paths starting with 'data/'.
|
|
37
|
-
* @param summaryJsonFilePath Path to the summary JSON file
|
|
38
|
-
* @returns Map<string, { attachments: GenericPlaywrightAttachment[] }[]>
|
|
39
|
-
*/
|
|
40
23
|
export declare function buildTestAttachmentMapFromSummary(summaryJsonFilePath: string, repoPath: string, doNotNormalize?: boolean): TestAttachmentMap;
|
|
41
|
-
/**
|
|
42
|
-
* Checks asynchronously if a file exists at the given path.
|
|
43
|
-
* @param filePath - The path to the file to check
|
|
44
|
-
* @returns Promise<boolean> - true if the file exists, false otherwise
|
|
45
|
-
*/
|
|
46
24
|
export declare function checkFileExistsAsync(filePath: string): Promise<boolean>;
|
|
47
|
-
/**
|
|
48
|
-
* Updates the attachment paths in the summary JSON file to use remote URLs.
|
|
49
|
-
*
|
|
50
|
-
* This function rewrites all attachment `path` fields in the given Playwright summary JSON file
|
|
51
|
-
* so that they point to remote URLs based on the current `PROJECT_NAME` and `TEST_RUN_GITHUB_ACTION_ID`
|
|
52
|
-
* environment variables.
|
|
53
|
-
*
|
|
54
|
-
* @param filePath - The path to the summary JSON file
|
|
55
|
-
* @returns The updated summary JSON
|
|
56
|
-
*
|
|
57
|
-
*/
|
|
58
25
|
export declare function updateSummaryJsonAttachmentPaths(filePath: string, repoPath: string, urlPrefix: string): Promise<PlaywrightJSONReport | undefined>;
|
|
59
26
|
//# sourceMappingURL=util.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/reporter/util.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAQhE,OAAO,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AACpF,OAAO,EACL,UAAU,IAAI,oBAAoB,EAElC,QAAQ,EACT,MAAM,2BAA2B,CAAC;AA0BnC,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAqB7D;AAED,wBAAgB,yBAAyB,CACvC,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,GAAG,SAAS,UAQhC;AAED,wBAAsB,0BAA0B,CAC9C,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAO,GAC5E,OAAO,CAAC;IACT,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC,CA6CD;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,QAAQ;
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","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CAC/C,mBAAmB,EAAE,MAAM,EAC3B,QAAQ,EAAE,MAAM,EAChB,cAAc,GAAE,OAAe,GAC9B,iBAAiB,CAgBnB;AAED,wBAAsB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAO7E;AAED,wBAAsB,gCAAgC,CACpD,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,6CA+BlB"}
|
package/dist/reporter/util.js
CHANGED
|
@@ -108,8 +108,6 @@ function suitesAndProjectForTest(test) {
|
|
|
108
108
|
parent = parent.parent;
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
-
// rawSuites looks like [ 'describe 3', 'describe 1', 'home.spec.ts', 'chromium', '' ]
|
|
112
|
-
// For suites, we will extract suites and then reverse them, since we expect top-to-bottom ordering for suites
|
|
113
111
|
let suites = [];
|
|
114
112
|
let iteratorIdx = 0;
|
|
115
113
|
for (; iteratorIdx < rawSuites.length; iteratorIdx++) {
|
|
@@ -210,27 +208,8 @@ async function updateHtmlZipFileAttachmentPaths(jsonFilePath, htmlFilePath, repo
|
|
|
210
208
|
logger_1.logger.error("❌ Error processing report.json or updating files:", err);
|
|
211
209
|
}
|
|
212
210
|
finally {
|
|
213
|
-
// Optional cleanup:
|
|
214
|
-
// await fs.promises.rm(tempDir, { recursive: true, force: true });
|
|
215
211
|
}
|
|
216
212
|
}
|
|
217
|
-
/**
|
|
218
|
-
* Replaces media paths in test results with normalized paths from the test attachment map.
|
|
219
|
-
* This function updates the attachments array in each test result with the corresponding
|
|
220
|
-
* normalized attachments from the test attachment map.
|
|
221
|
-
*
|
|
222
|
-
* @param jsonData - The JSON data containing test results, which can be either in the format
|
|
223
|
-
* of { files: [{ tests: [...] }] } or { tests: [...] }
|
|
224
|
-
* @param testAttachmentMap - A Map where the key is the test ID and the value is an array of
|
|
225
|
-
* objects containing attachments with updated path for each test result
|
|
226
|
-
* @returns void
|
|
227
|
-
*/
|
|
228
|
-
/**
|
|
229
|
-
* Builds a map from test ID to an array of objects containing attachments for each result (retry).
|
|
230
|
-
* The attachments are normalized to use relative paths starting with 'data/'.
|
|
231
|
-
* @param summaryJsonFilePath Path to the summary JSON file
|
|
232
|
-
* @returns Map<string, { attachments: GenericPlaywrightAttachment[] }[]>
|
|
233
|
-
*/
|
|
234
213
|
function buildTestAttachmentMapFromSummary(summaryJsonFilePath, repoPath, doNotNormalize = false) {
|
|
235
214
|
const summaryJson = JSON.parse(fs_1.default.readFileSync(summaryJsonFilePath, "utf8"));
|
|
236
215
|
return (0, reporter_1.buildTestAttachmentMap)(summaryJson, {
|
|
@@ -245,11 +224,6 @@ function buildTestAttachmentMapFromSummary(summaryJsonFilePath, repoPath, doNotN
|
|
|
245
224
|
},
|
|
246
225
|
});
|
|
247
226
|
}
|
|
248
|
-
/**
|
|
249
|
-
* Checks asynchronously if a file exists at the given path.
|
|
250
|
-
* @param filePath - The path to the file to check
|
|
251
|
-
* @returns Promise<boolean> - true if the file exists, false otherwise
|
|
252
|
-
*/
|
|
253
227
|
async function checkFileExistsAsync(filePath) {
|
|
254
228
|
try {
|
|
255
229
|
await fs_1.default.promises.access(filePath);
|
|
@@ -259,17 +233,6 @@ async function checkFileExistsAsync(filePath) {
|
|
|
259
233
|
return false;
|
|
260
234
|
}
|
|
261
235
|
}
|
|
262
|
-
/**
|
|
263
|
-
* Updates the attachment paths in the summary JSON file to use remote URLs.
|
|
264
|
-
*
|
|
265
|
-
* This function rewrites all attachment `path` fields in the given Playwright summary JSON file
|
|
266
|
-
* so that they point to remote URLs based on the current `PROJECT_NAME` and `TEST_RUN_GITHUB_ACTION_ID`
|
|
267
|
-
* environment variables.
|
|
268
|
-
*
|
|
269
|
-
* @param filePath - The path to the summary JSON file
|
|
270
|
-
* @returns The updated summary JSON
|
|
271
|
-
*
|
|
272
|
-
*/
|
|
273
236
|
async function updateSummaryJsonAttachmentPaths(filePath, repoPath, urlPrefix) {
|
|
274
237
|
if (!process.env.PROJECT_NAME || !process.env.TEST_RUN_GITHUB_ACTION_ID) {
|
|
275
238
|
console.error("PROJECT_NAME and TEST_RUN_GITHUB_ACTION_ID must be set");
|
package/dist/telemetry.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../src/telemetry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../src/telemetry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAOtE,wBAAsB,UAAU,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAmBrE;AAED,UAAU,uBAAuB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,IAAI,CAAC,CAcf;AAED,wBAAsB,qBAAqB,CAAC,IAAI,EAAE;IAChD,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3C,IAAI,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAC1C,GAAG,OAAO,CAAC,IAAI,CAAC,CAsBhB;AAED,wBAAsB,yBAAyB,CAAC,IAAI,EAAE;IACpD,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;CAC3B,GAAG,OAAO,CAAC,IAAI,CAAC,CAkBhB"}
|
package/dist/telemetry.js
CHANGED
|
@@ -5,9 +5,6 @@ exports.trackReportUpload = trackReportUpload;
|
|
|
5
5
|
exports.trackOverlayDismissed = trackOverlayDismissed;
|
|
6
6
|
exports.trackLLMResponseGenerated = trackLLMResponseGenerated;
|
|
7
7
|
const api_worker_client_1 = require("./api-worker-client");
|
|
8
|
-
// Events go to api-worker on the project API key the run already carries, so
|
|
9
|
-
// a runner needs no telemetry secret. Best-effort: no key means no telemetry,
|
|
10
|
-
// and a failed send is never retried or surfaced to the test.
|
|
11
8
|
async function trackEvent(event) {
|
|
12
9
|
if (!process.env.EMPIRICALRUN_API_KEY) {
|
|
13
10
|
return;
|
|
@@ -16,14 +13,10 @@ async function trackEvent(event) {
|
|
|
16
13
|
const { client } = new api_worker_client_1.ApiWorkerClient();
|
|
17
14
|
const { response } = await client.POST("/api/v1/telemetry/track", {
|
|
18
15
|
body: {
|
|
19
|
-
// api-worker accepts only test-run events; the ones sent from here
|
|
20
|
-
// are all on its allowlist.
|
|
21
16
|
name: event.name,
|
|
22
17
|
properties: event.properties,
|
|
23
18
|
timestamp: event.timestamp?.toISOString(),
|
|
24
19
|
},
|
|
25
|
-
// Plain fetch, not the client's retrying one: a test should not wait
|
|
26
|
-
// out backoff for a metric.
|
|
27
20
|
fetch,
|
|
28
21
|
signal: AbortSignal.timeout(10_000),
|
|
29
22
|
});
|
|
@@ -31,9 +24,7 @@ async function trackEvent(event) {
|
|
|
31
24
|
throw new Error(`Telemetry request failed: ${response.status}`);
|
|
32
25
|
}
|
|
33
26
|
}
|
|
34
|
-
catch {
|
|
35
|
-
// Don't throw - telemetry failures shouldn't break the application
|
|
36
|
-
}
|
|
27
|
+
catch { }
|
|
37
28
|
}
|
|
38
29
|
async function trackReportUpload(params) {
|
|
39
30
|
const environment = process.env.ENVIRONMENT || "unknown";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coverage.d.ts","sourceRoot":"","sources":["../../src/test/coverage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAYvD,wBAAsB,uBAAuB,CAAC,OAAO,EAAE,cAAc,qBAwBpE;AAED,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,cAAc,EACvB,aAAa,EAAE,MAAM,EAAE,EACvB,QAAQ,EAAE;IACR,MAAM,EAAE,CACN,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,KAC3C,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB,
|
|
1
|
+
{"version":3,"file":"coverage.d.ts","sourceRoot":"","sources":["../../src/test/coverage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAYvD,wBAAsB,uBAAuB,CAAC,OAAO,EAAE,cAAc,qBAwBpE;AAED,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,cAAc,EACvB,aAAa,EAAE,MAAM,EAAE,EACvB,QAAQ,EAAE;IACR,MAAM,EAAE,CACN,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,KAC3C,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB,iBAmBF"}
|
package/dist/test/coverage.js
CHANGED
|
@@ -31,9 +31,7 @@ async function collectAndAttachCoverage(context, coverageFiles, testInfo) {
|
|
|
31
31
|
try {
|
|
32
32
|
await page.evaluate(() => window.collectIstanbulCoverage(JSON.stringify(window.__coverage__)));
|
|
33
33
|
}
|
|
34
|
-
catch {
|
|
35
|
-
// Page might be closed or coverage not available
|
|
36
|
-
}
|
|
34
|
+
catch { }
|
|
37
35
|
}
|
|
38
36
|
for (const filepath of coverageFiles) {
|
|
39
37
|
if (fs_1.default.existsSync(filepath)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visual.d.ts","sourceRoot":"","sources":["../../../src/test/expect/visual.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAY,MAAM,kBAAkB,CAAC;AAOhE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"visual.d.ts","sourceRoot":"","sources":["../../../src/test/expect/visual.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAY,MAAM,kBAAkB,CAAC;AAOhE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAgE7C,wBAAsB,WAAW,CAC/B,MAAM,EAAE,IAAI,GAAG,OAAO,EACtB,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC,aAAa,CAAC,CAsFxB"}
|
|
@@ -17,7 +17,6 @@ function getCallerLine() {
|
|
|
17
17
|
return "unknown";
|
|
18
18
|
}
|
|
19
19
|
const frames = stack.split("\n").slice(1);
|
|
20
|
-
// Find the test file frame (e.g. .spec.ts, .test.ts)
|
|
21
20
|
const testFrame = frames.find((f) => /\.(spec|test)\.[jt]sx?:/.test(f));
|
|
22
21
|
if (!testFrame) {
|
|
23
22
|
return "unknown";
|
|
@@ -27,7 +26,6 @@ function getCallerLine() {
|
|
|
27
26
|
}
|
|
28
27
|
function attachScreenshot(screenshot, pageDescription) {
|
|
29
28
|
try {
|
|
30
|
-
// test.info() is only available during a Playwright test run
|
|
31
29
|
const { test } = require("@playwright/test");
|
|
32
30
|
const testInfo = test.info();
|
|
33
31
|
const slug = pageDescription
|
|
@@ -38,8 +36,6 @@ function attachScreenshot(screenshot, pageDescription) {
|
|
|
38
36
|
.replace(/(^-|-$)/g, "");
|
|
39
37
|
const line = getCallerLine();
|
|
40
38
|
const attachmentName = `toLookRight-L${line}-${slug}`;
|
|
41
|
-
// Write to a temp file so the attachment has a path (required by empirical reporter).
|
|
42
|
-
// Playwright copies it into test-results/<test>/attachments/ on attach.
|
|
43
39
|
const tmpFile = path_1.default.join(os_1.default.tmpdir(), `${attachmentName}-${Date.now()}.png`);
|
|
44
40
|
fs_1.default.writeFileSync(tmpFile, screenshot);
|
|
45
41
|
testInfo.attach(attachmentName, {
|
|
@@ -47,9 +43,7 @@ function attachScreenshot(screenshot, pageDescription) {
|
|
|
47
43
|
contentType: "image/png",
|
|
48
44
|
});
|
|
49
45
|
}
|
|
50
|
-
catch {
|
|
51
|
-
// Not in a Playwright test context, skip attachment
|
|
52
|
-
}
|
|
46
|
+
catch { }
|
|
53
47
|
}
|
|
54
48
|
const SYSTEM_PROMPT = `
|
|
55
49
|
You are a software QA tester who specializes in visual testing. You look at a
|
|
@@ -79,8 +73,6 @@ async function toLookRight(target, pageDescription) {
|
|
|
79
73
|
attachScreenshot(screenshot, pageDescription);
|
|
80
74
|
const base64Image = screenshot.toString("base64");
|
|
81
75
|
const model = "gpt-4o";
|
|
82
|
-
// Same api-worker proxy the overlay-dismissal agent uses, so a test run needs
|
|
83
|
-
// no OpenAI key of its own; undefined falls back to the SDK's env defaults.
|
|
84
76
|
const openai = new openai_1.default({ maxRetries: 5, ...(0, api_worker_client_1.llmProxyOpenAIConfig)() });
|
|
85
77
|
const completion = await openai.chat.completions.create({
|
|
86
78
|
model,
|
package/dist/test/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/test/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,qBAAqB,EACrB,MAAM,EACN,IAAI,EACJ,kBA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,KAC5B,OAAO,CAAC;QAAE,OAAO,EAAE,cAAc,CAAC;QAAC,IAAI,EAAE,IAAI,CAAA;KAAE,CAAC,CAAC;IACtD,UAAU,EAAE,IAAI,CAAC;CAClB,CAAC;AAIF,QAAA,MAAM,eAAe,WACX,QAAQ,CACd,kBAAkB,GAAG,qBAAqB,EAC1C,oBAAoB,GAAG,uBAAuB,CAC/C,YACQ,mBAAmB,uHA6G7B,CAAC;AAEF,OAAO,EACL,eAAe,EACf,YAAY,EACZ,6BAA6B,EAC7B,aAAa,GACd,CAAC"}
|
package/dist/test/index.js
CHANGED
|
@@ -17,23 +17,13 @@ const extendExpect = function (expectInstance) {
|
|
|
17
17
|
return expectInstance;
|
|
18
18
|
};
|
|
19
19
|
exports.extendExpect = extendExpect;
|
|
20
|
-
// Track pages per test to save videos with labels
|
|
21
20
|
const testPages = new Map();
|
|
22
|
-
const
|
|
23
|
-
mousePointerHighlighter: true,
|
|
24
|
-
locatorHighlighter: true,
|
|
25
|
-
visionMethods: true,
|
|
26
|
-
agentCapabilities: true,
|
|
27
|
-
};
|
|
28
|
-
const baseTestFixture = function (testFn, options = defaultOptions) {
|
|
21
|
+
const baseTestFixture = function (testFn, options = {}) {
|
|
29
22
|
const coverageEnabled = options.collectCoverage ?? false;
|
|
30
|
-
// Playwright draws the cursor, target box and action title into the video.
|
|
31
|
-
// 100ms per action keeps them visible without the default 500ms slowdown.
|
|
32
|
-
const showActions = options.mousePointerHighlighter === false ? undefined : { duration: 100 };
|
|
33
23
|
const recordVideoOptions = (dir) => ({
|
|
34
24
|
dir,
|
|
35
25
|
size: { width: 1280, height: 720 },
|
|
36
|
-
showActions,
|
|
26
|
+
showActions: { duration: 100 },
|
|
37
27
|
});
|
|
38
28
|
const extendedTestFn = testFn.extend({
|
|
39
29
|
context: async ({ browser }, use, testInfo) => {
|
|
@@ -57,10 +47,7 @@ const baseTestFixture = function (testFn, options = defaultOptions) {
|
|
|
57
47
|
await context.close();
|
|
58
48
|
},
|
|
59
49
|
page: async ({ page }, use) => {
|
|
60
|
-
(0, scripts_1.injectLocatorHighlightScripts)(page, extendedTestFn,
|
|
61
|
-
...defaultOptions,
|
|
62
|
-
...options,
|
|
63
|
-
});
|
|
50
|
+
(0, scripts_1.injectLocatorHighlightScripts)(page, extendedTestFn, options);
|
|
64
51
|
await use(page);
|
|
65
52
|
},
|
|
66
53
|
kv: async ({}, use) => {
|
|
@@ -82,7 +69,6 @@ const baseTestFixture = function (testFn, options = defaultOptions) {
|
|
|
82
69
|
return { context: pageContext, page: customPage };
|
|
83
70
|
}
|
|
84
71
|
await use(createContext);
|
|
85
|
-
// Store pages for video renaming
|
|
86
72
|
if (!testPages.has(testInfo.testId)) {
|
|
87
73
|
testPages.set(testInfo.testId, []);
|
|
88
74
|
}
|
|
@@ -98,7 +84,6 @@ const baseTestFixture = function (testFn, options = defaultOptions) {
|
|
|
98
84
|
await use();
|
|
99
85
|
const pages = testPages.get(testInfo.testId) || [];
|
|
100
86
|
const usedLabels = new Set();
|
|
101
|
-
// Save videos with custom labels using saveAs
|
|
102
87
|
for (let i = 0; i < pages.length; i++) {
|
|
103
88
|
const page = pages[i];
|
|
104
89
|
if (!page) {
|
|
@@ -121,9 +106,7 @@ const baseTestFixture = function (testFn, options = defaultOptions) {
|
|
|
121
106
|
});
|
|
122
107
|
await video.delete();
|
|
123
108
|
}
|
|
124
|
-
catch (e) {
|
|
125
|
-
// Skip if video not available
|
|
126
|
-
}
|
|
109
|
+
catch (e) { }
|
|
127
110
|
}
|
|
128
111
|
testPages.delete(testInfo.testId);
|
|
129
112
|
},
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addAgentCapabilities = addAgentCapabilities;
|
|
4
|
-
const click_1 = require("./pw-locator-patch/
|
|
5
|
-
const hover_1 = require("./pw-locator-patch/
|
|
4
|
+
const click_1 = require("./pw-locator-patch/actions/click");
|
|
5
|
+
const hover_1 = require("./pw-locator-patch/actions/hover");
|
|
6
6
|
function applyPatchForAutoDismissOverlay(page, testFn) {
|
|
7
7
|
const LocatorClass = page.locator("").constructor;
|
|
8
8
|
(0, click_1.patchClick)(LocatorClass, testFn);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Page } from "@playwright/test";
|
|
2
|
-
import {
|
|
2
|
+
import { PageScriptOpts } from "../types";
|
|
3
3
|
import { TestFn } from "./types";
|
|
4
|
-
export declare function injectLocatorHighlightScripts(page: Page, testFn: TestFn,
|
|
4
|
+
export declare function injectLocatorHighlightScripts(page: Page, testFn: TestFn, { visionMethods, agentCapabilities }?: PageScriptOpts): void;
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|