@empiricalrun/playwright-utils 0.19.6 → 0.19.8
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 +13 -0
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +9 -12
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @empiricalrun/playwright-utils
|
|
2
2
|
|
|
3
|
+
## 0.19.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- e851b52: fix: exception handling for login state checker
|
|
8
|
+
|
|
9
|
+
## 0.19.7
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [86e5a4c]
|
|
14
|
+
- @empiricalrun/test-gen@0.42.0
|
|
15
|
+
|
|
3
16
|
## 0.19.6
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/auth/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAIvD,KAAK,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtC,KAAK,OAAO,GAAG,SAAS,GAAG,kBAAkB,CAAC;AAE9C,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,QAAQ,GAAG,cAAc,CAAC;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,qBAAa,SAAS,CAAC,CAAC,SAAS,OAAO,CAAC,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 = __importDefault(require("fs"));
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
|
-
const playwright_core_1 = require("playwright-core");
|
|
10
9
|
class AuthStore {
|
|
11
10
|
appType;
|
|
12
11
|
page;
|
|
@@ -33,22 +32,20 @@ class AuthStore {
|
|
|
33
32
|
else {
|
|
34
33
|
const page = await this.newPageWithAuthState(this.page, storagePath);
|
|
35
34
|
try {
|
|
36
|
-
const
|
|
37
|
-
if (
|
|
38
|
-
|
|
35
|
+
const methodResult = await this.checkLoggedInFunc(page, this.userContext);
|
|
36
|
+
if (methodResult) {
|
|
37
|
+
// Continue rest of the test flow with the existing page
|
|
38
|
+
// where we have loaded the auth state
|
|
39
|
+
loggedInPage = page;
|
|
39
40
|
}
|
|
40
41
|
else {
|
|
41
|
-
|
|
42
|
+
await page.close();
|
|
42
43
|
}
|
|
43
|
-
shouldDoLogin = !
|
|
44
|
+
shouldDoLogin = !methodResult;
|
|
44
45
|
}
|
|
45
46
|
catch (err) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
throw err;
|
|
51
|
-
}
|
|
47
|
+
shouldDoLogin = true;
|
|
48
|
+
await page.close();
|
|
52
49
|
}
|
|
53
50
|
}
|
|
54
51
|
if (shouldDoLogin) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empiricalrun/playwright-utils",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.8",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"playwright-core": "1.49.1",
|
|
41
41
|
"puppeteer-extra-plugin-recaptcha": "^3.6.8",
|
|
42
42
|
"rimraf": "^6.0.1",
|
|
43
|
-
"@empiricalrun/
|
|
44
|
-
"@empiricalrun/
|
|
45
|
-
"@empiricalrun/
|
|
43
|
+
"@empiricalrun/llm": "^0.9.29",
|
|
44
|
+
"@empiricalrun/test-gen": "^0.42.0",
|
|
45
|
+
"@empiricalrun/r2-uploader": "^0.3.8"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
48
|
"dev": "tsc --build --watch",
|