@empiricalrun/playwright-utils 0.26.8 → 0.26.10

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.
Files changed (40) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/captcha/index.js +1 -2
  3. package/dist/captcha/vision.js +1 -2
  4. package/dist/config.js +6 -6
  5. package/dist/email.js +2 -2
  6. package/dist/reporter/base.d.ts +0 -1
  7. package/dist/reporter/base.d.ts.map +1 -1
  8. package/dist/reporter/base.js +8 -8
  9. package/dist/reporter/custom.js +2 -3
  10. package/dist/reporter/queue.js +2 -3
  11. package/dist/reporter/reporterV2.d.ts +0 -1
  12. package/dist/reporter/reporterV2.d.ts.map +1 -1
  13. package/dist/reporter/uploader.js +2 -3
  14. package/dist/reporter/util.d.ts +0 -1
  15. package/dist/reporter/util.d.ts.map +1 -1
  16. package/dist/reporter/util.js +7 -8
  17. package/dist/test/expect.js +1 -2
  18. package/dist/test/index.d.ts.map +1 -1
  19. package/dist/test/scripts/agent-capabilities.js +1 -2
  20. package/dist/test/scripts/index.js +1 -2
  21. package/dist/test/scripts/locator-highlights.js +1 -2
  22. package/dist/test/scripts/locator-vision.js +1 -2
  23. package/dist/test/scripts/mouse-pointer.js +3 -4
  24. package/dist/test/scripts/pw-locator-patch/dismiss-overlays/cache.js +2 -3
  25. package/dist/test/scripts/pw-locator-patch/dismiss-overlays/index.js +3 -3
  26. package/dist/test/scripts/pw-locator-patch/dismiss-overlays/prompt.js +1 -2
  27. package/dist/test/scripts/pw-locator-patch/dismiss-overlays/utils.js +5 -6
  28. package/dist/test/scripts/pw-locator-patch/highlight/click.js +1 -2
  29. package/dist/test/scripts/pw-locator-patch/highlight/expect.js +1 -2
  30. package/dist/test/scripts/pw-locator-patch/highlight/hover.js +1 -2
  31. package/dist/test/scripts/pw-locator-patch/highlight/inner-text.js +1 -2
  32. package/dist/test/scripts/pw-locator-patch/highlight/input-value.js +1 -2
  33. package/dist/test/scripts/pw-locator-patch/highlight/is-checked.js +1 -2
  34. package/dist/test/scripts/pw-locator-patch/highlight/is-disabled.js +1 -2
  35. package/dist/test/scripts/pw-locator-patch/highlight/is-editable.js +1 -2
  36. package/dist/test/scripts/pw-locator-patch/highlight/text-content.js +1 -2
  37. package/dist/test/scripts/pw-locator-patch/utils/index.js +3 -4
  38. package/dist/test/scripts/pw-locator-patch/vision/query.js +1 -2
  39. package/package.json +4 -4
  40. package/tsconfig.tsbuildinfo +1 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @empiricalrun/playwright-utils
2
2
 
3
+ ## 0.26.10
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [637c97f]
8
+ - Updated dependencies [8c71fd1]
9
+ - Updated dependencies [21b0768]
10
+ - @empiricalrun/test-gen@0.58.0
11
+ - @empiricalrun/llm@0.15.4
12
+ - @empiricalrun/r2-uploader@0.3.9
13
+
14
+ ## 0.26.9
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies [8d69fe6]
19
+ - Updated dependencies [d7c9b1d]
20
+ - Updated dependencies [ca91d3c]
21
+ - @empiricalrun/test-gen@0.57.2
22
+
3
23
  ## 0.26.8
4
24
 
5
25
  ### Patch Changes
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.solveRecaptcha = void 0;
6
+ exports.solveRecaptcha = solveRecaptcha;
7
7
  const puppeteer_extra_plugin_recaptcha_1 = __importDefault(require("puppeteer-extra-plugin-recaptcha"));
8
8
  const vision_1 = require("./vision");
9
9
  const defaultOpts = {
@@ -29,4 +29,3 @@ async function solveRecaptcha(page, options = defaultOpts) {
29
29
  return (0, vision_1.solveRecaptcha)(page);
30
30
  }
31
31
  }
32
- exports.solveRecaptcha = solveRecaptcha;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.solveRecaptcha = void 0;
3
+ exports.solveRecaptcha = solveRecaptcha;
4
4
  const vision_1 = require("@empiricalrun/llm/vision");
5
5
  const RECAPTCHA_FRAME_URL = "https://www.google.com/recaptcha/api2";
6
6
  const MAX_ATTEMPTS = 5;
@@ -80,4 +80,3 @@ async function solveRecaptcha(page) {
80
80
  }
81
81
  }
82
82
  }
83
- exports.solveRecaptcha = solveRecaptcha;
package/dist/config.js CHANGED
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.devices = exports.baseConfig = exports.chromeStablePath = void 0;
6
+ exports.devices = exports.baseConfig = void 0;
7
+ exports.chromeStablePath = chromeStablePath;
7
8
  const deviceDescriptorsSource_json_1 = __importDefault(require("./devices/v1.47.1/deviceDescriptorsSource.json"));
8
9
  function getPlatformOS() {
9
10
  const platform = process.platform;
@@ -34,7 +35,6 @@ function chromeStablePath() {
34
35
  }
35
36
  }
36
37
  }
37
- exports.chromeStablePath = chromeStablePath;
38
38
  exports.baseConfig = {
39
39
  testDir: "./tests",
40
40
  // outputDir is where we store playwright artifacts (during and post test run)
@@ -57,13 +57,13 @@ exports.baseConfig = {
57
57
  mode: "on",
58
58
  size: { width: 1280, height: 720 },
59
59
  },
60
- actionTimeout: 15000,
61
- navigationTimeout: 30000,
60
+ actionTimeout: 15_000,
61
+ navigationTimeout: 30_000,
62
62
  },
63
63
  expect: {
64
- timeout: 15000,
64
+ timeout: 15_000,
65
65
  },
66
- timeout: 15 * 60 * 1000,
66
+ timeout: 15 * 60 * 1_000,
67
67
  };
68
68
  exports.devices = Object.entries(deviceDescriptorsSource_json_1.default).reduce((acc, [name, device]) => ({
69
69
  ...acc,
package/dist/email.js CHANGED
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.EmailClient = void 0;
7
7
  const mailosaur_1 = __importDefault(require("mailosaur"));
8
- const DEFAULT_TIMEOUT = 30000;
8
+ const DEFAULT_TIMEOUT = 30_000;
9
9
  class EmailClient {
10
10
  address;
11
11
  client;
@@ -33,7 +33,7 @@ class EmailClient {
33
33
  }
34
34
  async waitForEmail(filter) {
35
35
  const now = new Date();
36
- const bufferPeriod = 5000;
36
+ const bufferPeriod = 5_000;
37
37
  const receivedAfter = new Date(now.getTime() - bufferPeriod);
38
38
  try {
39
39
  const email = await this.client.messages.get(this.serverId, {
@@ -15,7 +15,6 @@
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
17
  */
18
- /// <reference types="node" />
19
18
  import type { FullConfig, Location, TestCase, TestError, TestResult, TestStep } from "@playwright/test/reporter";
20
19
  export type TestResultOutput = {
21
20
  chunk: string | Buffer;
@@ -1 +1 @@
1
- {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/reporter/base.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;;AAEH,OAAO,KAAK,EACV,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,UAAU,EACV,QAAQ,EACT,MAAM,2BAA2B,CAAC;AAQnC,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;CAC3B,CAAC;AACF,eAAO,MAAM,aAAa,eAAmB,CAAC;AAE9C,KAAK,YAAY,GAAG;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB,CAAC;AAEF,eAAO,MAAQ,KAAK,WAAE,QAAQ,UAAE,MAAM,KA6ClC,CAAC;AAEL,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,QAAQ,EACd,MAAM,EAAE,UAAU,EAClB,aAAa,EAAE,MAAM,E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AE,MAAM,EACrB,aAAa,EAAE,OAAO,GACrB,YAAY,EAAE,CAyBhB;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAEzE;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,QAAQ,GAAG,SAAS,UAMpD;AAED,wBAAgB,WAAW,CACzB,KAAK,EAAE,SAAS,EAChB,aAAa,EAAE,OAAO,GACrB,YAAY,CA+Bd;AAED,wBAAgB,SAAS,CAAC,IAAI,GAAE,MAAW,GAAG,MAAM,CAInD;AAMD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG;IAChD,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB,CAmBA;AAOD,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEpD"}
@@ -21,7 +21,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
21
21
  };
22
22
  var _a;
23
23
  Object.defineProperty(exports, "__esModule", { value: true });
24
- exports.stripAnsiEscapes = exports.prepareErrorStack = exports.separator = exports.formatError = exports.stepSuffix = exports.relativeFilePath = exports.formatResultFailure = exports.colors = exports.ttyWidth = exports.isTTY = exports.kOutputSymbol = void 0;
24
+ exports.colors = exports.ttyWidth = exports.isTTY = exports.kOutputSymbol = void 0;
25
+ exports.formatResultFailure = formatResultFailure;
26
+ exports.relativeFilePath = relativeFilePath;
27
+ exports.stepSuffix = stepSuffix;
28
+ exports.formatError = formatError;
29
+ exports.separator = separator;
30
+ exports.prepareErrorStack = prepareErrorStack;
31
+ exports.stripAnsiEscapes = stripAnsiEscapes;
25
32
  const path_1 = __importDefault(require("path"));
26
33
  const utilsBundle_1 = require("playwright-core/lib/utilsBundle");
27
34
  exports.kOutputSymbol = Symbol("output");
@@ -90,11 +97,9 @@ function formatResultFailure(test, result, initialIndent, highlightCode) {
90
97
  }
91
98
  return errorDetails;
92
99
  }
93
- exports.formatResultFailure = formatResultFailure;
94
100
  function relativeFilePath(config, file) {
95
101
  return path_1.default.relative(config.rootDir, file) || path_1.default.basename(file);
96
102
  }
97
- exports.relativeFilePath = relativeFilePath;
98
103
  function stepSuffix(step) {
99
104
  const stepTitles = step ? step.titlePath() : [];
100
105
  return stepTitles
@@ -102,7 +107,6 @@ function stepSuffix(step) {
102
107
  .map((t) => " › " + t)
103
108
  .join("");
104
109
  }
105
- exports.stepSuffix = stepSuffix;
106
110
  function formatError(error, highlightCode) {
107
111
  const message = error.message || error.value || "";
108
112
  const stack = error.stack;
@@ -132,14 +136,12 @@ function formatError(error, highlightCode) {
132
136
  message: tokens.join("\n"),
133
137
  };
134
138
  }
135
- exports.formatError = formatError;
136
139
  function separator(text = "") {
137
140
  if (text)
138
141
  text += " ";
139
142
  const columns = Math.min(100, exports.ttyWidth || 100);
140
143
  return text + exports.colors.dim("─".repeat(Math.max(0, columns - text.length)));
141
144
  }
142
- exports.separator = separator;
143
145
  function indent(lines, tab) {
144
146
  return lines.replace(/^(?=.+$)/gm, tab);
145
147
  }
@@ -166,14 +168,12 @@ function prepareErrorStack(stack) {
166
168
  }
167
169
  return { message, stackLines, location };
168
170
  }
169
- exports.prepareErrorStack = prepareErrorStack;
170
171
  const ansiRegex = new RegExp(
171
172
  // eslint-disable-next-line no-control-regex
172
173
  "([\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~])))", "g");
173
174
  function stripAnsiEscapes(str) {
174
175
  return str.replace(ansiRegex, "");
175
176
  }
176
- exports.stripAnsiEscapes = stripAnsiEscapes;
177
177
  function belongsToNodeModules(file) {
178
178
  return file.includes(`${path_1.default.sep}node_modules${path_1.default.sep}`);
179
179
  }
@@ -20,7 +20,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
20
20
  return (mod && mod.__esModule) ? mod : { "default": mod };
21
21
  };
22
22
  Object.defineProperty(exports, "__esModule", { value: true });
23
- exports.startHtmlReportServer = exports.showHTMLReport = void 0;
23
+ exports.showHTMLReport = showHTMLReport;
24
+ exports.startHtmlReportServer = startHtmlReportServer;
24
25
  const code_frame_1 = require("@babel/code-frame");
25
26
  const crypto_1 = require("crypto");
26
27
  const fs_1 = __importDefault(require("fs"));
@@ -379,7 +380,6 @@ async function showHTMLReport(reportFolder, host = "localhost", port, testId) {
379
380
  await (0, utilsBundle_1.open)(url, { wait: true }).catch(() => { });
380
381
  await new Promise(() => { });
381
382
  }
382
- exports.showHTMLReport = showHTMLReport;
383
383
  function startHtmlReportServer(folder) {
384
384
  const server = new utils_1.HttpServer();
385
385
  server.routePrefix("/", (request, response) => {
@@ -402,7 +402,6 @@ function startHtmlReportServer(folder) {
402
402
  });
403
403
  return server;
404
404
  }
405
- exports.startHtmlReportServer = startHtmlReportServer;
406
405
  class HtmlBuilder {
407
406
  _config;
408
407
  _reportFolder;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.waitForTaskQueueToFinish = exports.sendTaskToQueue = void 0;
3
+ exports.sendTaskToQueue = sendTaskToQueue;
4
+ exports.waitForTaskQueueToFinish = waitForTaskQueueToFinish;
4
5
  const logger_1 = require("../logger");
5
6
  class TaskQueue {
6
7
  waitingQueue = [];
@@ -81,9 +82,7 @@ function sendTaskToQueue(task) {
81
82
  logger_1.logger.debug("[queue] sending task to queue, with queue lengths:", taskQueue.queueLength, taskQueue.executingTasksCount, task);
82
83
  return taskQueue.enqueue(task);
83
84
  }
84
- exports.sendTaskToQueue = sendTaskToQueue;
85
85
  function waitForTaskQueueToFinish() {
86
86
  logger_1.logger.debug("[queue] waiting for queue to finish, with queue lengths:", taskQueue.queueLength, taskQueue.executingTasksCount);
87
87
  return taskQueue.waitForCompletion();
88
88
  }
89
- exports.waitForTaskQueueToFinish = waitForTaskQueueToFinish;
@@ -15,7 +15,6 @@
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
17
  */
18
- /// <reference types="node" />
19
18
  import type { FullConfig, FullResult, Suite, TestCase, TestError, TestResult, TestStep } from "@playwright/test/reporter";
20
19
  export interface ReporterV2 {
21
20
  onConfigure(config: FullConfig): void;
@@ -1 +1 @@
1
- {"version":3,"file":"reporterV2.d.ts","sourceRoot":"","sources":["../../src/reporter/reporterV2.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;;AAEH,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,KAAK,EACL,QAAQ,EACR,SAAS,EACT,UAAU,EACV,QAAQ,EACT,MAAM,2BAA2B,CAAC;AAEnC,MAAM,WAAW,UAAU;IACzB,WAAW,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;IACtC,OAAO,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAC5B,WAAW,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;IACtD,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,IAAI,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;IAC7E,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,IAAI,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;IAC7E,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;IACpD,KAAK,CACH,MAAM,EAAE,UAAU,GACjB,OAAO,CAAC;QAAE,MAAM,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAA;KAAE,GAAG,SAAS,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IACxE,MA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AAM,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAA;KAAE,GAAG,SAAS,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IACxE,MAAM,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/B,OAAO,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,CAAC;IAChC,WAAW,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;IACtE,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;IACpE,aAAa,IAAI,OAAO,CAAC;IACzB,OAAO,IAAI,IAAI,CAAC;CACjB"}
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.createUploadTask = exports.uploadFiles = void 0;
6
+ exports.uploadFiles = uploadFiles;
7
+ exports.createUploadTask = createUploadTask;
7
8
  const r2_uploader_1 = require("@empiricalrun/r2-uploader");
8
9
  const path_1 = __importDefault(require("path"));
9
10
  const logger_1 = require("../logger");
@@ -30,7 +31,6 @@ async function uploadFiles({ fileList, outputFolder, relativePath, }) {
30
31
  logger_1.logger.debug("Finished uploading files:", urls);
31
32
  return urls;
32
33
  }
33
- exports.uploadFiles = uploadFiles;
34
34
  function createUploadTask({ fileList, outputFolder, relativePath = "", }) {
35
35
  return async () => {
36
36
  return uploadFiles({
@@ -45,4 +45,3 @@ function createUploadTask({ fileList, outputFolder, relativePath = "", }) {
45
45
  .catch((e) => logger_1.logger.error("Error uploading files", e));
46
46
  };
47
47
  }
48
- exports.createUploadTask = createUploadTask;
@@ -15,7 +15,6 @@
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
17
  */
18
- /// <reference types="node" />
19
18
  import { TestCase } from "@playwright/test/reporter";
20
19
  import { TestCaseRunEndEvent } from "./types";
21
20
  export declare function getPackageJsonPath(folderPath: string): string;
@@ -1 +1 @@
1
- {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/reporter/util.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;;AAEH,OAAO,EAAS,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAgB5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAI9C,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAmB7D;AAED,wBAAgB,yBAAyB,CACvC,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,GAAG,SAAS,UAMhC;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,CAyCD;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,QAAQ;;;EAwBrD;AAED,wBAAsB,6BAA6B,CACjD,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAyDf;AAED,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,GAAG,EACR,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,GACnC,GAAG,CAIL"}
1
+ {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/reporter/util.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAS,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAgB5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAI9C,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAmB7D;AAED,wBAAgB,yBAAyB,CACvC,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,GAAG,SAAS,UAMhC;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,CAyCD;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,QAAQ;;;EAwBrD;AAED,wBAAsB,6BAA6B,CACjD,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAyDf;AAED,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,GAAG,EACR,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,GACnC,GAAG,CAIL"}
@@ -20,7 +20,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
20
20
  return (mod && mod.__esModule) ? mod : { "default": mod };
21
21
  };
22
22
  Object.defineProperty(exports, "__esModule", { value: true });
23
- exports.safelySerialiseJSON = exports.sendTestCaseUpdateToDashboard = exports.suitesAndProjectForTest = exports.normalizeAndSaveAttachment = exports.resolveReporterOutputPath = exports.getPackageJsonPath = void 0;
23
+ exports.getPackageJsonPath = getPackageJsonPath;
24
+ exports.resolveReporterOutputPath = resolveReporterOutputPath;
25
+ exports.normalizeAndSaveAttachment = normalizeAndSaveAttachment;
26
+ exports.suitesAndProjectForTest = suitesAndProjectForTest;
27
+ exports.sendTestCaseUpdateToDashboard = sendTestCaseUpdateToDashboard;
28
+ exports.safelySerialiseJSON = safelySerialiseJSON;
24
29
  const async_retry_1 = __importDefault(require("async-retry"));
25
30
  const fs_1 = __importDefault(require("fs"));
26
31
  const path_1 = __importDefault(require("path"));
@@ -46,7 +51,6 @@ function getPackageJsonPath(folderPath) {
46
51
  folderToPackageJsonPath.set(folderPath, result);
47
52
  return result;
48
53
  }
49
- exports.getPackageJsonPath = getPackageJsonPath;
50
54
  function resolveReporterOutputPath(defaultValue, configDir, configValue) {
51
55
  if (configValue)
52
56
  return path_1.default.resolve(configDir, configValue);
@@ -54,7 +58,6 @@ function resolveReporterOutputPath(defaultValue, configDir, configValue) {
54
58
  basePath = basePath ? path_1.default.dirname(basePath) : process.cwd();
55
59
  return path_1.default.resolve(basePath, defaultValue);
56
60
  }
57
- exports.resolveReporterOutputPath = resolveReporterOutputPath;
58
61
  async function normalizeAndSaveAttachment(outputPath, name, options = {}) {
59
62
  if (options.path === undefined && options.body === undefined)
60
63
  return { name, contentType: "text/plain" };
@@ -88,7 +91,6 @@ async function normalizeAndSaveAttachment(outputPath, name, options = {}) {
88
91
  };
89
92
  }
90
93
  }
91
- exports.normalizeAndSaveAttachment = normalizeAndSaveAttachment;
92
94
  function suitesAndProjectForTest(test) {
93
95
  let rawSuites = [];
94
96
  if (test.parent) {
@@ -114,7 +116,6 @@ function suitesAndProjectForTest(test) {
114
116
  projectName: projectName,
115
117
  };
116
118
  }
117
- exports.suitesAndProjectForTest = suitesAndProjectForTest;
118
119
  async function sendTestCaseUpdateToDashboard(params) {
119
120
  const DOMAIN = process.env.DASHBOARD_DOMAIN || "https://dash.empirical.run";
120
121
  try {
@@ -153,7 +154,7 @@ async function sendTestCaseUpdateToDashboard(params) {
153
154
  }, {
154
155
  retries: 3,
155
156
  minTimeout: 1000,
156
- maxTimeout: 60000,
157
+ maxTimeout: 60_000,
157
158
  factor: 3,
158
159
  });
159
160
  logger_1.logger.debug("Successfully sent test case update to dashboard");
@@ -162,8 +163,6 @@ async function sendTestCaseUpdateToDashboard(params) {
162
163
  console.error(e.message);
163
164
  }
164
165
  }
165
- exports.sendTestCaseUpdateToDashboard = sendTestCaseUpdateToDashboard;
166
166
  function safelySerialiseJSON(obj, keyFilter) {
167
167
  return JSON.parse(JSON.stringify(obj, (key, value) => (keyFilter?.(key) ? undefined : value)));
168
168
  }
169
- exports.safelySerialiseJSON = safelySerialiseJSON;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toLookRight = void 0;
3
+ exports.toLookRight = toLookRight;
4
4
  const llm_1 = require("@empiricalrun/llm");
5
5
  const vision_1 = require("@empiricalrun/llm/vision");
6
6
  const mouse_pointer_1 = require("./scripts/mouse-pointer");
@@ -99,4 +99,3 @@ go through the reasons and pick the one that made you choose Fail`,
99
99
  pass: result.result === "Pass",
100
100
  };
101
101
  }
102
- exports.toLookRight = toLookRight;
@@ -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,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,QAAQ,EACT,MAAM,kBAAkB,CAAC;AAM1B,OAAO,EAAE,6BAA6B,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,cAAc,CAAC;QACvB,UAAU,QAAQ,CAAC,CAAC;Y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EAAE,qBAAqB,KAC5B,OAAO,CAAC;QAAE,OAAO,EAAE,cAAc,CAAC;QAAC,IAAI,EAAE,IAAI,CAAA;KAAE,CAAC,CAAC;IACtD,UAAU,EAAE,IAAI,CAAC;CAClB,CAAC;AAUF,QAAA,MAAM,eAAe,GACnB,QAAQ,QAAQ,CACd,kBAAkB,GAAG,qBAAqB,EAC1C,oBAAoB,GAAG,uBAAuB,CAC/C,EACD,UAAS,eAAgC,uHAwD1C,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,6BAA6B,EAAE,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addAgentCapabilities = void 0;
3
+ exports.addAgentCapabilities = addAgentCapabilities;
4
4
  const click_1 = require("./pw-locator-patch/highlight/click");
5
5
  const hover_1 = require("./pw-locator-patch/highlight/hover");
6
6
  function applyPatchForAutoDismissOverlay(page, testFn) {
@@ -14,4 +14,3 @@ function addAgentCapabilities(page, testFn) {
14
14
  applyPatchForAutoDismissOverlay(newPage, testFn);
15
15
  });
16
16
  }
17
- exports.addAgentCapabilities = addAgentCapabilities;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.injectLocatorHighlightScripts = void 0;
3
+ exports.injectLocatorHighlightScripts = injectLocatorHighlightScripts;
4
4
  const logger_1 = require("../../logger");
5
5
  const agent_capabilities_1 = require("./agent-capabilities");
6
6
  const locator_highlights_1 = require("./locator-highlights");
@@ -35,4 +35,3 @@ function injectLocatorHighlightScripts(page, testFn, options = defaultOptions) {
35
35
  logger_1.logger.debug("Failed to add mouse pointer highlighter", e);
36
36
  }
37
37
  }
38
- exports.injectLocatorHighlightScripts = injectLocatorHighlightScripts;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addLocatorHighlights = void 0;
3
+ exports.addLocatorHighlights = addLocatorHighlights;
4
4
  const expect_1 = require("./pw-locator-patch/highlight/expect");
5
5
  const hover_1 = require("./pw-locator-patch/highlight/hover");
6
6
  const inner_text_1 = require("./pw-locator-patch/highlight/inner-text");
@@ -15,7 +15,6 @@ function addLocatorHighlights(page, testFn) {
15
15
  applyHighlights(newPage, testFn);
16
16
  });
17
17
  }
18
- exports.addLocatorHighlights = addLocatorHighlights;
19
18
  function applyHighlights(page, testFn) {
20
19
  const LocatorClass = page.locator("").constructor;
21
20
  (0, hover_1.patchHover)(LocatorClass, testFn);
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addLocatorVisionMethods = void 0;
3
+ exports.addLocatorVisionMethods = addLocatorVisionMethods;
4
4
  const query_1 = require("./pw-locator-patch/vision/query");
5
5
  function addLocatorVisionMethods(page) {
6
6
  const LocatorClass = page.locator("").constructor;
@@ -10,4 +10,3 @@ function addLocatorVisionMethods(page) {
10
10
  (0, query_1.patchQuery)(NewPageLocatorClass);
11
11
  });
12
12
  }
13
- exports.addLocatorVisionMethods = addLocatorVisionMethods;
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addMousePointerHighlighter = exports.removeMousePointerHighlighter = exports.addHighlighterScriptsToPage = void 0;
3
+ exports.addHighlighterScriptsToPage = addHighlighterScriptsToPage;
4
+ exports.removeMousePointerHighlighter = removeMousePointerHighlighter;
5
+ exports.addMousePointerHighlighter = addMousePointerHighlighter;
4
6
  const logger_1 = require("../../logger");
5
7
  const STYLES_FOR_MOUSE_POINTER = `
6
8
  .empirical-mouse-pointer {
@@ -82,7 +84,6 @@ async function addHighlighterScriptsToPage(page) {
82
84
  logger_1.logger.debug(`Error adding mouse pointer highlighter`, e);
83
85
  }
84
86
  }
85
- exports.addHighlighterScriptsToPage = addHighlighterScriptsToPage;
86
87
  async function removeMousePointerHighlighter(page) {
87
88
  try {
88
89
  await page.evaluate(() => {
@@ -112,7 +113,6 @@ async function removeMousePointerHighlighter(page) {
112
113
  logger_1.logger.debug(`Error removing mouse pointer highlighter`, e);
113
114
  }
114
115
  }
115
- exports.removeMousePointerHighlighter = removeMousePointerHighlighter;
116
116
  function addMousePointerHighlighter(page) {
117
117
  page.on("load", async () => {
118
118
  await addHighlighterScriptsToPage(page);
@@ -123,4 +123,3 @@ function addMousePointerHighlighter(page) {
123
123
  });
124
124
  });
125
125
  }
126
- exports.addMousePointerHighlighter = addMousePointerHighlighter;
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.executeFromCache = exports.setCodeToCache = void 0;
6
+ exports.setCodeToCache = setCodeToCache;
7
+ exports.executeFromCache = executeFromCache;
7
8
  const fs_1 = __importDefault(require("fs"));
8
9
  const path_1 = __importDefault(require("path"));
9
10
  const CACHE_FILE = path_1.default.join(process.cwd(), ".empiricalrun", `overlay-cache.json`);
@@ -47,7 +48,6 @@ async function setCodeToCache({ dom, text, code, }) {
47
48
  }
48
49
  fs_1.default.writeFileSync(CACHE_FILE, JSON.stringify(cache, null, 2));
49
50
  }
50
- exports.setCodeToCache = setCodeToCache;
51
51
  async function executeFromCache({ page, dom, text, }) {
52
52
  if (!dom && !text) {
53
53
  // At least one of the two is required
@@ -79,4 +79,3 @@ async function executeFromCache({ page, dom, text, }) {
79
79
  return { success: false };
80
80
  }
81
81
  }
82
- exports.executeFromCache = executeFromCache;
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.extractInterceptingElement = exports.OverlayDismissAgent = exports.isErrorSupported = void 0;
3
+ exports.OverlayDismissAgent = void 0;
4
+ exports.isErrorSupported = isErrorSupported;
5
+ exports.extractInterceptingElement = extractInterceptingElement;
4
6
  const run_1 = require("@empiricalrun/test-gen/agent/master/run");
5
7
  const cache_1 = require("./cache");
6
8
  const prompt_1 = require("./prompt");
@@ -13,7 +15,6 @@ function isErrorSupported(errorMessage) {
13
15
  }
14
16
  return errorMessage.includes(ERROR_SUBSTRING_INTERCEPTION);
15
17
  }
16
- exports.isErrorSupported = isErrorSupported;
17
18
  class OverlayDismissAgent {
18
19
  page;
19
20
  cachingCandidates = [];
@@ -120,7 +121,6 @@ function extractInterceptingElement(errorMessage) {
120
121
  };
121
122
  }
122
123
  }
123
- exports.extractInterceptingElement = extractInterceptingElement;
124
124
  function removeAnsiCodes(str) {
125
125
  const ansiRegex = new RegExp(String.raw `\u001b\[[0-9;]*m`, "g");
126
126
  return str.replace(ansiRegex, "");
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getTask = void 0;
3
+ exports.getTask = getTask;
4
4
  const utils_1 = require("./utils");
5
5
  async function getTask(page, element, text) {
6
6
  let promptAddition = text
@@ -41,7 +41,6 @@ Examples of typical popups:
41
41
  ${promptAddition}`;
42
42
  return task;
43
43
  }
44
- exports.getTask = getTask;
45
44
  function promptForPFScenario(text) {
46
45
  const promptAddition = text
47
46
  ? `The Overlapper element can be identifed with the following text content:
@@ -1,6 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.traceThis = exports.annotateForReport = exports.textContent = exports.isProductFruitsOverlay = exports.overlayDescription = void 0;
3
+ exports.overlayDescription = overlayDescription;
4
+ exports.isProductFruitsOverlay = isProductFruitsOverlay;
5
+ exports.textContent = textContent;
6
+ exports.annotateForReport = annotateForReport;
7
+ exports.traceThis = traceThis;
4
8
  const llm_1 = require("@empiricalrun/llm");
5
9
  function overlayDescription(element) {
6
10
  if (element) {
@@ -13,12 +17,10 @@ function overlayDescription(element) {
13
17
  }
14
18
  }
15
19
  }
16
- exports.overlayDescription = overlayDescription;
17
20
  function isProductFruitsOverlay(element) {
18
21
  return (element?.parent?.includes("productfruits--container") ||
19
22
  element?.interceptor.includes("productfruits--container"));
20
23
  }
21
- exports.isProductFruitsOverlay = isProductFruitsOverlay;
22
24
  async function textContent(pageRef, element) {
23
25
  try {
24
26
  if (element) {
@@ -67,7 +69,6 @@ async function textContent(pageRef, element) {
67
69
  return undefined;
68
70
  }
69
71
  }
70
- exports.textContent = textContent;
71
72
  function annotateForReport(testFn, description) {
72
73
  console.log(`[Overlay dismissal]: ${description}`);
73
74
  testFn.info().annotations.push({
@@ -75,7 +76,6 @@ function annotateForReport(testFn, description) {
75
76
  description,
76
77
  });
77
78
  }
78
- exports.annotateForReport = annotateForReport;
79
79
  function traceThis(task, testFn) {
80
80
  const metadata = {
81
81
  projectName: process.env.PROJECT_NAME ?? "",
@@ -94,4 +94,3 @@ function traceThis(task, testFn) {
94
94
  }
95
95
  return trace;
96
96
  }
97
- exports.traceThis = traceThis;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.patchClick = void 0;
3
+ exports.patchClick = patchClick;
4
4
  const dismiss_overlays_1 = require("../dismiss-overlays");
5
5
  const utils_1 = require("../dismiss-overlays/utils");
6
6
  const utils_2 = require("../utils");
@@ -49,4 +49,3 @@ function patchClick(LocatorClass, testFn) {
49
49
  };
50
50
  isClickPatched.set(LocatorClass, true);
51
51
  }
52
- exports.patchClick = patchClick;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.patchExpect = void 0;
3
+ exports.patchExpect = patchExpect;
4
4
  const utils_1 = require("../utils");
5
5
  const isExpectPatched = new WeakMap();
6
6
  function patchExpect(LocatorClass) {
@@ -21,4 +21,3 @@ function patchExpect(LocatorClass) {
21
21
  };
22
22
  isExpectPatched.set(LocatorClass, true);
23
23
  }
24
- exports.patchExpect = patchExpect;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.patchHover = void 0;
3
+ exports.patchHover = patchHover;
4
4
  const dismiss_overlays_1 = require("../dismiss-overlays");
5
5
  const utils_1 = require("../dismiss-overlays/utils");
6
6
  const utils_2 = require("../utils");
@@ -43,4 +43,3 @@ function patchHover(LocatorClass, testFn) {
43
43
  };
44
44
  isHoverPatched.set(LocatorClass, true);
45
45
  }
46
- exports.patchHover = patchHover;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.patchInnerText = void 0;
3
+ exports.patchInnerText = patchInnerText;
4
4
  const utils_1 = require("../utils");
5
5
  const isInnerTextPatched = new WeakMap();
6
6
  function patchInnerText(LocatorClass, testFn) {
@@ -28,4 +28,3 @@ function patchInnerText(LocatorClass, testFn) {
28
28
  };
29
29
  isInnerTextPatched.set(LocatorClass, true);
30
30
  }
31
- exports.patchInnerText = patchInnerText;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.patchInputValue = void 0;
3
+ exports.patchInputValue = patchInputValue;
4
4
  const utils_1 = require("../utils");
5
5
  const isInputValuePatched = new WeakMap();
6
6
  function patchInputValue(LocatorClass, testFn) {
@@ -28,4 +28,3 @@ function patchInputValue(LocatorClass, testFn) {
28
28
  };
29
29
  isInputValuePatched.set(LocatorClass, true);
30
30
  }
31
- exports.patchInputValue = patchInputValue;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.patchIsChecked = void 0;
3
+ exports.patchIsChecked = patchIsChecked;
4
4
  const utils_1 = require("../utils");
5
5
  const isIsCheckedPatched = new WeakMap();
6
6
  function patchIsChecked(LocatorClass, testFn) {
@@ -28,4 +28,3 @@ function patchIsChecked(LocatorClass, testFn) {
28
28
  };
29
29
  isIsCheckedPatched.set(LocatorClass, true);
30
30
  }
31
- exports.patchIsChecked = patchIsChecked;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.patchIsDisabled = void 0;
3
+ exports.patchIsDisabled = patchIsDisabled;
4
4
  const utils_1 = require("../utils");
5
5
  const isIsDisabledPatched = new WeakMap();
6
6
  function patchIsDisabled(LocatorClass, testFn) {
@@ -28,4 +28,3 @@ function patchIsDisabled(LocatorClass, testFn) {
28
28
  };
29
29
  isIsDisabledPatched.set(LocatorClass, true);
30
30
  }
31
- exports.patchIsDisabled = patchIsDisabled;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.patchIsEditable = void 0;
3
+ exports.patchIsEditable = patchIsEditable;
4
4
  const utils_1 = require("../utils");
5
5
  const isIsEditablePatched = new WeakMap();
6
6
  function patchIsEditable(LocatorClass, testFn) {
@@ -27,4 +27,3 @@ function patchIsEditable(LocatorClass, testFn) {
27
27
  };
28
28
  isIsEditablePatched.set(LocatorClass, true);
29
29
  }
30
- exports.patchIsEditable = patchIsEditable;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.patchTextContent = void 0;
3
+ exports.patchTextContent = patchTextContent;
4
4
  const utils_1 = require("../utils");
5
5
  const isTextContentPatched = new WeakMap();
6
6
  function patchTextContent(LocatorClass, testFn) {
@@ -28,4 +28,3 @@ function patchTextContent(LocatorClass, testFn) {
28
28
  };
29
29
  isTextContentPatched.set(LocatorClass, true);
30
30
  }
31
- exports.patchTextContent = patchTextContent;
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.highlight = exports.scrollAndHighlight = exports.description = void 0;
3
+ exports.description = description;
4
+ exports.scrollAndHighlight = scrollAndHighlight;
5
+ exports.highlight = highlight;
4
6
  const logger_1 = require("../../../../logger");
5
7
  const constants_1 = require("../../../constants");
6
8
  function description(locator) {
@@ -24,7 +26,6 @@ function description(locator) {
24
26
  return fallbackDescription;
25
27
  }
26
28
  }
27
- exports.description = description;
28
29
  async function scrollAndHighlight(locator) {
29
30
  try {
30
31
  await locator.evaluate((node) => {
@@ -46,7 +47,6 @@ async function scrollAndHighlight(locator) {
46
47
  logger_1.logger.debug("Failed to scroll and highlight for locator method");
47
48
  }
48
49
  }
49
- exports.scrollAndHighlight = scrollAndHighlight;
50
50
  async function highlight(locator) {
51
51
  try {
52
52
  await locator.evaluate((node) => {
@@ -62,4 +62,3 @@ async function highlight(locator) {
62
62
  logger_1.logger.debug("Failed to add highlight for locator method");
63
63
  }
64
64
  }
65
- exports.highlight = highlight;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.patchQuery = void 0;
3
+ exports.patchQuery = patchQuery;
4
4
  const vision_1 = require("@empiricalrun/llm/vision");
5
5
  function patchQuery(LocatorClass) {
6
6
  LocatorClass.prototype.query = async function (instruction) {
@@ -10,4 +10,3 @@ function patchQuery(LocatorClass) {
10
10
  return answer;
11
11
  };
12
12
  }
13
- exports.patchQuery = patchQuery;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empiricalrun/playwright-utils",
3
- "version": "0.26.8",
3
+ "version": "0.26.10",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"
@@ -38,9 +38,9 @@
38
38
  "mailosaur": "^8.6.1",
39
39
  "puppeteer-extra-plugin-recaptcha": "^3.6.8",
40
40
  "rimraf": "^6.0.1",
41
- "@empiricalrun/llm": "^0.15.3",
42
- "@empiricalrun/r2-uploader": "^0.3.8",
43
- "@empiricalrun/test-gen": "^0.57.1"
41
+ "@empiricalrun/llm": "^0.15.4",
42
+ "@empiricalrun/r2-uploader": "^0.3.9",
43
+ "@empiricalrun/test-gen": "^0.58.0"
44
44
  },
45
45
  "scripts": {
46
46
  "dev": "tsc --build --watch",
@@ -0,0 +1 @@
1
+ {"root":["./src/config.ts","./src/email.ts","./src/index.ts","./src/logger.ts","./src/playwright-extensions.ts","./src/auth/index.ts","./src/auth/types.ts","./src/captcha/index.ts","./src/captcha/vision.ts","./src/devices/types.ts","./src/overlay-tests/click.spec.ts","./src/overlay-tests/fixtures.ts","./src/overlay-tests/patch.spec.ts","./src/reporter/base.ts","./src/reporter/custom.ts","./src/reporter/queue.ts","./src/reporter/reporterV2.ts","./src/reporter/types.ts","./src/reporter/uploader.ts","./src/reporter/util.ts","./src/reporter/third_party/html-reporter-types.ts","./src/test/constants.ts","./src/test/expect.ts","./src/test/index.ts","./src/test/types.ts","./src/test/scripts/agent-capabilities.ts","./src/test/scripts/index.ts","./src/test/scripts/locator-highlights.ts","./src/test/scripts/locator-vision.ts","./src/test/scripts/mouse-pointer.ts","./src/test/scripts/types.ts","./src/test/scripts/pw-locator-patch/dismiss-overlays/cache.ts","./src/test/scripts/pw-locator-patch/dismiss-overlays/index.ts","./src/test/scripts/pw-locator-patch/dismiss-overlays/prompt.ts","./src/test/scripts/pw-locator-patch/dismiss-overlays/types.ts","./src/test/scripts/pw-locator-patch/dismiss-overlays/utils.ts","./src/test/scripts/pw-locator-patch/highlight/click.ts","./src/test/scripts/pw-locator-patch/highlight/expect.ts","./src/test/scripts/pw-locator-patch/highlight/hover.ts","./src/test/scripts/pw-locator-patch/highlight/inner-text.ts","./src/test/scripts/pw-locator-patch/highlight/input-value.ts","./src/test/scripts/pw-locator-patch/highlight/is-checked.ts","./src/test/scripts/pw-locator-patch/highlight/is-disabled.ts","./src/test/scripts/pw-locator-patch/highlight/is-editable.ts","./src/test/scripts/pw-locator-patch/highlight/text-content.ts","./src/test/scripts/pw-locator-patch/utils/index.ts","./src/test/scripts/pw-locator-patch/vision/query.ts"],"version":"5.8.3"}