@empiricalrun/playwright-utils 0.26.18 → 0.26.21

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,38 @@
1
1
  # @empiricalrun/playwright-utils
2
2
 
3
+ ## 0.26.21
4
+
5
+ ### Patch Changes
6
+
7
+ - f4e9032: feat: add helper method for sign-in with google
8
+
9
+ ## 0.26.20
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [82acf53]
14
+ - Updated dependencies [1177d63]
15
+ - Updated dependencies [73dd841]
16
+ - Updated dependencies [8233d49]
17
+ - Updated dependencies [0b55884]
18
+ - Updated dependencies [459d029]
19
+ - Updated dependencies [7712b2e]
20
+ - Updated dependencies [fb32af6]
21
+ - Updated dependencies [1b08d58]
22
+ - Updated dependencies [1b9087e]
23
+ - Updated dependencies [4623300]
24
+ - @empiricalrun/test-gen@0.65.0
25
+ - @empiricalrun/llm@0.18.0
26
+
27
+ ## 0.26.19
28
+
29
+ ### Patch Changes
30
+
31
+ - Updated dependencies [d8d624d]
32
+ - Updated dependencies [addd52e]
33
+ - Updated dependencies [f8a53b0]
34
+ - @empiricalrun/test-gen@0.64.3
35
+
3
36
  ## 0.26.18
4
37
 
5
38
  ### Patch Changes
@@ -0,0 +1,9 @@
1
+ import { Page } from "@playwright/test";
2
+ type GoogleCredentials = {
3
+ email: string;
4
+ password: string;
5
+ authKey: string;
6
+ };
7
+ export declare function loginToGoogle(page: Page, credentials: GoogleCredentials): Promise<void>;
8
+ export {};
9
+ //# sourceMappingURL=google.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"google.d.ts","sourceRoot":"","sources":["../../src/auth/google.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAGxC,KAAK,iBAAiB,GAAG;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,wBAAsB,aAAa,CACjC,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,iBAAiB,iBAyB/B"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.loginToGoogle = loginToGoogle;
7
+ const authenticator_1 = __importDefault(require("authenticator"));
8
+ async function loginToGoogle(page, credentials) {
9
+ // We are on the Google login page
10
+ const { email, password, authKey } = credentials;
11
+ await page.waitForTimeout(5_000);
12
+ await page.getByLabel("Email or phone").click();
13
+ await page.getByLabel("Email or phone").fill(email);
14
+ await page.waitForTimeout(5_000);
15
+ await page.getByLabel("Email or phone").press("Enter");
16
+ await page.getByLabel("Enter your password").click();
17
+ await page.getByLabel("Enter your password").fill(password);
18
+ await page.waitForTimeout(5_000);
19
+ await page.getByRole("button", { name: "Next" }).click();
20
+ await page.waitForTimeout(5_000);
21
+ const formattedToken = authenticator_1.default.generateToken(authKey);
22
+ await page.getByLabel("Enter code").click();
23
+ await page.getByLabel("Enter code").fill(formattedToken);
24
+ await page.waitForTimeout(5_000);
25
+ await page.getByRole("button", { name: "Next" }).click();
26
+ }
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from "./auth";
2
+ export * from "./auth/google";
2
3
  export { solveRecaptcha } from "./captcha";
3
4
  export { baseConfig, chromeStablePath, devices } from "./config";
4
5
  export * from "./email";
@@ -1 +1 @@
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,OAAO,EAAE,MAAM,UAAU,CAAC;AACjE,cAAc,SAAS,CAAC;AACxB,cAAc,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACjE,cAAc,SAAS,CAAC;AACxB,cAAc,yBAAyB,CAAC"}
package/dist/index.js CHANGED
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.devices = exports.chromeStablePath = exports.baseConfig = exports.solveRecaptcha = void 0;
18
18
  __exportStar(require("./auth"), exports);
19
+ __exportStar(require("./auth/google"), exports);
19
20
  var captcha_1 = require("./captcha");
20
21
  Object.defineProperty(exports, "solveRecaptcha", { enumerable: true, get: function () { return captcha_1.solveRecaptcha; } });
21
22
  var config_1 = require("./config");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empiricalrun/playwright-utils",
3
- "version": "0.26.18",
3
+ "version": "0.26.21",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"
@@ -24,6 +24,7 @@
24
24
  "devDependencies": {
25
25
  "@playwright/test": "1.47.1",
26
26
  "@types/async-retry": "^1.4.8",
27
+ "@types/authenticator": "^1.1.4",
27
28
  "@types/babel__code-frame": "^7.0.6",
28
29
  "@types/console-log-level": "^1.4.5",
29
30
  "@types/node": "^20.14.9",
@@ -34,13 +35,14 @@
34
35
  "dependencies": {
35
36
  "@babel/code-frame": "^7.24.7",
36
37
  "async-retry": "^1.3.3",
38
+ "authenticator": "^1.1.5",
37
39
  "console-log-level": "^1.4.1",
38
40
  "mailosaur": "^8.6.1",
39
41
  "puppeteer-extra-plugin-recaptcha": "^3.6.8",
40
42
  "rimraf": "^6.0.1",
41
- "@empiricalrun/llm": "^0.17.3",
43
+ "@empiricalrun/llm": "^0.18.0",
42
44
  "@empiricalrun/r2-uploader": "^0.3.9",
43
- "@empiricalrun/test-gen": "^0.64.2"
45
+ "@empiricalrun/test-gen": "^0.65.0"
44
46
  },
45
47
  "scripts": {
46
48
  "dev": "tsc --build --watch",
@@ -1 +1 @@
1
- {"root":["./src/config.ts","./src/email.ts","./src/index.ts","./src/logger.ts","./src/playwright-extensions.ts","./src/auth/index.ts","./src/auth/types.ts","./src/captcha/index.ts","./src/captcha/vision.ts","./src/devices/types.ts","./src/overlay-tests/cache.spec.ts","./src/overlay-tests/click.spec.ts","./src/overlay-tests/fixtures.ts","./src/overlay-tests/patch.spec.ts","./src/reporter/base.ts","./src/reporter/custom.ts","./src/reporter/queue.ts","./src/reporter/reporterV2.ts","./src/reporter/types.ts","./src/reporter/uploader.ts","./src/reporter/util.ts","./src/reporter/third_party/html-reporter-types.ts","./src/test/constants.ts","./src/test/expect.ts","./src/test/index.ts","./src/test/types.ts","./src/test/scripts/agent-capabilities.ts","./src/test/scripts/index.ts","./src/test/scripts/locator-highlights.ts","./src/test/scripts/locator-vision.ts","./src/test/scripts/mouse-pointer.ts","./src/test/scripts/types.ts","./src/test/scripts/pw-locator-patch/dismiss-overlays/cache.ts","./src/test/scripts/pw-locator-patch/dismiss-overlays/index.ts","./src/test/scripts/pw-locator-patch/dismiss-overlays/prompt.ts","./src/test/scripts/pw-locator-patch/dismiss-overlays/types.ts","./src/test/scripts/pw-locator-patch/dismiss-overlays/utils.ts","./src/test/scripts/pw-locator-patch/highlight/click.ts","./src/test/scripts/pw-locator-patch/highlight/expect.ts","./src/test/scripts/pw-locator-patch/highlight/hover.ts","./src/test/scripts/pw-locator-patch/highlight/inner-text.ts","./src/test/scripts/pw-locator-patch/highlight/input-value.ts","./src/test/scripts/pw-locator-patch/highlight/is-checked.ts","./src/test/scripts/pw-locator-patch/highlight/is-disabled.ts","./src/test/scripts/pw-locator-patch/highlight/is-editable.ts","./src/test/scripts/pw-locator-patch/highlight/text-content.ts","./src/test/scripts/pw-locator-patch/utils/index.ts","./src/test/scripts/pw-locator-patch/vision/query.ts"],"version":"5.8.3"}
1
+ {"root":["./src/config.ts","./src/email.ts","./src/index.ts","./src/logger.ts","./src/playwright-extensions.ts","./src/auth/google.ts","./src/auth/index.ts","./src/auth/types.ts","./src/captcha/index.ts","./src/captcha/vision.ts","./src/devices/types.ts","./src/overlay-tests/cache.spec.ts","./src/overlay-tests/click.spec.ts","./src/overlay-tests/fixtures.ts","./src/overlay-tests/patch.spec.ts","./src/reporter/base.ts","./src/reporter/custom.ts","./src/reporter/queue.ts","./src/reporter/reporterV2.ts","./src/reporter/types.ts","./src/reporter/uploader.ts","./src/reporter/util.ts","./src/reporter/third_party/html-reporter-types.ts","./src/test/constants.ts","./src/test/expect.ts","./src/test/index.ts","./src/test/types.ts","./src/test/scripts/agent-capabilities.ts","./src/test/scripts/index.ts","./src/test/scripts/locator-highlights.ts","./src/test/scripts/locator-vision.ts","./src/test/scripts/mouse-pointer.ts","./src/test/scripts/types.ts","./src/test/scripts/pw-locator-patch/dismiss-overlays/cache.ts","./src/test/scripts/pw-locator-patch/dismiss-overlays/index.ts","./src/test/scripts/pw-locator-patch/dismiss-overlays/prompt.ts","./src/test/scripts/pw-locator-patch/dismiss-overlays/types.ts","./src/test/scripts/pw-locator-patch/dismiss-overlays/utils.ts","./src/test/scripts/pw-locator-patch/highlight/click.ts","./src/test/scripts/pw-locator-patch/highlight/expect.ts","./src/test/scripts/pw-locator-patch/highlight/hover.ts","./src/test/scripts/pw-locator-patch/highlight/inner-text.ts","./src/test/scripts/pw-locator-patch/highlight/input-value.ts","./src/test/scripts/pw-locator-patch/highlight/is-checked.ts","./src/test/scripts/pw-locator-patch/highlight/is-disabled.ts","./src/test/scripts/pw-locator-patch/highlight/is-editable.ts","./src/test/scripts/pw-locator-patch/highlight/text-content.ts","./src/test/scripts/pw-locator-patch/utils/index.ts","./src/test/scripts/pw-locator-patch/vision/query.ts"],"version":"5.8.3"}