@piwitests/reporter 0.61.0 → 0.63.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/cli/index.js +380 -233
- package/dist/global-setup-module.js +27 -12
- package/dist/index.d.ts +9 -0
- package/dist/index.js +11871 -7869
- package/dist/internal/capture/attachments.d.ts +24 -1
- package/dist/internal/capture/attachments.js +21 -2
- package/dist/internal/capture/capture-fixtures.d.ts +126 -6
- package/dist/internal/capture/capture-fixtures.js +4130 -478
- package/dist/internal/capture/locator-healing.d.ts +11 -1
- package/dist/internal/capture/locator-healing.js +22 -10
- package/dist/internal/capture/pick-on-failure.js +29 -5
- package/package.json +1 -1
- package/templates/skills/apply-locator-healing/SKILL.md +2 -2
- package/templates/skills/fix-a-reported-bug/SKILL.md +11 -8
- package/templates/skills/investigate-failure/SKILL.md +3 -3
- package/templates/skills/setup-piwi/SKILL.md +11 -8
- package/templates/skills/stabilize-flaky-tests/SKILL.md +3 -3
- package/templates/skills/write-the-missing-test/SKILL.md +13 -10
|
@@ -43,9 +43,6 @@ function errorMessage(error) {
|
|
|
43
43
|
return String(error);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
// src/public/global-setup.ts
|
|
47
|
-
var fs7 = __toESM(require("fs"));
|
|
48
|
-
|
|
49
46
|
// src/internal/config/env.ts
|
|
50
47
|
var path2 = __toESM(require("path"));
|
|
51
48
|
|
|
@@ -693,6 +690,16 @@ function normalizeRef(ref) {
|
|
|
693
690
|
return ref.replace(/^refs\/heads\//, "");
|
|
694
691
|
}
|
|
695
692
|
|
|
693
|
+
// ../core/src/live-view.ts
|
|
694
|
+
var LIVE_FRAME_BYTE_RATE = 256 * 1024;
|
|
695
|
+
var MAX_LIVE_FRAME = 192 * 1024;
|
|
696
|
+
var MAX_LIVE_FRAME_BASE64 = 4 * Math.ceil(MAX_LIVE_FRAME / 3);
|
|
697
|
+
var MAX_LIVE_MESSAGE = MAX_LIVE_FRAME_BASE64 + 8 * 1024;
|
|
698
|
+
var KEY = /^pdl_[A-Za-z0-9_-]{43}$/;
|
|
699
|
+
function isLiveViewKey(value) {
|
|
700
|
+
return typeof value === "string" && KEY.test(value);
|
|
701
|
+
}
|
|
702
|
+
|
|
696
703
|
// src/internal/support/setup-file.ts
|
|
697
704
|
var path4 = __toESM(require("path"));
|
|
698
705
|
var os3 = __toESM(require("os"));
|
|
@@ -700,6 +707,10 @@ var fs3 = __toESM(require("fs"));
|
|
|
700
707
|
function getSetupFilePath(projectName) {
|
|
701
708
|
return path4.join(os3.tmpdir(), `piwi-dashboard-setup-${hashForProject(projectName)}.json`);
|
|
702
709
|
}
|
|
710
|
+
function writeSetupInfo(info) {
|
|
711
|
+
const setupFile = getSetupFilePath(info.projectName);
|
|
712
|
+
fs3.writeFileSync(setupFile, JSON.stringify(info), { mode: 384 });
|
|
713
|
+
}
|
|
703
714
|
|
|
704
715
|
// src/internal/support/aria-sampling.ts
|
|
705
716
|
var path5 = __toESM(require("path"));
|
|
@@ -1101,19 +1112,23 @@ function createGlobalSetup(options, userSetup) {
|
|
|
1101
1112
|
startTime: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1102
1113
|
instanceId: computeInstanceId(opts.projectName, resolveRunLabel(opts.runLabel, shard !== null)),
|
|
1103
1114
|
shardIndex: shard?.current,
|
|
1104
|
-
shardTotal: shard?.total
|
|
1115
|
+
shardTotal: shard?.total,
|
|
1116
|
+
// A key for the run's live view: the instance hands one out only for a project that turned it on, and the
|
|
1117
|
+
// desktop app none. A CI run's workers stream with it at once; a run outside CI sends nothing with it until a
|
|
1118
|
+
// person shares the run.
|
|
1119
|
+
liveView: true
|
|
1105
1120
|
},
|
|
1106
1121
|
auth
|
|
1107
1122
|
);
|
|
1108
1123
|
if (response?.runId && response?.setupToken) {
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
}
|
|
1116
|
-
);
|
|
1124
|
+
const liveViewKey = response.liveView?.key;
|
|
1125
|
+
writeSetupInfo({
|
|
1126
|
+
runId: response.runId,
|
|
1127
|
+
setupToken: response.setupToken,
|
|
1128
|
+
projectName: opts.projectName,
|
|
1129
|
+
...isLiveViewKey(liveViewKey) ? { liveViewKey } : {},
|
|
1130
|
+
...response.liveView?.refused === "local" ? { liveViewLocal: true } : {}
|
|
1131
|
+
});
|
|
1117
1132
|
logger.debug(`Global setup: initializing run #${response.runId}`);
|
|
1118
1133
|
}
|
|
1119
1134
|
if (opts.projectName) clearAriaSampleFile(opts.projectName);
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { PiwiFixtures, PiwiWorkerFixtures, extendPiwiFixtures, piwiFixtures } fr
|
|
|
5
5
|
import '@piwitests/picker-dom';
|
|
6
6
|
import '@piwitests/core/page-interaction';
|
|
7
7
|
import '@piwitests/core/wire';
|
|
8
|
+
import '@piwitests/core/run-channel';
|
|
8
9
|
import '@piwitests/core/code-reach';
|
|
9
10
|
|
|
10
11
|
/**
|
|
@@ -578,6 +579,14 @@ declare class PiwiDashboardReporter {
|
|
|
578
579
|
printsToStdio(): boolean;
|
|
579
580
|
/** Playwright reporter hook: called once at the start of the test run */
|
|
580
581
|
onBegin(config: FullConfig, suite: Suite): void;
|
|
582
|
+
/**
|
|
583
|
+
* Name the run's live view on the instance for the workers, which Playwright starts after this hook with this
|
|
584
|
+
* environment: the key the instance gave the global setup, for a project that turned its live view on, for this run
|
|
585
|
+
* alone. A CI run's workers stream with it at once; a run outside CI's hold it until a person shares the run (Share
|
|
586
|
+
* live), and such a run without a key names why instead, for the surfaces that would share it. Read before the
|
|
587
|
+
* stream starts, which takes the setup file.
|
|
588
|
+
*/
|
|
589
|
+
private shareLiveView;
|
|
581
590
|
/**
|
|
582
591
|
* Settle each planned test's external ID before any test runs, name the IDs two tests share, and record them on
|
|
583
592
|
* the run so the dashboard lists them too.
|