@bigbinary/neeto-playwright-commons 3.3.5 → 3.3.6
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 +72 -62
- package/index.cjs.js.map +1 -1
- package/index.js +72 -62
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -17590,45 +17590,49 @@ class GooglePage extends IntegrationBase {
|
|
|
17590
17590
|
.click();
|
|
17591
17591
|
await expect(signInHeading).toBeHidden({ timeout: 10_000 });
|
|
17592
17592
|
};
|
|
17593
|
-
loginToGoogle =
|
|
17594
|
-
if (
|
|
17595
|
-
|
|
17596
|
-
|
|
17597
|
-
|
|
17598
|
-
|
|
17599
|
-
|
|
17600
|
-
|
|
17601
|
-
|
|
17602
|
-
|
|
17603
|
-
|
|
17604
|
-
|
|
17605
|
-
|
|
17606
|
-
|
|
17607
|
-
|
|
17608
|
-
|
|
17609
|
-
|
|
17610
|
-
|
|
17611
|
-
.
|
|
17612
|
-
.
|
|
17613
|
-
|
|
17614
|
-
|
|
17615
|
-
|
|
17616
|
-
|
|
17617
|
-
|
|
17618
|
-
|
|
17619
|
-
.click();
|
|
17620
|
-
|
|
17621
|
-
|
|
17622
|
-
|
|
17623
|
-
|
|
17624
|
-
.
|
|
17625
|
-
.
|
|
17626
|
-
|
|
17627
|
-
|
|
17628
|
-
|
|
17629
|
-
|
|
17630
|
-
|
|
17631
|
-
|
|
17593
|
+
loginToGoogle = async () => {
|
|
17594
|
+
if (IS_DEV_ENV)
|
|
17595
|
+
return;
|
|
17596
|
+
return withCookieCache("google", this.page.context(), async () => {
|
|
17597
|
+
if (isNil(process.env.GOOGLE_LOGIN_EMAIL) ||
|
|
17598
|
+
isNil(process.env.GOOGLE_LOGIN_PASSWORD)) {
|
|
17599
|
+
throw new Error("ENV variable GOOGLE_LOGIN_EMAIL or GOOGLE_LOGIN_PASSWORD is not properly configured");
|
|
17600
|
+
}
|
|
17601
|
+
await this.page.goto(THIRD_PARTY_ROUTES.google.signin, {
|
|
17602
|
+
timeout: 20_000,
|
|
17603
|
+
});
|
|
17604
|
+
await this.page
|
|
17605
|
+
.getByLabel(GOOGLE_LOGIN_TEXTS.emailOrPhone)
|
|
17606
|
+
.pressSequentially(process.env.GOOGLE_LOGIN_EMAIL, { delay: 10 });
|
|
17607
|
+
await this.page
|
|
17608
|
+
.getByRole("button", { name: GOOGLE_LOGIN_TEXTS.next })
|
|
17609
|
+
.click();
|
|
17610
|
+
await this.page.waitForLoadState("load", { timeout: 25_000 });
|
|
17611
|
+
await this.page.waitForURL(new RegExp(THIRD_PARTY_ROUTES.google.password));
|
|
17612
|
+
await expect(this.page.getByText(GOOGLE_LOGIN_TEXTS.showPassword)).toBeVisible({ timeout: 10_000 });
|
|
17613
|
+
await this.page
|
|
17614
|
+
.getByLabel(GOOGLE_LOGIN_TEXTS.enterYourPassword)
|
|
17615
|
+
.pressSequentially(process.env.GOOGLE_LOGIN_PASSWORD, {
|
|
17616
|
+
delay: 10,
|
|
17617
|
+
timeout: 20_000,
|
|
17618
|
+
});
|
|
17619
|
+
await this.page.getByLabel(GOOGLE_LOGIN_TEXTS.showPassword).click();
|
|
17620
|
+
await this.page
|
|
17621
|
+
.getByRole("button", { name: GOOGLE_LOGIN_TEXTS.next })
|
|
17622
|
+
.click();
|
|
17623
|
+
this.page
|
|
17624
|
+
.url()
|
|
17625
|
+
.includes(THIRD_PARTY_ROUTES.google.challengeSelection) &&
|
|
17626
|
+
(await this.page
|
|
17627
|
+
.locator(GOOGLE_LOGIN_SELECTORS.totpChallengeSelector)
|
|
17628
|
+
.click());
|
|
17629
|
+
await this.page.waitForLoadState("load", { timeout: 25_000 });
|
|
17630
|
+
await this.page.waitForURL(new RegExp(THIRD_PARTY_ROUTES.google.totpChallenge));
|
|
17631
|
+
await this.enterTotpCode();
|
|
17632
|
+
await this.page.waitForLoadState("load", { timeout: 25_000 });
|
|
17633
|
+
await this.page.waitForURL(new RegExp(THIRD_PARTY_ROUTES.google.myAccount));
|
|
17634
|
+
}, ["google.com"]);
|
|
17635
|
+
};
|
|
17632
17636
|
enterTotpCode = async () => {
|
|
17633
17637
|
let previousToken = null;
|
|
17634
17638
|
const codeInput = this.page.getByLabel(GOOGLE_LOGIN_TEXTS.enterCode);
|
|
@@ -17657,6 +17661,8 @@ class GooglePage extends IntegrationBase {
|
|
|
17657
17661
|
}).toPass({ timeout: 2 * 60 * 1000 });
|
|
17658
17662
|
};
|
|
17659
17663
|
logoutFromGoogle = async () => {
|
|
17664
|
+
if (IS_DEV_ENV)
|
|
17665
|
+
return;
|
|
17660
17666
|
await this.page.goto(THIRD_PARTY_ROUTES.google.myAccount, {
|
|
17661
17667
|
timeout: 20_000,
|
|
17662
17668
|
});
|
|
@@ -119682,29 +119688,33 @@ class MicrosoftPage extends IntegrationBase {
|
|
|
119682
119688
|
}))
|
|
119683
119689
|
.pressSequentially(process.env.MICROSOFT_LOGIN_PASSWORD, { delay: 15 });
|
|
119684
119690
|
};
|
|
119685
|
-
loginToMicrosoft =
|
|
119686
|
-
if (
|
|
119687
|
-
|
|
119688
|
-
|
|
119689
|
-
|
|
119690
|
-
|
|
119691
|
-
|
|
119692
|
-
|
|
119693
|
-
|
|
119694
|
-
.
|
|
119695
|
-
.
|
|
119696
|
-
|
|
119697
|
-
|
|
119698
|
-
|
|
119699
|
-
.
|
|
119700
|
-
|
|
119701
|
-
|
|
119702
|
-
|
|
119703
|
-
|
|
119704
|
-
|
|
119705
|
-
|
|
119706
|
-
|
|
119707
|
-
|
|
119691
|
+
loginToMicrosoft = async () => {
|
|
119692
|
+
if (IS_DEV_ENV)
|
|
119693
|
+
return;
|
|
119694
|
+
return withCookieCache("microsoft", this.page.context(), async () => {
|
|
119695
|
+
if (isNil(process.env.MICROSOFT_LOGIN_EMAIL) ||
|
|
119696
|
+
isNil(process.env.MICROSOFT_LOGIN_PASSWORD) ||
|
|
119697
|
+
isNil(process.env.MICROSOFT_2FA_SECRET_KEY)) {
|
|
119698
|
+
throw new Error("ENV variable MICROSOFT_LOGIN_EMAIL or MICROSOFT_LOGIN_PASSWORD or MICROSOFT_2FA_SECRET_KEY is not properly configured");
|
|
119699
|
+
}
|
|
119700
|
+
await this.page.goto(THIRD_PARTY_ROUTES.microsoft.login);
|
|
119701
|
+
await this.enterEmail();
|
|
119702
|
+
await this.page
|
|
119703
|
+
.getByRole("button", { name: MICROSOFT_LOGIN_TEXTS.next })
|
|
119704
|
+
.click();
|
|
119705
|
+
await this.enterPassword();
|
|
119706
|
+
await this.page
|
|
119707
|
+
.getByRole("button", { name: MICROSOFT_LOGIN_TEXTS.signIn })
|
|
119708
|
+
.click();
|
|
119709
|
+
await this.page
|
|
119710
|
+
.getByRole("button", {
|
|
119711
|
+
name: MICROSOFT_LOGIN_TEXTS.useVerificationCode,
|
|
119712
|
+
})
|
|
119713
|
+
.click();
|
|
119714
|
+
await this.enterTotpCode();
|
|
119715
|
+
await this.staySignedIn();
|
|
119716
|
+
}, ["microsoft.com", "live.com", "microsoftonline.com"]);
|
|
119717
|
+
};
|
|
119708
119718
|
enterTotpCode = async () => {
|
|
119709
119719
|
const verifyBtn = this.page.getByRole("button", {
|
|
119710
119720
|
name: MICROSOFT_LOGIN_TEXTS.verify,
|