@empiricalrun/playwright-utils 0.14.0 → 0.14.2

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,17 @@
1
1
  # @empiricalrun/playwright-utils
2
2
 
3
+ ## 0.14.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 271e80b: fix: auth utils export
8
+
9
+ ## 0.14.1
10
+
11
+ ### Patch Changes
12
+
13
+ - 1227ffc: fix: auth should login only if the error is from playwright
14
+
3
15
  ## 0.14.0
4
16
 
5
17
  ### Minor Changes
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,KAAK,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtC,qBAAa,SAAS,CAAC,CAAC,SAAS,OAAO,CAAC,EAAE,CAAC;IAExC,OAAO,CAAC,IAAI;IACZ,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,iBAAiB;gBAHjB,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,CAAC,EACd,SAAS,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,EACxD,iBAAiB,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC;IAGvE,eAAe;IAoBrB,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM;CAGtD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE/C,KAAK,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtC,qBAAa,SAAS,CAAC,CAAC,SAAS,OAAO,CAAC,EAAE,CAAC;IAExC,OAAO,CAAC,IAAI;IACZ,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,iBAAiB;gBAHjB,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,CAAC,EACd,SAAS,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,EACxD,iBAAiB,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC;IAGvE,eAAe;IAwBrB,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM;CAGtD"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AuthStore = void 0;
4
+ const playwright_core_1 = require("playwright-core");
4
5
  class AuthStore {
5
6
  page;
6
7
  userContext;
@@ -18,8 +19,13 @@ class AuthStore {
18
19
  const hasLoggedIn = await this.checkLoggedInFunc(this.page, this.userContext);
19
20
  shouldDoLogin = !hasLoggedIn;
20
21
  }
21
- catch (e) {
22
- shouldDoLogin = true;
22
+ catch (err) {
23
+ if (err instanceof playwright_core_1.errors.TimeoutError) {
24
+ shouldDoLogin = true;
25
+ }
26
+ else {
27
+ throw err;
28
+ }
23
29
  }
24
30
  if (shouldDoLogin) {
25
31
  await this.loginFunc(this.page, this.userContext);
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from "./auth";
1
2
  export { solveRecaptcha } from "./captcha";
2
3
  export { baseConfig, chromeStablePath } from "./config";
3
4
  export * from "./email";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACxD,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACxD,cAAc,SAAS,CAAC"}
package/dist/index.js CHANGED
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.chromeStablePath = exports.baseConfig = exports.solveRecaptcha = void 0;
18
+ __exportStar(require("./auth"), exports);
18
19
  var captcha_1 = require("./captcha");
19
20
  Object.defineProperty(exports, "solveRecaptcha", { enumerable: true, get: function () { return captcha_1.solveRecaptcha; } });
20
21
  var config_1 = require("./config");
package/docs/auth.md CHANGED
@@ -28,9 +28,7 @@ setup("login to application", async ({ page, userContext }) => {
28
28
  return postLoginElement.isVisible();
29
29
  }
30
30
  );
31
-
32
31
  await auth.loginIfRequired();
33
- await page.context().storageState({ path: authFile });
34
32
  });
35
33
  ```
36
34
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empiricalrun/playwright-utils",
3
- "version": "0.14.0",
3
+ "version": "0.14.2",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"