@bigbinary/neeto-playwright-commons 3.3.5 → 3.3.7
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/index.cjs.js +75 -62
- package/index.cjs.js.map +1 -1
- package/index.js +75 -62
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -17611,45 +17611,49 @@ class GooglePage extends IntegrationBase {
|
|
|
17611
17611
|
.click();
|
|
17612
17612
|
await test.expect(signInHeading).toBeHidden({ timeout: 10_000 });
|
|
17613
17613
|
};
|
|
17614
|
-
loginToGoogle =
|
|
17615
|
-
if (
|
|
17616
|
-
|
|
17617
|
-
|
|
17618
|
-
|
|
17619
|
-
|
|
17620
|
-
|
|
17621
|
-
|
|
17622
|
-
|
|
17623
|
-
|
|
17624
|
-
|
|
17625
|
-
|
|
17626
|
-
|
|
17627
|
-
|
|
17628
|
-
|
|
17629
|
-
|
|
17630
|
-
|
|
17631
|
-
|
|
17632
|
-
.
|
|
17633
|
-
.
|
|
17634
|
-
|
|
17635
|
-
|
|
17636
|
-
|
|
17637
|
-
|
|
17638
|
-
|
|
17639
|
-
|
|
17640
|
-
.click();
|
|
17641
|
-
|
|
17642
|
-
|
|
17643
|
-
|
|
17644
|
-
|
|
17645
|
-
.
|
|
17646
|
-
.
|
|
17647
|
-
|
|
17648
|
-
|
|
17649
|
-
|
|
17650
|
-
|
|
17651
|
-
|
|
17652
|
-
|
|
17614
|
+
loginToGoogle = async () => {
|
|
17615
|
+
if (IS_DEV_ENV)
|
|
17616
|
+
return;
|
|
17617
|
+
return withCookieCache("google", this.page.context(), async () => {
|
|
17618
|
+
if (ramda.isNil(process.env.GOOGLE_LOGIN_EMAIL) ||
|
|
17619
|
+
ramda.isNil(process.env.GOOGLE_LOGIN_PASSWORD)) {
|
|
17620
|
+
throw new Error("ENV variable GOOGLE_LOGIN_EMAIL or GOOGLE_LOGIN_PASSWORD is not properly configured");
|
|
17621
|
+
}
|
|
17622
|
+
await this.page.goto(THIRD_PARTY_ROUTES.google.signin, {
|
|
17623
|
+
timeout: 20_000,
|
|
17624
|
+
});
|
|
17625
|
+
await this.page
|
|
17626
|
+
.getByLabel(GOOGLE_LOGIN_TEXTS.emailOrPhone)
|
|
17627
|
+
.pressSequentially(process.env.GOOGLE_LOGIN_EMAIL, { delay: 10 });
|
|
17628
|
+
await this.page
|
|
17629
|
+
.getByRole("button", { name: GOOGLE_LOGIN_TEXTS.next })
|
|
17630
|
+
.click();
|
|
17631
|
+
await this.page.waitForLoadState("load", { timeout: 25_000 });
|
|
17632
|
+
await this.page.waitForURL(new RegExp(THIRD_PARTY_ROUTES.google.password));
|
|
17633
|
+
await test.expect(this.page.getByText(GOOGLE_LOGIN_TEXTS.showPassword)).toBeVisible({ timeout: 10_000 });
|
|
17634
|
+
await this.page
|
|
17635
|
+
.getByLabel(GOOGLE_LOGIN_TEXTS.enterYourPassword)
|
|
17636
|
+
.pressSequentially(process.env.GOOGLE_LOGIN_PASSWORD, {
|
|
17637
|
+
delay: 10,
|
|
17638
|
+
timeout: 20_000,
|
|
17639
|
+
});
|
|
17640
|
+
await this.page.getByLabel(GOOGLE_LOGIN_TEXTS.showPassword).click();
|
|
17641
|
+
await this.page
|
|
17642
|
+
.getByRole("button", { name: GOOGLE_LOGIN_TEXTS.next })
|
|
17643
|
+
.click();
|
|
17644
|
+
this.page
|
|
17645
|
+
.url()
|
|
17646
|
+
.includes(THIRD_PARTY_ROUTES.google.challengeSelection) &&
|
|
17647
|
+
(await this.page
|
|
17648
|
+
.locator(GOOGLE_LOGIN_SELECTORS.totpChallengeSelector)
|
|
17649
|
+
.click());
|
|
17650
|
+
await this.page.waitForLoadState("load", { timeout: 25_000 });
|
|
17651
|
+
await this.page.waitForURL(new RegExp(THIRD_PARTY_ROUTES.google.totpChallenge));
|
|
17652
|
+
await this.enterTotpCode();
|
|
17653
|
+
await this.page.waitForLoadState("load", { timeout: 25_000 });
|
|
17654
|
+
await this.page.waitForURL(new RegExp(THIRD_PARTY_ROUTES.google.myAccount));
|
|
17655
|
+
}, ["google.com"]);
|
|
17656
|
+
};
|
|
17653
17657
|
enterTotpCode = async () => {
|
|
17654
17658
|
let previousToken = null;
|
|
17655
17659
|
const codeInput = this.page.getByLabel(GOOGLE_LOGIN_TEXTS.enterCode);
|
|
@@ -17678,6 +17682,8 @@ class GooglePage extends IntegrationBase {
|
|
|
17678
17682
|
}).toPass({ timeout: 2 * 60 * 1000 });
|
|
17679
17683
|
};
|
|
17680
17684
|
logoutFromGoogle = async () => {
|
|
17685
|
+
if (IS_DEV_ENV)
|
|
17686
|
+
return;
|
|
17681
17687
|
await this.page.goto(THIRD_PARTY_ROUTES.google.myAccount, {
|
|
17682
17688
|
timeout: 20_000,
|
|
17683
17689
|
});
|
|
@@ -119703,29 +119709,36 @@ class MicrosoftPage extends IntegrationBase {
|
|
|
119703
119709
|
}))
|
|
119704
119710
|
.pressSequentially(process.env.MICROSOFT_LOGIN_PASSWORD, { delay: 15 });
|
|
119705
119711
|
};
|
|
119706
|
-
loginToMicrosoft =
|
|
119707
|
-
if (
|
|
119708
|
-
|
|
119709
|
-
|
|
119710
|
-
|
|
119711
|
-
|
|
119712
|
-
|
|
119713
|
-
|
|
119714
|
-
|
|
119715
|
-
.getByRole("button", {
|
|
119716
|
-
|
|
119717
|
-
|
|
119718
|
-
|
|
119719
|
-
.
|
|
119720
|
-
.
|
|
119721
|
-
|
|
119722
|
-
|
|
119723
|
-
|
|
119724
|
-
|
|
119725
|
-
|
|
119726
|
-
|
|
119727
|
-
|
|
119728
|
-
|
|
119712
|
+
loginToMicrosoft = async () => {
|
|
119713
|
+
if (IS_DEV_ENV)
|
|
119714
|
+
return;
|
|
119715
|
+
return withCookieCache("microsoft", this.page.context(), async () => {
|
|
119716
|
+
if (ramda.isNil(process.env.MICROSOFT_LOGIN_EMAIL) ||
|
|
119717
|
+
ramda.isNil(process.env.MICROSOFT_LOGIN_PASSWORD) ||
|
|
119718
|
+
ramda.isNil(process.env.MICROSOFT_2FA_SECRET_KEY)) {
|
|
119719
|
+
throw new Error("ENV variable MICROSOFT_LOGIN_EMAIL or MICROSOFT_LOGIN_PASSWORD or MICROSOFT_2FA_SECRET_KEY is not properly configured");
|
|
119720
|
+
}
|
|
119721
|
+
const useVerificationCodeButton = this.page.getByRole("button", {
|
|
119722
|
+
name: MICROSOFT_LOGIN_TEXTS.useVerificationCode,
|
|
119723
|
+
});
|
|
119724
|
+
await this.page.goto(THIRD_PARTY_ROUTES.microsoft.login);
|
|
119725
|
+
await this.enterEmail();
|
|
119726
|
+
await this.page
|
|
119727
|
+
.getByRole("button", { name: MICROSOFT_LOGIN_TEXTS.next })
|
|
119728
|
+
.click();
|
|
119729
|
+
await this.enterPassword();
|
|
119730
|
+
const signInButton = this.page.getByRole("button", {
|
|
119731
|
+
name: MICROSOFT_LOGIN_TEXTS.signIn,
|
|
119732
|
+
});
|
|
119733
|
+
await signInButton.click();
|
|
119734
|
+
await test.expect(signInButton).toBeHidden({ timeout: 10_000 });
|
|
119735
|
+
await this.page.waitForLoadState("load", { timeout: 25_000 });
|
|
119736
|
+
(await useVerificationCodeButton.isVisible({ timeout: 20_000 })) &&
|
|
119737
|
+
(await useVerificationCodeButton.click());
|
|
119738
|
+
await this.enterTotpCode();
|
|
119739
|
+
await this.staySignedIn();
|
|
119740
|
+
}, ["microsoft.com", "live.com", "microsoftonline.com"]);
|
|
119741
|
+
};
|
|
119729
119742
|
enterTotpCode = async () => {
|
|
119730
119743
|
const verifyBtn = this.page.getByRole("button", {
|
|
119731
119744
|
name: MICROSOFT_LOGIN_TEXTS.verify,
|