@empiricalrun/playwright-utils 0.23.3 → 0.23.5

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 CHANGED
@@ -1,5 +1,24 @@
1
1
  # @empiricalrun/playwright-utils
2
2
 
3
+ ## 0.23.5
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [56ed4eb]
8
+ - @empiricalrun/test-gen@0.47.3
9
+
10
+ ## 0.23.4
11
+
12
+ ### Patch Changes
13
+
14
+ - af97c0f: feat: cua agent can generate code
15
+ - d7f1678: feat: support openai cua for overlay dismissal, bump openai to 4.87.3
16
+ - Updated dependencies [af97c0f]
17
+ - Updated dependencies [d7f1678]
18
+ - Updated dependencies [09e880a]
19
+ - @empiricalrun/test-gen@0.47.2
20
+ - @empiricalrun/llm@0.9.36
21
+
3
22
  ## 0.23.3
4
23
 
5
24
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/test/scripts/pw-locator-patch/dismiss-overlays/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAUzC,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,WAKhE;AAED,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,cAAc,GAAG,SAAS,iBAwDpC;AAED,wBAAgB,0BAA0B,CACxC,YAAY,EAAE,MAAM,GACnB,cAAc,GAAG,SAAS,CAiC5B;AAwBD,wBAAsB,sBAAsB,CAAC,CAAC,EAC5C,aAAa,EAAE,GAAG,EAClB,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAC5B,OAAO,CAAC,CAAC,CAAC,CAyBZ"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/test/scripts/pw-locator-patch/dismiss-overlays/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAYzC,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,WAKhE;AAED,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,cAAc,GAAG,SAAS,iBA+DpC;AAED,wBAAgB,0BAA0B,CACxC,YAAY,EAAE,MAAM,GACnB,cAAc,GAAG,SAAS,CAiC5B;AAwBD,wBAAsB,sBAAsB,CAAC,CAAC,EAC5C,aAAa,EAAE,GAAG,EAClB,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAC5B,OAAO,CAAC,CAAC,CAAC,CAyBZ"}
@@ -5,6 +5,7 @@ const run_1 = require("@empiricalrun/test-gen/agent/master/run");
5
5
  const cache_1 = require("./cache");
6
6
  const utils_1 = require("./utils");
7
7
  const ERROR_SUBSTRING_INTERCEPTION = "intercepts pointer events";
8
+ const PREFERRED_AGENT = "inhouse-master";
8
9
  function isErrorSupported(errorMessage) {
9
10
  if (!errorMessage) {
10
11
  return false;
@@ -25,6 +26,7 @@ async function runAgentOnOverlay(pageRef, element) {
25
26
  : ``;
26
27
  let task = `
27
28
  Find a way to dismiss the popup. If the popup is non dismissible or there is no popup then return immediately.
29
+ Do all actions required to dismiss the popup - don't ask for user confirmation.
28
30
  Also note that you just need to dismiss popup and do nothing else.
29
31
  ${promptAddition}`;
30
32
  if ((0, utils_1.isProductFruitsOverlay)(element)) {
@@ -45,26 +47,34 @@ The only way to work around this is to Click on any other sidebar link element.
45
47
  Don't reattempt the click on Target element, your job is done after the first click.
46
48
  `;
47
49
  }
48
- const { success } = await (0, cache_1.executeFromCache)({
49
- page: pageRef,
50
- dom: element?.interceptor,
51
- text,
52
- });
53
- if (success) {
54
- return;
50
+ if (PREFERRED_AGENT === "inhouse-master") {
51
+ const { success } = await (0, cache_1.executeFromCache)({
52
+ page: pageRef,
53
+ dom: element?.interceptor,
54
+ text,
55
+ });
56
+ if (success) {
57
+ return;
58
+ }
59
+ const result = await (0, run_1.createTestUsingMasterAgent)({
60
+ task,
61
+ page: pageRef,
62
+ options: {
63
+ useActionSpecificAnnotations: true,
64
+ },
65
+ });
66
+ await (0, cache_1.setCodeToCache)({
67
+ dom: element?.interceptor,
68
+ text,
69
+ code: result.code,
70
+ });
71
+ }
72
+ else if (PREFERRED_AGENT === "openai-cua") {
73
+ await (0, run_1.executeUsingComputerUseAgent)({
74
+ page: pageRef,
75
+ task,
76
+ });
55
77
  }
56
- const result = await (0, run_1.createTestUsingMasterAgent)({
57
- task,
58
- page: pageRef,
59
- options: {
60
- useActionSpecificAnnotations: true,
61
- },
62
- });
63
- await (0, cache_1.setCodeToCache)({
64
- dom: element?.interceptor,
65
- text,
66
- code: result.code,
67
- });
68
78
  }
69
79
  exports.runAgentOnOverlay = runAgentOnOverlay;
70
80
  function extractInterceptingElement(errorMessage) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empiricalrun/playwright-utils",
3
- "version": "0.23.3",
3
+ "version": "0.23.5",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"
@@ -42,9 +42,9 @@
42
42
  "playwright-core": "1.47.1",
43
43
  "puppeteer-extra-plugin-recaptcha": "^3.6.8",
44
44
  "rimraf": "^6.0.1",
45
- "@empiricalrun/llm": "^0.9.35",
45
+ "@empiricalrun/llm": "^0.9.36",
46
46
  "@empiricalrun/r2-uploader": "^0.3.8",
47
- "@empiricalrun/test-gen": "^0.47.1"
47
+ "@empiricalrun/test-gen": "^0.47.3"
48
48
  },
49
49
  "scripts": {
50
50
  "dev": "tsc --build --watch",