@empiricalrun/playwright-utils 0.60.1 → 0.60.2
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 +6 -0
- package/dist/api-worker-client.d.ts +2 -0
- package/dist/api-worker-client.d.ts.map +1 -1
- package/dist/api-worker-client.js +4 -0
- package/dist/generated/api-worker-openapi.d.ts +1033 -1493
- package/dist/generated/api-worker-openapi.d.ts.map +1 -1
- package/dist/reporter/util.d.ts.map +1 -1
- package/dist/reporter/util.js +9 -24
- package/dist/test/scripts/pw-locator-patch/dismiss-overlays/index.js +1 -1
- package/package.json +2 -2
|
@@ -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,CA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A2Bf;AAED,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,GAAG,EACR,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,GACnC,GAAG,CAIL;AAED,wBAAsB,gCAAgC,CACpD,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,iBAoFjB;AAED;;;;;;;;;;GAUG;AACH;;;;;GAKG;AACH,wBAAgB,iCAAiC,CAC/C,mBAAmB,EAAE,MAAM,EAC3B,QAAQ,EAAE,MAAM,EAChB,cAAc,GAAE,OAAe,GAC9B,iBAAiB,CAgBnB;AAED;;;;GAIG;AACH,wBAAsB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAO7E;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,gCAAgC,CACpD,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,6CA+BlB"}
|
package/dist/reporter/util.js
CHANGED
|
@@ -15,11 +15,11 @@ exports.checkFileExistsAsync = checkFileExistsAsync;
|
|
|
15
15
|
exports.updateSummaryJsonAttachmentPaths = updateSummaryJsonAttachmentPaths;
|
|
16
16
|
const zip_1 = require("@empiricalrun/r2-uploader/zip");
|
|
17
17
|
const reporter_1 = require("@empiricalrun/reporter");
|
|
18
|
-
const async_retry_1 = __importDefault(require("async-retry"));
|
|
19
18
|
const crypto_1 = __importDefault(require("crypto"));
|
|
20
19
|
const fs_1 = __importDefault(require("fs"));
|
|
21
20
|
const mime_1 = __importDefault(require("mime"));
|
|
22
21
|
const path_1 = __importDefault(require("path"));
|
|
22
|
+
const api_worker_client_1 = require("../api-worker-client");
|
|
23
23
|
const logger_1 = require("../logger");
|
|
24
24
|
// Mirrors https://github.com/microsoft/playwright/blob/main/packages/playwright-core/src/tools/cli-client/program.ts#L440
|
|
25
25
|
function calculateSha1(buffer) {
|
|
@@ -125,40 +125,25 @@ function suitesAndProjectForTest(test) {
|
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
127
|
async function sendTestCaseUpdateToDashboard(params) {
|
|
128
|
-
const DOMAIN = process.env.DASHBOARD_DOMAIN || "https://api.empirical.run";
|
|
129
128
|
try {
|
|
130
129
|
const requestBody = {
|
|
131
130
|
name: "test_case_run_end",
|
|
132
131
|
data: {
|
|
133
132
|
...params,
|
|
133
|
+
result: {
|
|
134
|
+
...params.result,
|
|
135
|
+
startTime: params.result.startTime instanceof Date
|
|
136
|
+
? params.result.startTime.toISOString()
|
|
137
|
+
: params.result.startTime,
|
|
138
|
+
},
|
|
134
139
|
},
|
|
135
140
|
};
|
|
136
|
-
if (!DOMAIN) {
|
|
137
|
-
console.warn("No dashboard domain found. Skipping send message to dashboard.");
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
141
|
if (!process.env.EMPIRICALRUN_API_KEY) {
|
|
141
142
|
console.log("No API token found. Skipping send message to dashboard.");
|
|
142
143
|
return;
|
|
143
144
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
method: "PUT",
|
|
147
|
-
headers: {
|
|
148
|
-
"Content-Type": "application/json",
|
|
149
|
-
Authorization: `Bearer ${process.env.EMPIRICALRUN_API_KEY}`,
|
|
150
|
-
},
|
|
151
|
-
body: JSON.stringify(requestBody),
|
|
152
|
-
});
|
|
153
|
-
if (!response.ok) {
|
|
154
|
-
throw new Error(`Failed to publish test case diagnois: ${response.status}`);
|
|
155
|
-
}
|
|
156
|
-
}, {
|
|
157
|
-
retries: 3,
|
|
158
|
-
minTimeout: 1000,
|
|
159
|
-
maxTimeout: 60_000,
|
|
160
|
-
factor: 3,
|
|
161
|
-
});
|
|
145
|
+
const client = new api_worker_client_1.ApiWorkerClient();
|
|
146
|
+
await client.putTestCaseRunEndEvent(requestBody);
|
|
162
147
|
logger_1.logger.debug("Successfully sent test case update to dashboard");
|
|
163
148
|
}
|
|
164
149
|
catch (e) {
|
|
@@ -94,7 +94,7 @@ class OverlayDismissAgent {
|
|
|
94
94
|
// and we need app to be able to use page.pause for agent actions.
|
|
95
95
|
// Currently, page.pause does not cleanup properly, causing it to work
|
|
96
96
|
// only once in a particular test run.
|
|
97
|
-
// Ran into this here: https://
|
|
97
|
+
// Ran into this here: https://empirical.run/quizizz-tests/sessions/2825
|
|
98
98
|
prefersElementFromPointCodegen: true,
|
|
99
99
|
// Overlay dismissal doesn't need page navigation — the overlay is
|
|
100
100
|
// already on the current page. Including page_goto causes the model
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empiricalrun/playwright-utils",
|
|
3
|
-
"version": "0.60.
|
|
3
|
+
"version": "0.60.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"openapi-typescript": "7.6.1",
|
|
43
43
|
"playwright-core": "1.62.1",
|
|
44
44
|
"serve-handler": "^6.1.6",
|
|
45
|
-
"@empiricalrun/shared-types": "0.
|
|
45
|
+
"@empiricalrun/shared-types": "0.19.0"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@babel/code-frame": "^7.24.7",
|