@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.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 = () => withCookieCache("google", this.page.context(), async () => {
17594
- if (isNil(process.env.GOOGLE_LOGIN_EMAIL) ||
17595
- isNil(process.env.GOOGLE_LOGIN_PASSWORD)) {
17596
- throw new Error("ENV variable GOOGLE_LOGIN_EMAIL or GOOGLE_LOGIN_PASSWORD is not properly configured");
17597
- }
17598
- await this.page.goto(THIRD_PARTY_ROUTES.google.signin, {
17599
- timeout: 20_000,
17600
- });
17601
- await this.page
17602
- .getByLabel(GOOGLE_LOGIN_TEXTS.emailOrPhone)
17603
- .pressSequentially(process.env.GOOGLE_LOGIN_EMAIL, { delay: 10 });
17604
- await this.page
17605
- .getByRole("button", { name: GOOGLE_LOGIN_TEXTS.next })
17606
- .click();
17607
- await this.page.waitForLoadState("load", { timeout: 25_000 });
17608
- await this.page.waitForURL(new RegExp(THIRD_PARTY_ROUTES.google.password));
17609
- await expect(this.page.getByText(GOOGLE_LOGIN_TEXTS.showPassword)).toBeVisible({ timeout: 10_000 });
17610
- await this.page
17611
- .getByLabel(GOOGLE_LOGIN_TEXTS.enterYourPassword)
17612
- .pressSequentially(process.env.GOOGLE_LOGIN_PASSWORD, {
17613
- delay: 10,
17614
- timeout: 20_000,
17615
- });
17616
- await this.page.getByLabel(GOOGLE_LOGIN_TEXTS.showPassword).click();
17617
- await this.page
17618
- .getByRole("button", { name: GOOGLE_LOGIN_TEXTS.next })
17619
- .click();
17620
- this.page
17621
- .url()
17622
- .includes(THIRD_PARTY_ROUTES.google.challengeSelection) &&
17623
- (await this.page
17624
- .locator(GOOGLE_LOGIN_SELECTORS.totpChallengeSelector)
17625
- .click());
17626
- await this.page.waitForLoadState("load", { timeout: 25_000 });
17627
- await this.page.waitForURL(new RegExp(THIRD_PARTY_ROUTES.google.totpChallenge));
17628
- await this.enterTotpCode();
17629
- await this.page.waitForLoadState("load", { timeout: 25_000 });
17630
- await this.page.waitForURL(new RegExp(THIRD_PARTY_ROUTES.google.myAccount));
17631
- }, ["google.com"]);
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 = () => withCookieCache("microsoft", this.page.context(), async () => {
119686
- if (isNil(process.env.MICROSOFT_LOGIN_EMAIL) ||
119687
- isNil(process.env.MICROSOFT_LOGIN_PASSWORD) ||
119688
- isNil(process.env.MICROSOFT_2FA_SECRET_KEY)) {
119689
- throw new Error("ENV variable MICROSOFT_LOGIN_EMAIL or MICROSOFT_LOGIN_PASSWORD or MICROSOFT_2FA_SECRET_KEY is not properly configured");
119690
- }
119691
- await this.page.goto(THIRD_PARTY_ROUTES.microsoft.login);
119692
- await this.enterEmail();
119693
- await this.page
119694
- .getByRole("button", { name: MICROSOFT_LOGIN_TEXTS.next })
119695
- .click();
119696
- await this.enterPassword();
119697
- await this.page
119698
- .getByRole("button", { name: MICROSOFT_LOGIN_TEXTS.signIn })
119699
- .click();
119700
- await this.page
119701
- .getByRole("button", {
119702
- name: MICROSOFT_LOGIN_TEXTS.useVerificationCode,
119703
- })
119704
- .click();
119705
- await this.enterTotpCode();
119706
- await this.staySignedIn();
119707
- }, ["microsoft.com", "live.com", "microsoftonline.com"]);
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,