@bigbinary/neeto-playwright-commons 3.3.6 → 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 CHANGED
@@ -119718,20 +119718,23 @@ class MicrosoftPage extends IntegrationBase {
119718
119718
  ramda.isNil(process.env.MICROSOFT_2FA_SECRET_KEY)) {
119719
119719
  throw new Error("ENV variable MICROSOFT_LOGIN_EMAIL or MICROSOFT_LOGIN_PASSWORD or MICROSOFT_2FA_SECRET_KEY is not properly configured");
119720
119720
  }
119721
+ const useVerificationCodeButton = this.page.getByRole("button", {
119722
+ name: MICROSOFT_LOGIN_TEXTS.useVerificationCode,
119723
+ });
119721
119724
  await this.page.goto(THIRD_PARTY_ROUTES.microsoft.login);
119722
119725
  await this.enterEmail();
119723
119726
  await this.page
119724
119727
  .getByRole("button", { name: MICROSOFT_LOGIN_TEXTS.next })
119725
119728
  .click();
119726
119729
  await this.enterPassword();
119727
- await this.page
119728
- .getByRole("button", { name: MICROSOFT_LOGIN_TEXTS.signIn })
119729
- .click();
119730
- await this.page
119731
- .getByRole("button", {
119732
- name: MICROSOFT_LOGIN_TEXTS.useVerificationCode,
119733
- })
119734
- .click();
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());
119735
119738
  await this.enterTotpCode();
119736
119739
  await this.staySignedIn();
119737
119740
  }, ["microsoft.com", "live.com", "microsoftonline.com"]);