@empiricalrun/playwright-utils 0.14.12 → 0.14.14
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 +14 -0
- package/dist/logger.d.ts +3 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +11 -0
- package/dist/reporter/custom.d.ts.map +1 -1
- package/dist/reporter/custom.js +31 -24
- package/dist/test/scripts/index.d.ts.map +1 -1
- package/dist/test/scripts/index.js +2 -1
- package/dist/test/scripts/mouse-pointer.d.ts.map +1 -1
- package/dist/test/scripts/mouse-pointer.js +2 -1
- package/dist/test/scripts/pw-locator-patch/highlight/expect.d.ts.map +1 -1
- package/dist/test/scripts/pw-locator-patch/highlight/expect.js +2 -1
- package/dist/test/scripts/pw-locator-patch/highlight/hover.d.ts.map +1 -1
- package/dist/test/scripts/pw-locator-patch/highlight/hover.js +2 -1
- package/dist/test/scripts/pw-locator-patch/highlight/inner-text.d.ts.map +1 -1
- package/dist/test/scripts/pw-locator-patch/highlight/inner-text.js +2 -1
- package/dist/test/scripts/pw-locator-patch/highlight/input-value.d.ts.map +1 -1
- package/dist/test/scripts/pw-locator-patch/highlight/input-value.js +2 -1
- package/dist/test/scripts/pw-locator-patch/highlight/is-checked.d.ts.map +1 -1
- package/dist/test/scripts/pw-locator-patch/highlight/is-checked.js +2 -1
- package/dist/test/scripts/pw-locator-patch/highlight/is-disabled.d.ts.map +1 -1
- package/dist/test/scripts/pw-locator-patch/highlight/is-disabled.js +2 -1
- package/dist/test/scripts/pw-locator-patch/highlight/is-editable.d.ts.map +1 -1
- package/dist/test/scripts/pw-locator-patch/highlight/is-editable.js +2 -1
- package/dist/test/scripts/pw-locator-patch/highlight/text-content.d.ts.map +1 -1
- package/dist/test/scripts/pw-locator-patch/highlight/text-content.js +2 -1
- package/package.json +6 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @empiricalrun/playwright-utils
|
|
2
2
|
|
|
3
|
+
## 0.14.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- a1e8599: chore: add logger for playwright utils
|
|
8
|
+
- Updated dependencies [a1e8599]
|
|
9
|
+
- @empiricalrun/r2-uploader@0.3.6
|
|
10
|
+
|
|
11
|
+
## 0.14.13
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- c9514f9: fix: add call to process queue
|
|
16
|
+
|
|
3
17
|
## 0.14.12
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/logger.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,MAAyB,MAAM,mBAAmB,CAAC;AAE1D,eAAO,MAAM,MAAM,eAGjB,CAAC"}
|
package/dist/logger.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.logger = void 0;
|
|
7
|
+
const console_log_level_1 = __importDefault(require("console-log-level"));
|
|
8
|
+
exports.logger = (0, console_log_level_1.default)({
|
|
9
|
+
prefix: "playwright-utils",
|
|
10
|
+
level: process.env.LOG_LEVEL || "info",
|
|
11
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom.d.ts","sourceRoot":"","sources":["../../src/reporter/custom.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EAEV,KAAK,EACL,QAAQ,IAAI,cAAc,EAC1B,SAAS,EACT,UAAU,IAAI,gBAAgB,EAE/B,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAML,UAAU,EAMX,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"custom.d.ts","sourceRoot":"","sources":["../../src/reporter/custom.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EAEV,KAAK,EACL,QAAQ,IAAI,cAAc,EAC1B,SAAS,EACT,UAAU,IAAI,gBAAgB,EAE/B,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAML,UAAU,EAMX,MAAM,2BAA2B,CAAC;AAiBnC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAiC/C,QAAA,MAAM,iBAAiB,UAAoC,CAAC;AAC5D,KAAK,oBAAoB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAM/D,KAAK,mBAAmB,GAAG;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,oBAAoB,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AA6BF,cAAM,YAAa,YAAW,UAAU;IACtC,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,QAAQ,CAAsB;IACtC,OAAO,CAAC,aAAa,CAAU;IAC/B,OAAO,CAAC,mBAAmB,CAAU;IACrC,OAAO,CAAC,KAAK,CAAqB;IAClC,OAAO,CAAC,KAAK,CAAqB;IAClC,OAAO,CAAC,KAAK,CAAqB;IAClC,OAAO,CAAC,oBAAoB,CAAiC;IAC7D,OAAO,CAAC,kBAAkB,CAAyC;IACnE,OAAO,CAAC,kBAAkB,CAEpB;IAEN,OAAO,CAAC,YAAY;YA4BN,uBAAuB;IAQrC,OAAO,CAAC,YAAY,CAEN;IACd,OAAO,CAAC,eAAe,CAAmB;gBAE9B,OAAO,EAAE,mBAAmB;IAIxC,aAAa;IAIb,QAAQ;IAER,QAAQ;IAER,WAAW;IAEX,SAAS;IAET,WAAW;IAEX,OAAO,IAAI,IAAI;IAIf,SAAS,CAAC,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,gBAAgB;IA0DxD,WAAW,CAAC,MAAM,EAAE,UAAU;IAI9B,OAAO,CAAC,KAAK,EAAE,KAAK;IAYpB,eAAe,IAAI;QACjB,YAAY,EAAE,MAAM,CAAC;QACrB,IAAI,EAAE,oBAAoB,CAAC;QAC3B,kBAAkB,EAAE,MAAM,CAAC;QAC3B,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;QACzB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;KAC1B;IAsBD,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO;IASxD,OAAO,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI;IAIzB,KAAK,CAAC,MAAM,EAAE,UAAU;IA0HxB,MAAM;CA8Bb;AAkCD,wBAAsB,cAAc,CAClC,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,IAAI,GAAE,MAAoB,EAC1B,IAAI,CAAC,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,MAAM,iBAqBhB;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAsBhE;AAqiBD,eAAe,YAAY,CAAC"}
|
package/dist/reporter/custom.js
CHANGED
|
@@ -31,6 +31,7 @@ const utilsBundle_1 = require("playwright-core/lib/utilsBundle");
|
|
|
31
31
|
// @ts-ignore
|
|
32
32
|
const zipBundle_1 = require("playwright-core/lib/zipBundle");
|
|
33
33
|
const stream_1 = require("stream");
|
|
34
|
+
const logger_1 = require("../logger");
|
|
34
35
|
const base_1 = require("./base");
|
|
35
36
|
const util_1 = require("./util");
|
|
36
37
|
const htmlReportOptions = ["always", "never", "on-failure"];
|
|
@@ -82,7 +83,7 @@ class HtmlReporter {
|
|
|
82
83
|
if (task) {
|
|
83
84
|
const promise = task()
|
|
84
85
|
.catch((e) => {
|
|
85
|
-
|
|
86
|
+
logger_1.logger.error("Error in processing task", e);
|
|
86
87
|
})
|
|
87
88
|
.finally(() => {
|
|
88
89
|
// console.log("Finished upload execution from waiting queue"); // we already log in the upload function on successful upload
|
|
@@ -95,7 +96,7 @@ class HtmlReporter {
|
|
|
95
96
|
}
|
|
96
97
|
}
|
|
97
98
|
catch (e) {
|
|
98
|
-
|
|
99
|
+
logger_1.logger.error("Error while processing queue", e);
|
|
99
100
|
}
|
|
100
101
|
}
|
|
101
102
|
async waitForAllTasksToFinish() {
|
|
@@ -147,7 +148,7 @@ class HtmlReporter {
|
|
|
147
148
|
if (this.uploadExecutionQueue.length <= this.uploadMaxQueueSize) {
|
|
148
149
|
const promise = uploadTask()
|
|
149
150
|
.catch((e) => {
|
|
150
|
-
|
|
151
|
+
logger_1.logger.error("Upload failed for", attachment.path, e);
|
|
151
152
|
// this.retryTask(uploadTask); // Retry logic
|
|
152
153
|
})
|
|
153
154
|
.finally(() => {
|
|
@@ -159,18 +160,18 @@ class HtmlReporter {
|
|
|
159
160
|
this.uploadExecutionQueue.push(promise);
|
|
160
161
|
}
|
|
161
162
|
else {
|
|
162
|
-
|
|
163
|
+
logger_1.logger.debug("Queuing upload task ", attachment.path);
|
|
163
164
|
this.uploadWaitingQueue.push(uploadTask);
|
|
164
165
|
}
|
|
165
166
|
}
|
|
166
167
|
catch (e) {
|
|
167
|
-
|
|
168
|
+
logger_1.logger.error("Error while uploading attachment", e);
|
|
168
169
|
// tests shouldn't stop no matter whatever error we get
|
|
169
170
|
}
|
|
170
171
|
});
|
|
171
172
|
}
|
|
172
173
|
catch (e) {
|
|
173
|
-
|
|
174
|
+
logger_1.logger.error("Error while processing attachments for test", e);
|
|
174
175
|
}
|
|
175
176
|
}
|
|
176
177
|
onConfigure(config) {
|
|
@@ -211,7 +212,7 @@ class HtmlReporter {
|
|
|
211
212
|
this._topLevelErrors.push(error);
|
|
212
213
|
}
|
|
213
214
|
async onEnd(result) {
|
|
214
|
-
console.
|
|
215
|
+
console.info(`Tests ended in ${(result.duration / (1000 * 60)).toFixed(2)} mins`);
|
|
215
216
|
const projectSuites = this.suite.suites;
|
|
216
217
|
// Commenting out this line causes the outputs to not get deleted
|
|
217
218
|
// await removeFolders([this._outputFolder]);
|
|
@@ -222,16 +223,16 @@ class HtmlReporter {
|
|
|
222
223
|
// Skipping uploads since PROJECT_NAME or TEST_RUN_GITHUB_ACTION_ID is not set,
|
|
223
224
|
return;
|
|
224
225
|
}
|
|
225
|
-
|
|
226
|
+
logger_1.logger.info("Starting final report upload at: ", new Intl.DateTimeFormat("en-US", {
|
|
226
227
|
hour: "2-digit",
|
|
227
228
|
minute: "2-digit",
|
|
228
229
|
second: "2-digit",
|
|
229
230
|
}).format(startTime));
|
|
230
231
|
try {
|
|
231
|
-
|
|
232
|
-
|
|
232
|
+
logger_1.logger.debug("uploading path", this._outputFolder);
|
|
233
|
+
logger_1.logger.debug(listFilesRecursively(this._outputFolder));
|
|
233
234
|
const uploadTraceTask = async () => {
|
|
234
|
-
|
|
235
|
+
logger_1.logger.debug("Uploading playwright trace");
|
|
235
236
|
return (0, r2_uploader_1.uploadDirectory)({
|
|
236
237
|
sourceDir: this._outputFolder + "/trace",
|
|
237
238
|
destinationDir: process.env.PROJECT_NAME +
|
|
@@ -241,13 +242,13 @@ class HtmlReporter {
|
|
|
241
242
|
uploadBucket: "test-report",
|
|
242
243
|
})
|
|
243
244
|
.then((fileMap) => {
|
|
244
|
-
|
|
245
|
+
logger_1.logger.debug("Finished uploading playwright trace", fileMap);
|
|
245
246
|
})
|
|
246
|
-
.catch((e) =>
|
|
247
|
+
.catch((e) => logger_1.logger.error("Error uploading playwright trace", e));
|
|
247
248
|
};
|
|
248
249
|
// upload index.html
|
|
249
250
|
const uploadIndexTask = async () => {
|
|
250
|
-
|
|
251
|
+
logger_1.logger.debug("Uploading html report");
|
|
251
252
|
return (0, r2_uploader_1.uploadDirectory)({
|
|
252
253
|
sourceDir: this._outputFolder,
|
|
253
254
|
fileList: [path_1.default.join(this._outputFolder, "index.html")],
|
|
@@ -257,13 +258,13 @@ class HtmlReporter {
|
|
|
257
258
|
uploadBucket: "test-report",
|
|
258
259
|
})
|
|
259
260
|
.then((fileMap) => {
|
|
260
|
-
|
|
261
|
+
logger_1.logger.debug("Finished uploading html report", fileMap);
|
|
261
262
|
})
|
|
262
|
-
.catch((e) =>
|
|
263
|
+
.catch((e) => logger_1.logger.error("Error uploading html report", e));
|
|
263
264
|
};
|
|
264
265
|
// upload summary.json
|
|
265
266
|
const uploadSummaryTask = async () => {
|
|
266
|
-
|
|
267
|
+
logger_1.logger.debug("Uploading json report");
|
|
267
268
|
return (0, r2_uploader_1.uploadDirectory)({
|
|
268
269
|
sourceDir: this._outputFolder,
|
|
269
270
|
fileList: [path_1.default.join(this._outputFolder, "summary.json")],
|
|
@@ -273,28 +274,34 @@ class HtmlReporter {
|
|
|
273
274
|
uploadBucket: "test-report",
|
|
274
275
|
})
|
|
275
276
|
.then((fileMap) => {
|
|
276
|
-
|
|
277
|
+
logger_1.logger.debug("Finished uploading json report", fileMap);
|
|
277
278
|
})
|
|
278
|
-
.catch((e) =>
|
|
279
|
+
.catch((e) => logger_1.logger.error("Error uploading json report", e));
|
|
279
280
|
};
|
|
281
|
+
logger_1.logger.debug("Uploading waiting queue", this.uploadWaitingQueue.length);
|
|
282
|
+
logger_1.logger.debug("Uploading execution queue", this.uploadExecutionQueue.length);
|
|
283
|
+
const processQueue = !this.uploadExecutionQueue.length;
|
|
280
284
|
this.uploadWaitingQueue.push(uploadTraceTask);
|
|
281
285
|
this.uploadWaitingQueue.push(uploadIndexTask);
|
|
282
286
|
this.uploadWaitingQueue.push(uploadSummaryTask);
|
|
283
|
-
|
|
287
|
+
if (processQueue) {
|
|
288
|
+
this.processQueue();
|
|
289
|
+
}
|
|
290
|
+
logger_1.logger.info("Waiting for all uploads to finish");
|
|
284
291
|
await this.waitForAllTasksToFinish();
|
|
285
|
-
|
|
292
|
+
logger_1.logger.info("All uploads finished");
|
|
286
293
|
const endTime = new Date().getTime();
|
|
287
|
-
|
|
294
|
+
logger_1.logger.info("Finished final report upload at: ", new Intl.DateTimeFormat("en-US", {
|
|
288
295
|
hour: "2-digit",
|
|
289
296
|
minute: "2-digit",
|
|
290
297
|
second: "2-digit",
|
|
291
298
|
}).format(endTime));
|
|
292
299
|
// time difference
|
|
293
300
|
const timeDiff = endTime - startTime;
|
|
294
|
-
|
|
301
|
+
logger_1.logger.info("Time taken to upload after tests ended: ", timeDiff, "ms");
|
|
295
302
|
}
|
|
296
303
|
catch (e) {
|
|
297
|
-
|
|
304
|
+
logger_1.logger.error("Error in uploading final report ", e);
|
|
298
305
|
}
|
|
299
306
|
}
|
|
300
307
|
async onExit() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/test/scripts/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/test/scripts/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAG7C,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAK3C,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,IAAI,EACV,OAAO,GAAE,eAIR,QAoBF"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.injectLocatorHighlightScripts = void 0;
|
|
4
|
+
const logger_1 = require("../../logger");
|
|
4
5
|
const locator_highlights_1 = require("./locator-highlights");
|
|
5
6
|
const locator_vision_1 = require("./locator-vision");
|
|
6
7
|
const mouse_pointer_1 = require("./mouse-pointer");
|
|
@@ -26,7 +27,7 @@ function injectLocatorHighlightScripts(page, options = {
|
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
catch (e) {
|
|
29
|
-
|
|
30
|
+
logger_1.logger.debug("Failed to add mouse pointer highlighter", e);
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
33
|
exports.injectLocatorHighlightScripts = injectLocatorHighlightScripts;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mouse-pointer.d.ts","sourceRoot":"","sources":["../../../src/test/scripts/mouse-pointer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"mouse-pointer.d.ts","sourceRoot":"","sources":["../../../src/test/scripts/mouse-pointer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAI7C,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,IAAI,QAoGpD"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addMousePointerHighlighter = void 0;
|
|
4
|
+
const logger_1 = require("../../logger");
|
|
4
5
|
function addMousePointerHighlighter(page) {
|
|
5
6
|
page.on("load", async () => {
|
|
6
7
|
try {
|
|
@@ -78,7 +79,7 @@ function addMousePointerHighlighter(page) {
|
|
|
78
79
|
});
|
|
79
80
|
}
|
|
80
81
|
catch (e) {
|
|
81
|
-
|
|
82
|
+
logger_1.logger.debug(`Error adding mouse pointer highlighter`, e);
|
|
82
83
|
}
|
|
83
84
|
});
|
|
84
85
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expect.d.ts","sourceRoot":"","sources":["../../../../../src/test/scripts/pw-locator-patch/highlight/expect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"expect.d.ts","sourceRoot":"","sources":["../../../../../src/test/scripts/pw-locator-patch/highlight/expect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAKhD,wBAAgB,WAAW,CAAC,YAAY,EAAE;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,QAmC/D"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.patchExpect = void 0;
|
|
4
|
+
const logger_1 = require("../../../../logger");
|
|
4
5
|
const constants_1 = require("../../../constants");
|
|
5
6
|
function patchExpect(LocatorClass) {
|
|
6
7
|
//@ts-ignore _expect returnsPromise<{ matches: boolean, received?: any, log?: string[], timedOut?: boolean }>
|
|
@@ -27,7 +28,7 @@ function patchExpect(LocatorClass) {
|
|
|
27
28
|
}, undefined, { timeout: constants_1.DEFAULT_SCRIPT_EXECUTION_TIMEOUT });
|
|
28
29
|
}
|
|
29
30
|
catch (e) {
|
|
30
|
-
|
|
31
|
+
logger_1.logger.debug("Failed to add highlight for locator method: _expect");
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
34
|
return result;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hover.d.ts","sourceRoot":"","sources":["../../../../../src/test/scripts/pw-locator-patch/highlight/hover.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"hover.d.ts","sourceRoot":"","sources":["../../../../../src/test/scripts/pw-locator-patch/highlight/hover.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAK3C,wBAAgB,UAAU,CAAC,YAAY,EAAE;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,QA2B9D"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.patchHover = void 0;
|
|
4
|
+
const logger_1 = require("../../../../logger");
|
|
4
5
|
const constants_1 = require("../../../constants");
|
|
5
6
|
function patchHover(LocatorClass) {
|
|
6
7
|
const originalHover = LocatorClass.prototype.hover;
|
|
@@ -24,7 +25,7 @@ function patchHover(LocatorClass) {
|
|
|
24
25
|
}, undefined, { timeout: constants_1.DEFAULT_SCRIPT_EXECUTION_TIMEOUT });
|
|
25
26
|
}
|
|
26
27
|
catch (e) {
|
|
27
|
-
|
|
28
|
+
logger_1.logger.debug("Failed to add highlight for locator method: hover");
|
|
28
29
|
}
|
|
29
30
|
};
|
|
30
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inner-text.d.ts","sourceRoot":"","sources":["../../../../../src/test/scripts/pw-locator-patch/highlight/inner-text.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"inner-text.d.ts","sourceRoot":"","sources":["../../../../../src/test/scripts/pw-locator-patch/highlight/inner-text.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAKhD,wBAAgB,cAAc,CAAC,YAAY,EAAE;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,QA4BlE"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.patchInnerText = void 0;
|
|
4
|
+
const logger_1 = require("../../../../logger");
|
|
4
5
|
const constants_1 = require("../../../constants");
|
|
5
6
|
function patchInnerText(LocatorClass) {
|
|
6
7
|
const originalInputValue = LocatorClass.prototype.innerText;
|
|
@@ -24,7 +25,7 @@ function patchInnerText(LocatorClass) {
|
|
|
24
25
|
}, undefined, { timeout: constants_1.DEFAULT_SCRIPT_EXECUTION_TIMEOUT });
|
|
25
26
|
}
|
|
26
27
|
catch (e) {
|
|
27
|
-
|
|
28
|
+
logger_1.logger.debug("Failed to add highlight for locator method: innerText");
|
|
28
29
|
}
|
|
29
30
|
return result;
|
|
30
31
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-value.d.ts","sourceRoot":"","sources":["../../../../../src/test/scripts/pw-locator-patch/highlight/input-value.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"input-value.d.ts","sourceRoot":"","sources":["../../../../../src/test/scripts/pw-locator-patch/highlight/input-value.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAKhD,wBAAgB,eAAe,CAAC,YAAY,EAAE;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,QA4BnE"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.patchInputValue = void 0;
|
|
4
|
+
const logger_1 = require("../../../../logger");
|
|
4
5
|
const constants_1 = require("../../../constants");
|
|
5
6
|
function patchInputValue(LocatorClass) {
|
|
6
7
|
const originalInputValue = LocatorClass.prototype.inputValue;
|
|
@@ -24,7 +25,7 @@ function patchInputValue(LocatorClass) {
|
|
|
24
25
|
}, undefined, { timeout: constants_1.DEFAULT_SCRIPT_EXECUTION_TIMEOUT });
|
|
25
26
|
}
|
|
26
27
|
catch (e) {
|
|
27
|
-
|
|
28
|
+
logger_1.logger.debug("Failed to add highlight for locator method: inputValue");
|
|
28
29
|
}
|
|
29
30
|
return result;
|
|
30
31
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-checked.d.ts","sourceRoot":"","sources":["../../../../../src/test/scripts/pw-locator-patch/highlight/is-checked.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"is-checked.d.ts","sourceRoot":"","sources":["../../../../../src/test/scripts/pw-locator-patch/highlight/is-checked.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAK3C,wBAAgB,cAAc,CAAC,YAAY,EAAE;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,QA4BlE"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.patchIsChecked = void 0;
|
|
4
|
+
const logger_1 = require("../../../../logger");
|
|
4
5
|
const constants_1 = require("../../../constants");
|
|
5
6
|
function patchIsChecked(LocatorClass) {
|
|
6
7
|
const originalIsChecked = LocatorClass.prototype.isChecked;
|
|
@@ -24,7 +25,7 @@ function patchIsChecked(LocatorClass) {
|
|
|
24
25
|
}, undefined, { timeout: constants_1.DEFAULT_SCRIPT_EXECUTION_TIMEOUT });
|
|
25
26
|
}
|
|
26
27
|
catch (e) {
|
|
27
|
-
|
|
28
|
+
logger_1.logger.debug("Failed to add highlight for locator method: isChecked");
|
|
28
29
|
}
|
|
29
30
|
return result;
|
|
30
31
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-disabled.d.ts","sourceRoot":"","sources":["../../../../../src/test/scripts/pw-locator-patch/highlight/is-disabled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"is-disabled.d.ts","sourceRoot":"","sources":["../../../../../src/test/scripts/pw-locator-patch/highlight/is-disabled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAK3C,wBAAgB,eAAe,CAAC,YAAY,EAAE;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,QA4BnE"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.patchIsDisabled = void 0;
|
|
4
|
+
const logger_1 = require("../../../../logger");
|
|
4
5
|
const constants_1 = require("../../../constants");
|
|
5
6
|
function patchIsDisabled(LocatorClass) {
|
|
6
7
|
const originalIsDisabled = LocatorClass.prototype.isDisabled;
|
|
@@ -24,7 +25,7 @@ function patchIsDisabled(LocatorClass) {
|
|
|
24
25
|
}, undefined, { timeout: constants_1.DEFAULT_SCRIPT_EXECUTION_TIMEOUT });
|
|
25
26
|
}
|
|
26
27
|
catch (e) {
|
|
27
|
-
|
|
28
|
+
logger_1.logger.debug("Failed to add highlight for locator method: isDisabled");
|
|
28
29
|
}
|
|
29
30
|
return result;
|
|
30
31
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-editable.d.ts","sourceRoot":"","sources":["../../../../../src/test/scripts/pw-locator-patch/highlight/is-editable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"is-editable.d.ts","sourceRoot":"","sources":["../../../../../src/test/scripts/pw-locator-patch/highlight/is-editable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAK3C,wBAAgB,eAAe,CAAC,YAAY,EAAE;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,QA4BnE"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.patchIsEditable = void 0;
|
|
4
|
+
const logger_1 = require("../../../../logger");
|
|
4
5
|
const constants_1 = require("../../../constants");
|
|
5
6
|
function patchIsEditable(LocatorClass) {
|
|
6
7
|
const originalIsEditable = LocatorClass.prototype.isEditable;
|
|
@@ -24,7 +25,7 @@ function patchIsEditable(LocatorClass) {
|
|
|
24
25
|
}, undefined, { timeout: constants_1.DEFAULT_SCRIPT_EXECUTION_TIMEOUT });
|
|
25
26
|
}
|
|
26
27
|
catch (e) {
|
|
27
|
-
|
|
28
|
+
logger_1.logger.debug("Failed to add highlight for locator method: isEditable");
|
|
28
29
|
}
|
|
29
30
|
return result;
|
|
30
31
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-content.d.ts","sourceRoot":"","sources":["../../../../../src/test/scripts/pw-locator-patch/highlight/text-content.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"text-content.d.ts","sourceRoot":"","sources":["../../../../../src/test/scripts/pw-locator-patch/highlight/text-content.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAKhD,wBAAgB,gBAAgB,CAAC,YAAY,EAAE;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,QA4BpE"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.patchTextContent = void 0;
|
|
4
|
+
const logger_1 = require("../../../../logger");
|
|
4
5
|
const constants_1 = require("../../../constants");
|
|
5
6
|
function patchTextContent(LocatorClass) {
|
|
6
7
|
const originalTextContent = LocatorClass.prototype.textContent;
|
|
@@ -24,7 +25,7 @@ function patchTextContent(LocatorClass) {
|
|
|
24
25
|
}, undefined, { timeout: constants_1.DEFAULT_SCRIPT_EXECUTION_TIMEOUT });
|
|
25
26
|
}
|
|
26
27
|
catch (e) {
|
|
27
|
-
|
|
28
|
+
logger_1.logger.debug("Failed to add highlight for locator method: textContent");
|
|
28
29
|
}
|
|
29
30
|
return result;
|
|
30
31
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empiricalrun/playwright-utils",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.14",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -23,15 +23,17 @@
|
|
|
23
23
|
"author": "Empirical Team <hey@empirical.run>",
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@playwright/test": "1.47.1",
|
|
26
|
-
"@types/node": "^20.14.9",
|
|
27
26
|
"@types/babel__code-frame": "^7.0.6",
|
|
27
|
+
"@types/console-log-level": "^1.4.5",
|
|
28
28
|
"@types/md5": "^2.3.5",
|
|
29
|
-
"@types/mime": "3.0.0"
|
|
29
|
+
"@types/mime": "3.0.0",
|
|
30
|
+
"@types/node": "^20.14.9"
|
|
30
31
|
},
|
|
31
32
|
"dependencies": {
|
|
32
33
|
"@aws-sdk/client-s3": "^3.614.0",
|
|
33
34
|
"@aws-sdk/s3-request-presigner": "^3.614.0",
|
|
34
35
|
"@babel/code-frame": "^7.24.7",
|
|
36
|
+
"console-log-level": "^1.4.1",
|
|
35
37
|
"mailosaur": "^8.6.1",
|
|
36
38
|
"md5": "^2.3.0",
|
|
37
39
|
"mime": "3.0.0",
|
|
@@ -39,7 +41,7 @@
|
|
|
39
41
|
"playwright-extra": "^4.3.6",
|
|
40
42
|
"puppeteer-extra-plugin-recaptcha": "^3.6.8",
|
|
41
43
|
"@empiricalrun/llm": "^0.9.9",
|
|
42
|
-
"@empiricalrun/r2-uploader": "^0.3.
|
|
44
|
+
"@empiricalrun/r2-uploader": "^0.3.6"
|
|
43
45
|
},
|
|
44
46
|
"scripts": {
|
|
45
47
|
"dev": "tsc --build --watch",
|