@empiricalrun/playwright-utils 0.20.12 → 0.20.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
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @empiricalrun/playwright-utils
|
|
2
2
|
|
|
3
|
+
## 0.20.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [04db1a6]
|
|
8
|
+
- Updated dependencies [1b1815d]
|
|
9
|
+
- Updated dependencies [62800d7]
|
|
10
|
+
- @empiricalrun/test-gen@0.45.1
|
|
11
|
+
|
|
12
|
+
## 0.20.13
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- 27ddfd8: test: add failing test for productfruits
|
|
17
|
+
- f524620: fix: product fruits tooltip auto dismissal
|
|
18
|
+
- 0359471: test: fill form to dismiss overlay
|
|
19
|
+
|
|
3
20
|
## 0.20.12
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -107,3 +107,13 @@ test_1.test.fail("should return from master agent planner", async ({ page }) =>
|
|
|
107
107
|
// Deliberately click on a button that doesn't exist
|
|
108
108
|
await page.getByRole("button", { name: "Bottom Button" }).click();
|
|
109
109
|
});
|
|
110
|
+
(0, test_1.test)("should be able to pass through pf overlay", async ({ page }) => {
|
|
111
|
+
await page.goto(`http://localhost:${PORT}/productfruits.html`);
|
|
112
|
+
await page.locator("#sidebar-menu").getByText("Customise UI").click();
|
|
113
|
+
await (0, test_1.expect)(page.getByText("This is the Customise UI page")).toBeVisible();
|
|
114
|
+
});
|
|
115
|
+
test_1.test.skip("should be able to fill form and dismiss overlay", async ({ page, }) => {
|
|
116
|
+
await page.goto(`http://localhost:${PORT}/overlay-form.html`);
|
|
117
|
+
await page.getByRole("button", { name: "Target" }).click();
|
|
118
|
+
await (0, test_1.expect)(page.getByText("Target was clicked")).toBeVisible();
|
|
119
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"click.d.ts","sourceRoot":"","sources":["../../../../../src/test/scripts/pw-locator-patch/highlight/click.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAQ,MAAM,kBAAkB,CAAC;AAEtD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AA8BrC,KAAK,cAAc,GAAG;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5B,CAAC;AAEF,wBAAgB,0BAA0B,CACxC,YAAY,EAAE,MAAM,GACnB,cAAc,GAAG,SAAS,CAiC5B;
|
|
1
|
+
{"version":3,"file":"click.d.ts","sourceRoot":"","sources":["../../../../../src/test/scripts/pw-locator-patch/highlight/click.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAQ,MAAM,kBAAkB,CAAC;AAEtD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AA8BrC,KAAK,cAAc,GAAG;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5B,CAAC;AAEF,wBAAgB,0BAA0B,CACxC,YAAY,EAAE,MAAM,GACnB,cAAc,GAAG,SAAS,CAiC5B;AAkHD,wBAAgB,UAAU,CACxB,YAAY,EAAE,QAAQ,GAAG;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,EAC/C,MAAM,EAAE,MAAM,QA+Df"}
|
|
@@ -117,6 +117,10 @@ async function textContent(pageRef, element) {
|
|
|
117
117
|
}, [startTag, endTag]);
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
+
function isProductFruitsOverlay(element) {
|
|
121
|
+
return (element?.parent?.includes("productfruits--container") ||
|
|
122
|
+
element?.interceptor.includes("productfruits--container"));
|
|
123
|
+
}
|
|
120
124
|
async function runAgentOnOverlay(pageRef, element) {
|
|
121
125
|
const content = await textContent(pageRef, element);
|
|
122
126
|
const promptAddition = content
|
|
@@ -124,13 +128,29 @@ async function runAgentOnOverlay(pageRef, element) {
|
|
|
124
128
|
The popup can be identified with its text content:
|
|
125
129
|
${content}`
|
|
126
130
|
: ``;
|
|
127
|
-
|
|
128
|
-
|
|
131
|
+
let task = isProductFruitsOverlay(element)
|
|
132
|
+
? `
|
|
133
|
+
We are attempting to do a click action on Target element.
|
|
134
|
+
|
|
135
|
+
This action is failing because our Target element is covered with another element (called Overlapper).
|
|
136
|
+
|
|
137
|
+
The Overlapper element can be identifed with the following text content:
|
|
138
|
+
|
|
139
|
+
<overlapper_element_text_content>
|
|
140
|
+
${content}
|
|
141
|
+
</overlapper_element_text_content>
|
|
142
|
+
|
|
143
|
+
The only way to work around this is to Click on any other sidebar link element.
|
|
144
|
+
|
|
145
|
+
Don't reattempt the click on Target element, your job is done after the first click.
|
|
146
|
+
`
|
|
147
|
+
: `
|
|
129
148
|
Find a way to dismiss the popup. If the popup is non dismissible or there is no popup then return immediately.
|
|
130
149
|
Also note that you just need to dismiss popup and do nothing else.
|
|
131
150
|
|
|
132
|
-
${promptAddition}
|
|
133
|
-
|
|
151
|
+
${promptAddition}`;
|
|
152
|
+
await (0, run_1.createTestUsingMasterAgent)({
|
|
153
|
+
task,
|
|
134
154
|
page: pageRef,
|
|
135
155
|
options: {
|
|
136
156
|
useActionSpecificAnnotations: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empiricalrun/playwright-utils",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.14",
|
|
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/r2-uploader": "^0.3.8",
|
|
46
45
|
"@empiricalrun/llm": "^0.9.35",
|
|
47
|
-
"@empiricalrun/
|
|
46
|
+
"@empiricalrun/r2-uploader": "^0.3.8",
|
|
47
|
+
"@empiricalrun/test-gen": "^0.45.1"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"dev": "tsc --build --watch",
|