@empiricalrun/playwright-utils 0.8.2 → 0.8.4
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 +16 -0
- package/dist/captcha.js +6 -6
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @empiricalrun/playwright-utils
|
|
2
2
|
|
|
3
|
+
## 0.8.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- a851891: feat: remove need to crop image with sharp lib
|
|
8
|
+
- Updated dependencies [a851891]
|
|
9
|
+
- @empiricalrun/llm@0.8.3
|
|
10
|
+
|
|
11
|
+
## 0.8.3
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 08bb613: chore: bump up the llm package version for testing
|
|
16
|
+
- Updated dependencies [08bb613]
|
|
17
|
+
- @empiricalrun/llm@0.8.2
|
|
18
|
+
|
|
3
19
|
## 0.8.2
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/captcha.js
CHANGED
|
@@ -40,15 +40,15 @@ async function clickImageTile(frame, nth) {
|
|
|
40
40
|
await image.dispatchEvent("click");
|
|
41
41
|
}
|
|
42
42
|
async function handleCaptcha(cf) {
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
const screenshot = await cf.frame
|
|
44
|
+
.locator(".rc-imageselect-challenge")
|
|
45
|
+
.screenshot();
|
|
46
|
+
const gridBoxesToSelect = await (0, vision_1.solveRecaptchaGrid)({
|
|
46
47
|
captchaType: cf.type,
|
|
47
|
-
pageScreenshotBase64: screenshot.toString("base64"),
|
|
48
|
-
captchaBoundingBox: (await gridLocator.boundingBox()),
|
|
49
48
|
captchaObject: (await getObjectiveCaptcha(cf)),
|
|
49
|
+
screenshotBase64: screenshot.toString("base64"),
|
|
50
50
|
});
|
|
51
|
-
for (const n of
|
|
51
|
+
for (const n of gridBoxesToSelect) {
|
|
52
52
|
await clickImageTile(cf.frame, n - 1);
|
|
53
53
|
}
|
|
54
54
|
const verifyButton = cf.frame.getByRole("button", { name: "Verify" });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empiricalrun/playwright-utils",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.4",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -21,20 +21,11 @@
|
|
|
21
21
|
"url": "https://github.com/empirical-run/empirical.git"
|
|
22
22
|
},
|
|
23
23
|
"author": "Empirical Team <hey@empirical.run>",
|
|
24
|
-
"scripts": {
|
|
25
|
-
"dev": "tsc --build --watch",
|
|
26
|
-
"build": "tsc --build && node ./../../tools/static-env-vars.js dist",
|
|
27
|
-
"clean": "tsc --build --clean",
|
|
28
|
-
"lint": "eslint .",
|
|
29
|
-
"test": "vitest run",
|
|
30
|
-
"test:watch": "vitest"
|
|
31
|
-
},
|
|
32
24
|
"devDependencies": {
|
|
33
25
|
"@playwright/test": "^1.44.1",
|
|
34
26
|
"@types/node": "^20.14.9"
|
|
35
27
|
},
|
|
36
28
|
"dependencies": {
|
|
37
|
-
"@empiricalrun/llm": "workspace:^",
|
|
38
29
|
"@aws-sdk/client-s3": "^3.614.0",
|
|
39
30
|
"@aws-sdk/s3-request-presigner": "^3.614.0",
|
|
40
31
|
"@babel/code-frame": "^7.24.7",
|
|
@@ -44,6 +35,15 @@
|
|
|
44
35
|
"mailosaur": "^8.6.1",
|
|
45
36
|
"md5": "^2.3.0",
|
|
46
37
|
"mime": "3.0.0",
|
|
47
|
-
"playwright-core": "^1.46.1"
|
|
38
|
+
"playwright-core": "^1.46.1",
|
|
39
|
+
"@empiricalrun/llm": "^0.8.3"
|
|
40
|
+
},
|
|
41
|
+
"scripts": {
|
|
42
|
+
"dev": "tsc --build --watch",
|
|
43
|
+
"build": "tsc --build && node ./../../tools/static-env-vars.js dist",
|
|
44
|
+
"clean": "tsc --build --clean",
|
|
45
|
+
"lint": "eslint .",
|
|
46
|
+
"test": "vitest run",
|
|
47
|
+
"test:watch": "vitest"
|
|
48
48
|
}
|
|
49
49
|
}
|