@bigbinary/neeto-playwright-commons 3.3.1 → 3.3.3

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
@@ -1914,7 +1914,7 @@ const MICROSOFT_LOGIN_SELECTORS = {
1914
1914
  signInProfileIcon: "#mectrl_headerPicture",
1915
1915
  emailInput: '[type="email"]',
1916
1916
  placeholder: ".placeholderInnerContainer",
1917
- dropdownMenu: "button[aria-label='NeetoForm - Stagingapp context menu']",
1917
+ dropdownMenu: (appName) => `button[aria-label='${appName}app']`,
1918
1918
  };
1919
1919
 
1920
1920
  const mimeTypeMap = {
@@ -2428,6 +2428,10 @@ const MICROSOFT_LOGIN_TEXTS = {
2428
2428
  permissionsRequested: "Permissions requested",
2429
2429
  yes: "Yes",
2430
2430
  remove: "Remove",
2431
+ manageYourApplication: "Manage your application",
2432
+ revokeConsent: "Revoke consent",
2433
+ useVerificationCode: "Use a verification code",
2434
+ successfullyRevokedConsent: "Successfully revoked consent",
2431
2435
  };
2432
2436
  const GOOGLE_LOGIN_TEXTS = {
2433
2437
  googleAccount: "Google Account:",
@@ -119714,6 +119718,11 @@ class MicrosoftPage extends IntegrationBase {
119714
119718
  await this.page
119715
119719
  .getByRole("button", { name: MICROSOFT_LOGIN_TEXTS.signIn })
119716
119720
  .click();
119721
+ await this.page
119722
+ .getByRole("button", {
119723
+ name: MICROSOFT_LOGIN_TEXTS.useVerificationCode,
119724
+ })
119725
+ .click();
119717
119726
  await this.enterTotpCode();
119718
119727
  await this.staySignedIn();
119719
119728
  }, ["microsoft.com", "live.com", "microsoftonline.com"]);
@@ -119742,15 +119751,20 @@ class MicrosoftPage extends IntegrationBase {
119742
119751
  await test.expect(acceptBtn).toBeHidden({ timeout: 10_000 });
119743
119752
  await this.page.waitForLoadState("load", { timeout: 50_000 });
119744
119753
  };
119745
- revokePermissions = async () => {
119754
+ revokePermissions = async (appName = "NeetoForm - Staging") => {
119746
119755
  await this.page.goto(THIRD_PARTY_ROUTES.microsoft.myApps);
119747
119756
  await this.page.waitForLoadState("load", { timeout: 25_000 });
119748
- const dropdown = this.page.locator(MICROSOFT_LOGIN_SELECTORS.dropdownMenu);
119757
+ const dropdown = this.page.locator(MICROSOFT_LOGIN_SELECTORS.dropdownMenu(appName));
119749
119758
  await dropdown.click();
119750
119759
  await this.page
119751
- .getByRole("menuitem", { name: MICROSOFT_LOGIN_TEXTS.remove })
119760
+ .getByRole("menuitem", {
119761
+ name: MICROSOFT_LOGIN_TEXTS.manageYourApplication,
119762
+ })
119763
+ .click();
119764
+ await this.page
119765
+ .getByRole("button", { name: MICROSOFT_LOGIN_TEXTS.revokeConsent })
119752
119766
  .click();
119753
- await test.expect(dropdown).toBeHidden({ timeout: 10_000 });
119767
+ await test.expect(this.page.getByText(MICROSOFT_LOGIN_TEXTS.successfullyRevokedConsent)).toBeVisible({ timeout: 10_000 });
119754
119768
  await this.page.waitForLoadState("load", { timeout: 25_000 });
119755
119769
  };
119756
119770
  }