@bigbinary/neeto-playwright-commons 1.20.5 → 1.21.0

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
@@ -245,6 +245,7 @@ const CREDENTIALS = {
245
245
  };
246
246
  const OTP_EMAIL_PATTERN = "is your login code";
247
247
  const SLACK_DEFAULT_CHANNEL = "general";
248
+ const CUSTOM_DOMAIN_SUFFIX = "aceinvoice.com";
248
249
  const ZAPIER_TEST_EMAIL = (product) => `neeto-${product}-zapier-test@${process.env.FASTMAIL_DOMAIN_NAME}`;
249
250
  // constants for translation
250
251
  const SINGULAR = { count: 1 };
@@ -341,6 +342,11 @@ const skipTest = {
341
342
  },
342
343
  };
343
344
  const shouldSkipSetupAndTeardown = () => { var _a; return ((_a = getGlobalUserState()) === null || _a === void 0 ? void 0 : _a.isLoggedIn) && process.env.SKIP_SETUP === "true"; };
345
+ const shouldSkipCustomDomainSetup = () => process.env.SETUP_CUSTOM_DOMAIN !== "true" || !IS_STAGING_ENV;
346
+ const baseURLGenerator = (product, customSubdomain) => {
347
+ const { subdomainName } = getGlobalUserState();
348
+ return `https://${customSubdomain !== null && customSubdomain !== void 0 ? customSubdomain : subdomainName}.neeto${product.toLowerCase()}.net`;
349
+ };
344
350
  // trims and replaces multiple whitespace characters in a string with a single space
345
351
  const squish = (text) => text.trim().replace(/\s+/g, " ");
346
352
  const toCamelCase = (string) => string.toLowerCase().replace(/( \w)/g, letter => letter[1].toUpperCase());
@@ -360,6 +366,20 @@ const getListCount = async ({ page, countSelector, }) => {
360
366
  };
361
367
  const getGlobalUserProps = async (page) => (await page.evaluate(() => window.globalProps.user));
362
368
  const getClipboardContent = (page) => page.evaluate(() => navigator.clipboard.readText());
369
+ const globalShortcuts = (t) => [
370
+ {
371
+ description: t("neetoMolecules.keyboardShortcuts.global.openKeyboardShortcutsPane"),
372
+ sequence: "shift+/",
373
+ },
374
+ {
375
+ description: t("neetoMolecules.keyboardShortcuts.global.close"),
376
+ sequence: "esc",
377
+ },
378
+ {
379
+ description: t("neetoMolecules.keyboardShortcuts.global.submitForm"),
380
+ sequence: "ctrl+enter",
381
+ },
382
+ ];
363
383
 
364
384
  const optionSelector = (option) => `neeto-editor-fixed-menu-${option}-option`;
365
385
  const fixedMenuSelector = (selector) => `neeto-editor-fixed-menu-${selector}`;
@@ -827,6 +847,7 @@ const CUSTOM_DOMAIN_SELECTORS = {
827
847
  editCustomDomainButton: "edit-custom-domain-button",
828
848
  deleteCustomDomainButton: "delete-custom-domain-button",
829
849
  dropdownButton: "custom-domains-more-dropdown-button",
850
+ activeTagContainer: "active-tag-container",
830
851
  };
831
852
  const API_KEYS_SELECTORS = {
832
853
  editApiKeyButton: "api-key-edit-button",
@@ -188535,12 +188556,12 @@ class ThankYouPage {
188535
188556
  class EmbedBase {
188536
188557
  constructor({ context, page, neetoPlaywrightUtilities, appName, }) {
188537
188558
  /**
188538
- * @deprecated This method is deprecated. Use initializeEmbedPageV2 instead.
188559
+ * @deprecated This method is deprecated. Use initializeEmbedPage instead.
188539
188560
  */
188540
- this.initializeEmbedPage = async ({ embedType, embedCode, customElementText = "Click here", }) => {
188561
+ this.initializeEmbedPageV2 = async ({ embedType, embedCode, customElementText = "Click here", }) => {
188541
188562
  this.embedTestPage = await this.context.newPage();
188542
188563
  this.embedTestPageType = embedType;
188543
- const fileContent = basicHTMLContent(this.embedTestPageType === "elementClick"
188564
+ const fileContent = basicHTMLContent(this.embedTestPageType === "elementPopup"
188544
188565
  ? `${embedCode}<a href='#' id='open-popup-button'>${customElementText}</a>`
188545
188566
  : embedCode);
188546
188567
  this.filePath = `tmp/${faker.faker.word.noun()}.html`;
@@ -188554,7 +188575,7 @@ class EmbedBase {
188554
188575
  : EMBED_SELECTORS.iframe(this.appName));
188555
188576
  return this.embedTestPage;
188556
188577
  };
188557
- this.initializeEmbedPageV2 = async ({ embedType, embedCode, customElementText = "Click here", }) => {
188578
+ this.initializeEmbedPage = async ({ embedType, embedCode, customElementText = "Click here", }) => {
188558
188579
  this.embedTestPage = await this.context.newPage();
188559
188580
  this.embedTestPageType = embedType;
188560
188581
  const fileContent = basicHTMLContent(this.embedTestPageType === "elementPopup"
@@ -188596,33 +188617,29 @@ class EmbedBase {
188596
188617
  }).toPass({ timeout: 2 * 60 * 1000 });
188597
188618
  };
188598
188619
  /**
188599
- * @deprecated This method is deprecated. Use copyEmbedScriptV2 instead.
188620
+ * @deprecated This method is deprecated. Use copyEmbedScript instead.
188600
188621
  */
188601
- this.copyEmbedScript = async ({ embedLabel }) => {
188602
- await this.page
188603
- .getByTestId(COMMON_SELECTORS.radioLabel(embedLabel))
188604
- .check();
188622
+ this.copyEmbedScriptV2 = async (embedType) => {
188623
+ await this.selectEmbedType(embedType);
188605
188624
  await this.page.getByTestId(COMMON_SELECTORS.copyButton).click();
188606
188625
  return await this.page.evaluate(() => navigator.clipboard.readText());
188607
188626
  };
188608
- this.copyEmbedScriptV2 = async (embedType) => {
188609
- await this.selectEmbedTypeV2(embedType);
188627
+ this.copyEmbedScript = async (embedType) => {
188628
+ await this.selectEmbedType(embedType);
188610
188629
  await this.page.getByTestId(COMMON_SELECTORS.copyButton).click();
188611
188630
  return await this.page.evaluate(() => navigator.clipboard.readText());
188612
188631
  };
188613
188632
  /**
188614
- * @deprecated This method is deprecated. Use selectEmbedTypeV2 instead.
188633
+ * @deprecated This method is deprecated. Use selectEmbedType instead.
188615
188634
  */
188616
- this.selectEmbedType = async (embedLabel) => {
188617
- await this.page.getByTestId(EMBED_SELECTORS.htmlTab).click();
188618
- await this.page
188619
- .getByTestId(COMMON_SELECTORS.radioLabel(embedLabel))
188620
- .check();
188621
- };
188622
188635
  this.selectEmbedTypeV2 = async (embedType) => {
188623
188636
  await this.page.locator(EMBED_SELECTORS.embedSelector(embedType)).click();
188624
188637
  await this.neetoPlaywrightUtilities.waitForPageLoad();
188625
188638
  };
188639
+ this.selectEmbedType = async (embedType) => {
188640
+ await this.page.locator(EMBED_SELECTORS.embedSelector(embedType)).click();
188641
+ await this.neetoPlaywrightUtilities.waitForPageLoad();
188642
+ };
188626
188643
  this.verifyInlineCustomization = async ({ headingTestId,
188627
188644
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
188628
188645
  inlineEmbedInterceptParams, customizationOptions, }) => {
@@ -188732,10 +188749,7 @@ class EmbedBase {
188732
188749
  .fill(customizationOptions.customId);
188733
188750
  await test$1.expect(this.codeBlock).toContainText(`elementSelector: "#${customizationOptions.customId}"`);
188734
188751
  (await this.previewTab.isVisible()) && (await this.previewTab.click());
188735
- await Promise.all([
188736
- test$1.expect(this.page.getByTestId(EMBED_SELECTORS.previewElementPopupButton)).toBeVisible(),
188737
- await test$1.expect(this.page.locator(`#${customizationOptions.customId}`)).toBeVisible(),
188738
- ]);
188752
+ await test$1.expect(this.page.getByTestId(EMBED_SELECTORS.previewElementPopupButton)).toBeVisible();
188739
188753
  await this.backToEmbedSelection();
188740
188754
  };
188741
188755
  this.expectMultipleTextsInCodeblock = async (containTextOptions) => {
@@ -188780,6 +188794,14 @@ const ROUTES = {
188780
188794
  attachment: `/neeto_editor${BASE_URL}/direct_uploads/attach`,
188781
188795
  dashboard: "/dashboard",
188782
188796
  neetoThankYou: "/neeto_thank_you_engine",
188797
+ adminPanel: {
188798
+ roles: "/admin/admin-panel/roles",
188799
+ index: "/admin/admin-panel",
188800
+ auditLogs: "/admin/admin-panel/audit-logs",
188801
+ apiKeys: "/admin/admin-panel/apiKeys",
188802
+ customDomain: "/admin/admin-panel/custom-domain",
188803
+ ipRestriction: "/admin/admin-panel/ip-restriction",
188804
+ },
188783
188805
  };
188784
188806
  const API_ROUTES = {
188785
188807
  teamMembers: {
@@ -188876,7 +188898,6 @@ const ZAPIER_WEB_TEXTS = {
188876
188898
  welcomeText: (zapierLoginEmail) => `Welcome back ${zapierLoginEmail}`,
188877
188899
  connectStagingApp: (appName) => `Connect ${appName} Staging`,
188878
188900
  zapierWorkflowTriggered: "Zapier Workflow Triggered",
188879
- confirmPublishing: "Confirm Publishing",
188880
188901
  startFreeWithEmail: "Start free with email",
188881
188902
  appsByTitle: "Apps by title",
188882
188903
  logIn: "Log in",
@@ -188933,6 +188954,9 @@ const ORGANIZATION_TEXTS = {
188933
188954
  class HelpAndProfilePage {
188934
188955
  constructor({ page, neetoPlaywrightUtilities, chatApiBaseURL, kbDocsBaseURL, changelogBaseURL, }) {
188935
188956
  this.hoverOnBody = () => this.page.locator("body").hover();
188957
+ /**
188958
+ * @deprecated This method is deprecated. Use openHelpCenter instead.
188959
+ */
188936
188960
  this.openHelpCenterV2 = async () => {
188937
188961
  await test$1.expect(async () => {
188938
188962
  await this.hoverOnBody();
@@ -188942,9 +188966,18 @@ class HelpAndProfilePage {
188942
188966
  await test$1.expect(this.page.getByTestId(HELP_CENTER_SELECTORS.chatButton)).toBeVisible();
188943
188967
  }).toPass({ timeout: 15000 });
188944
188968
  };
188969
+ this.openHelpCenter = async () => {
188970
+ await test$1.expect(async () => {
188971
+ await this.hoverOnBody();
188972
+ const floatingActionMenuButton = this.page.getByTestId(COMMON_SELECTORS.floatingActionMenuButton);
188973
+ await floatingActionMenuButton.scrollIntoViewIfNeeded();
188974
+ await floatingActionMenuButton.hover();
188975
+ await test$1.expect(this.page.getByTestId(HELP_CENTER_SELECTORS.chatButton)).toBeVisible();
188976
+ }).toPass({ timeout: 15000 });
188977
+ };
188945
188978
  this.openLiveChatAndVerify = async (widgetVisibilityTimeout = 10000) => {
188946
188979
  await test$1.expect(async () => {
188947
- await this.openHelpCenterV2();
188980
+ await this.openHelpCenter();
188948
188981
  await this.page.getByTestId(HELP_CENTER_SELECTORS.chatButton).click();
188949
188982
  await test$1.expect(this.neetoChatWidget).toBeVisible({
188950
188983
  timeout: widgetVisibilityTimeout,
@@ -188955,6 +188988,9 @@ class HelpAndProfilePage {
188955
188988
  });
188956
188989
  }).toPass({ timeout: 35000 + widgetVisibilityTimeout * 2 });
188957
188990
  };
188991
+ /**
188992
+ * @deprecated This method is deprecated. Use openAndVerifyChatWidget instead.
188993
+ */
188958
188994
  this.openAndVerifyChatWidgetV2 = async () => {
188959
188995
  await this.page.reload();
188960
188996
  await this.neetoPlaywrightUtilities.waitForPageLoad();
@@ -188968,6 +189004,22 @@ class HelpAndProfilePage {
188968
189004
  })).toBeVisible({ timeout: 35000 });
188969
189005
  });
188970
189006
  };
189007
+ this.openAndVerifyChatWidget = async () => {
189008
+ await this.page.reload();
189009
+ await this.neetoPlaywrightUtilities.waitForPageLoad();
189010
+ await test$1.test.step("Step 1: Open live chat and verify iframe", () => this.openLiveChatAndVerify());
189011
+ await test$1.test.step("Step 2: Close and reopen live chat frame", async () => {
189012
+ await this.page.getByTestId(CHAT_WIDGET_SELECTORS.closeChat).click();
189013
+ await test$1.expect(this.neetoChatWidget).toBeHidden({ timeout: 35000 });
189014
+ await this.openLiveChatAndVerify();
189015
+ await test$1.expect(this.neetoChatFrame.getByRole("button", {
189016
+ name: CHAT_WIDGET_TEXTS.newConversation,
189017
+ })).toBeVisible({ timeout: 35000 });
189018
+ });
189019
+ };
189020
+ /**
189021
+ * @deprecated This method is deprecated. Use openAndVerifyHelpArticles instead.
189022
+ */
188971
189023
  this.openAndVerifyHelpArticlesV2 = async () => {
188972
189024
  await test$1.test.step("Step 1: Open Help Center links", this.openHelpCenterV2);
188973
189025
  await test$1.test.step("Step 2: Open and verify help articles link", async () => {
@@ -188981,21 +189033,36 @@ class HelpAndProfilePage {
188981
189033
  await helpArticlesPage.close();
188982
189034
  });
188983
189035
  };
188984
- this.openChangelogPaneV2 = async () => {
189036
+ this.openAndVerifyHelpArticles = async () => {
189037
+ await test$1.test.step("Step 1: Open Help Center links", this.openHelpCenter);
189038
+ await test$1.test.step("Step 2: Open and verify help articles link", async () => {
189039
+ const helpArticlesPromise = this.page.waitForEvent("popup");
189040
+ await this.page
189041
+ .getByTestId(HELP_CENTER_SELECTORS.documentationButton)
189042
+ .click();
189043
+ const helpArticlesPage = await helpArticlesPromise;
189044
+ await helpArticlesPage.waitForLoadState();
189045
+ await test$1.expect(helpArticlesPage).toHaveURL(this.kbDocsBaseURL);
189046
+ });
189047
+ };
189048
+ this.openChangelogPane = async () => {
188985
189049
  await test$1.expect(async () => {
188986
- await this.openHelpCenterV2();
189050
+ await this.openHelpCenter();
188987
189051
  await this.page.getByTestId(HELP_CENTER_SELECTORS.whatsNewButton).click();
188988
189052
  await test$1.expect(this.page.locator(CHANGELOG_WIDGET_SELECTORS.changelogWrapper)).toBeVisible();
188989
189053
  }).toPass({ timeout: 45000 });
188990
189054
  };
189055
+ /**
189056
+ * @deprecated This method is deprecated. Use openAndVerifyChangelog instead.
189057
+ */
188991
189058
  this.openAndVerifyChangelogV2 = async () => {
188992
- await test$1.test.step("Step 1: Open Help Center links and changelog", this.openChangelogPaneV2);
189059
+ await test$1.test.step("Step 1: Open Help Center links and changelog", this.openChangelogPane);
188993
189060
  await test$1.test.step("Step 2: Close and reopen changelog pane", async () => {
188994
189061
  await this.page
188995
189062
  .getByTestId(CHANGELOG_WIDGET_SELECTORS.closeButton)
188996
189063
  .click();
188997
189064
  await test$1.expect(this.page.locator(CHANGELOG_WIDGET_SELECTORS.changelogWrapper)).toBeHidden();
188998
- await this.openChangelogPaneV2();
189065
+ await this.openChangelogPane();
188999
189066
  });
189000
189067
  await test$1.test.step("Step 3: Open and verify public URL", async () => {
189001
189068
  const changelogPagePromise = this.page.waitForEvent("popup");
@@ -189008,6 +189075,25 @@ class HelpAndProfilePage {
189008
189075
  await changelogPage.close();
189009
189076
  });
189010
189077
  };
189078
+ this.openAndVerifyChangelog = async () => {
189079
+ await test$1.test.step("Step 1: Open Help Center links and changelog", this.openChangelogPane);
189080
+ await test$1.test.step("Step 2: Close and reopen changelog pane", async () => {
189081
+ await this.page
189082
+ .getByTestId(CHANGELOG_WIDGET_SELECTORS.closeButton)
189083
+ .click();
189084
+ await test$1.expect(this.page.locator(CHANGELOG_WIDGET_SELECTORS.changelogWrapper)).toBeHidden();
189085
+ await this.openChangelogPane();
189086
+ });
189087
+ await test$1.test.step("Step 3: Open and verify public URL", async () => {
189088
+ const changelogPagePromise = this.page.waitForEvent("popup");
189089
+ await this.page
189090
+ .getByTestId(CHANGELOG_WIDGET_SELECTORS.publicUrlLink)
189091
+ .click();
189092
+ const changelogPage = await changelogPagePromise;
189093
+ await test$1.expect(changelogPage.getByRole("button", { name: ENGAGE_TEXTS.subscribe })).toBeVisible();
189094
+ await test$1.expect(changelogPage).toHaveURL(this.changelogBaseURL);
189095
+ });
189096
+ };
189011
189097
  this.formatKeyboardShortcut = (shortcut, osPlatform = "windows") => {
189012
189098
  const formattedShortcut = shortcut
189013
189099
  .replaceAll(" ", "then")
@@ -189016,6 +189102,9 @@ class HelpAndProfilePage {
189016
189102
  ? formattedShortcut.replace(/ctrl/g, "⌘").replace(/alt/g, "opt")
189017
189103
  : formattedShortcut;
189018
189104
  };
189105
+ /**
189106
+ * @deprecated This method is deprecated. Use openAndVerifyKeyboardShortcutsPane instead.
189107
+ */
189019
189108
  this.openAndVerifyKeyboardShortcutsPaneV2 = async (productShortcuts, osPlatform = "windows") => {
189020
189109
  const globalShortcuts = [
189021
189110
  {
@@ -189061,6 +189150,40 @@ class HelpAndProfilePage {
189061
189150
  .locator("div")).toHaveText(formattedSequences);
189062
189151
  });
189063
189152
  };
189153
+ this.openAndVerifyKeyboardShortcutsPane = async (productShortcuts, osPlatform = "windows") => {
189154
+ const shortcuts = [...globalShortcuts(this.t), ...productShortcuts];
189155
+ await test$1.test.step("Step 1: Open Help Center", this.openHelpCenter);
189156
+ await test$1.test.step("Step 2: Open and close keyboard shortcuts from UI", async () => {
189157
+ await this.page
189158
+ .getByTestId(HELP_CENTER_SELECTORS.keyboardShortcutButton)
189159
+ .click();
189160
+ await test$1.expect(this.page.getByTestId(KEYBOARD_SHORTCUTS_SELECTORS.keyboardShortcutsPane)).not.toHaveCSS("width", "1px");
189161
+ await this.page
189162
+ .getByTestId(KEYBOARD_SHORTCUTS_SELECTORS.closePaneButton)
189163
+ .click();
189164
+ await test$1.expect(this.page.getByTestId(KEYBOARD_SHORTCUTS_SELECTORS.keyboardShortcutsPane)).toHaveCSS("width", "1px");
189165
+ });
189166
+ await test$1.test.step("Step 3: Open and close keyboard shortcuts through shortcut", async () => {
189167
+ await this.page.keyboard.press("Shift+/");
189168
+ await test$1.expect(this.page.getByTestId(KEYBOARD_SHORTCUTS_SELECTORS.keyboardShortcutsPane)).not.toHaveCSS("width", "1px");
189169
+ await this.page.keyboard.press("Escape");
189170
+ await test$1.expect(this.page.getByTestId(KEYBOARD_SHORTCUTS_SELECTORS.keyboardShortcutsPane)).toHaveCSS("width", "1px");
189171
+ });
189172
+ await test$1.test.step("Step 4: Verify all displayed keyboard shortcuts", async () => {
189173
+ await this.page.keyboard.press("Shift+/");
189174
+ await test$1.expect(this.page.getByTestId(KEYBOARD_SHORTCUTS_SELECTORS.keyboardShortcutsPane)).not.toHaveCSS("width", "1px");
189175
+ await test$1.expect(this.page
189176
+ .getByTestId(KEYBOARD_SHORTCUTS_SELECTORS.hotKeyItem)
189177
+ .locator("p")).toHaveText(shortcuts.map(shortcut => shortcut.description));
189178
+ const formattedSequences = shortcuts.map(shortcut => this.formatKeyboardShortcut(shortcut.sequence, osPlatform));
189179
+ await test$1.expect(this.page
189180
+ .getByTestId(KEYBOARD_SHORTCUTS_SELECTORS.hotKeyItem)
189181
+ .locator("div")).toHaveText(formattedSequences);
189182
+ });
189183
+ };
189184
+ /**
189185
+ * @deprecated This method is deprecated. Use openAppSwitcherAndVerify instead.
189186
+ */
189064
189187
  this.openAppSwitcherAndVerifyV2 = async () => {
189065
189188
  const productName = "Playdash";
189066
189189
  const searchQueryPartial = productName.slice(0, 4).toLowerCase();
@@ -189089,45 +189212,58 @@ class HelpAndProfilePage {
189089
189212
  ]);
189090
189213
  });
189091
189214
  };
189092
- this.openAuthLinkAndVerify = async ({ linkSelector, redirectLink, }) => {
189093
- var _a, _b;
189094
- const profilePagePromise = this.page.waitForEvent("popup");
189095
- await this.page.getByTestId(linkSelector).click();
189096
- const profilePage = await profilePagePromise;
189097
- await profilePage.waitForLoadState();
189098
- await test$1.expect(profilePage).toHaveURL(new RegExp(NEETO_AUTH_BASE_URL((_b = (_a = readFileSyncIfExists()) === null || _a === void 0 ? void 0 : _a.user) === null || _b === void 0 ? void 0 : _b.subdomainName)));
189099
- await test$1.expect(profilePage).toHaveURL(new RegExp(redirectLink));
189100
- await profilePage.close();
189215
+ this.openAppSwitcherAndVerify = async () => {
189216
+ const productName = "Playdash";
189217
+ const searchQueryPartial = productName.slice(0, 4).toLowerCase();
189218
+ const searchQueryFull = productName.toLowerCase();
189219
+ await test$1.test.step("Step 1: Verify hovering over app switcher opens the app switcher drawer", () => test$1.expect(async () => {
189220
+ await this.openHelpCenter();
189221
+ await this.page.getByTestId(COMMON_SELECTORS.appSwitcherButton).hover();
189222
+ await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.appSwitcherWrapper)).toBeVisible();
189223
+ }).toPass({ timeout: 45000 }));
189224
+ await test$1.test.step("Step 2: Verify search functionality", async () => {
189225
+ const playdashAppLink = this.page.getByTestId(COMMON_SELECTORS.appLink(productName));
189226
+ const replayAppLink = this.page.getByTestId(COMMON_SELECTORS.appLink("Replay"));
189227
+ const searchInput = this.page.getByTestId(COMMON_SELECTORS.productSwitcherSearchInput);
189228
+ await searchInput.fill(faker.faker.word.words(3));
189229
+ //TODO: Use data-cy label when this https://github.com/bigbinary/neeto-molecules/issues/2114 is resolved
189230
+ await test$1.expect(this.page.getByText(this.t("neetoMolecules.productSwitcher.noApps"))).toBeVisible();
189231
+ await searchInput.fill(searchQueryPartial);
189232
+ await Promise.all([
189233
+ test$1.expect(playdashAppLink).toBeVisible(),
189234
+ test$1.expect(replayAppLink).toBeVisible(),
189235
+ ]);
189236
+ await searchInput.fill(searchQueryFull);
189237
+ await Promise.all([
189238
+ test$1.expect(playdashAppLink).toBeVisible(),
189239
+ test$1.expect(replayAppLink).toBeHidden(),
189240
+ ]);
189241
+ });
189101
189242
  };
189102
- this.verifyProfileAndOrganizationLinksV2 = async () => {
189243
+ /**
189244
+ * @deprecated This method is deprecated. Use verifyLogout instead.
189245
+ */
189246
+ this.verifyLogoutV2 = async () => {
189247
+ if (shouldSkipSetupAndTeardown())
189248
+ return;
189103
189249
  await test$1.test.step("Step 1: Open Help center and verify", this.openHelpCenterV2);
189104
- await test$1.test.step("Step 2: Open My profile link and verify", async () => {
189250
+ await test$1.test.step("Step 2: Click logout and verify", async () => {
189105
189251
  await this.page
189106
- .getByTestId(PROFILE_SECTION_SELECTORS.myProfileButton)
189107
- .click();
189108
- const profileSidebarHeader = this.page.getByTestId(COMMON_SELECTORS.paneHeader);
189109
- await test$1.expect(profileSidebarHeader).toContainText(this.t("neetoTeamMembers.profile.common.myProfile"));
189110
- await this.openAuthLinkAndVerify({
189111
- linkSelector: PROFILE_SECTION_SELECTORS.neetoAuthLink,
189112
- redirectLink: ROUTES.myProfile,
189252
+ .getByTestId(PROFILE_SECTION_SELECTORS.logoutButton)
189253
+ .click({ timeout: 35000 });
189254
+ process.env.TEST_ENV === ENVIRONMENT.staging &&
189255
+ (await test$1.expect(this.page).toHaveURL(new RegExp(NEETO_AUTH_BASE_URL()), {
189256
+ timeout: 15000,
189257
+ }));
189258
+ await test$1.expect(this.page).toHaveURL(new RegExp(ROUTES.loginLink), {
189259
+ timeout: 15000,
189113
189260
  });
189114
- await this.page
189115
- .getByTestId(PROFILE_SECTION_SELECTORS.profileSidebarCancelButton)
189116
- .click();
189117
- await test$1.expect(profileSidebarHeader).toBeHidden();
189118
- });
189119
- await test$1.test.step("Step 3: Open Help center and verify", this.openHelpCenterV2);
189120
- await test$1.test.step("Step 4: Open My organization link and verify", async () => {
189121
- await this.page
189122
- .getByTestId(PROFILE_SECTION_SELECTORS.profileOrganizationSettingsButton)
189123
- .click();
189124
- await test$1.expect(this.page).toHaveURL(new RegExp(ROUTES.dashboard));
189125
189261
  });
189126
189262
  };
189127
- this.verifyLogoutV2 = async () => {
189263
+ this.verifyLogout = async () => {
189128
189264
  if (shouldSkipSetupAndTeardown())
189129
189265
  return;
189130
- await test$1.test.step("Step 1: Open Help center and verify", this.openHelpCenterV2);
189266
+ await test$1.test.step("Step 1: Open Help center and verify", this.openHelpCenter);
189131
189267
  await test$1.test.step("Step 2: Click logout and verify", async () => {
189132
189268
  await this.page
189133
189269
  .getByTestId(PROFILE_SECTION_SELECTORS.logoutButton)
@@ -189141,7 +189277,7 @@ class HelpAndProfilePage {
189141
189277
  });
189142
189278
  });
189143
189279
  };
189144
- this.openAuthLinkAndVerifyV1 = async ({ linkName, redirectLink, }) => {
189280
+ this.openAuthLinkAndVerify = async ({ linkName, redirectLink, }) => {
189145
189281
  var _a, _b;
189146
189282
  await this.page
189147
189283
  .getByTestId(COMMON_SELECTORS.pane)
@@ -189155,15 +189291,18 @@ class HelpAndProfilePage {
189155
189291
  await test$1.expect(this.page).toHaveURL(new RegExp(redirectLink));
189156
189292
  await this.page.goBack();
189157
189293
  };
189294
+ /**
189295
+ * @deprecated This method is deprecated. Use verifyProfileAndOrganizationLinks instead.
189296
+ */
189158
189297
  this.verifyProfileAndOrganizationLinksV3 = async () => {
189159
- await test$1.test.step("Step 1: Open Help center and verify", this.openHelpCenterV2);
189298
+ await test$1.test.step("Step 1: Open Help center and verify", this.openHelpCenter);
189160
189299
  await test$1.test.step("Step 2: Open My profile link and verify", async () => {
189161
189300
  const profileSidebarHeader = this.page.getByTestId(COMMON_SELECTORS.paneHeader);
189162
189301
  await this.page
189163
189302
  .getByTestId(PROFILE_SECTION_SELECTORS.myProfileButton)
189164
189303
  .click();
189165
189304
  await test$1.expect(profileSidebarHeader).toContainText(this.t("neetoTeamMembers.profile.common.myProfile"));
189166
- await this.openAuthLinkAndVerifyV1({
189305
+ await this.openAuthLinkAndVerify({
189167
189306
  redirectLink: ROUTES.myProfile,
189168
189307
  linkName: this.t("neetoTeamMembers.buttons.manageBillingAndSubscriptions"),
189169
189308
  });
@@ -189176,8 +189315,29 @@ class HelpAndProfilePage {
189176
189315
  await test$1.expect(this.page).toHaveURL(new RegExp(ROUTES.dashboard));
189177
189316
  });
189178
189317
  };
189318
+ this.verifyProfileAndOrganizationLinks = async () => {
189319
+ await test$1.test.step("Step 1: Open Help center and verify", this.openHelpCenter);
189320
+ await test$1.test.step("Step 2: Open My profile link and verify", async () => {
189321
+ const profileSidebarHeader = this.page.getByTestId(COMMON_SELECTORS.paneHeader);
189322
+ await this.page
189323
+ .getByTestId(PROFILE_SECTION_SELECTORS.myProfileButton)
189324
+ .click();
189325
+ await test$1.expect(profileSidebarHeader).toContainText(this.t("neetoTeamMembers.profile.common.myProfile"));
189326
+ await this.openAuthLinkAndVerify({
189327
+ redirectLink: ROUTES.myProfile,
189328
+ linkName: this.t("neetoTeamMembers.buttons.manageBillingAndSubscriptions"),
189329
+ });
189330
+ });
189331
+ await test$1.test.step("Step 3: Open Help center and verify", this.openHelpCenter);
189332
+ await test$1.test.step("Step 4: Open My organization link and verify", async () => {
189333
+ await this.page
189334
+ .getByTestId(PROFILE_SECTION_SELECTORS.profileOrganizationSettingsButton)
189335
+ .click();
189336
+ await test$1.expect(this.page).toHaveURL(new RegExp(ROUTES.dashboard));
189337
+ });
189338
+ };
189179
189339
  this.openAndVerifyStatus = async (appName) => {
189180
- await test$1.test.step("Step 1: Open Help Center links", this.openHelpCenterV2);
189340
+ await test$1.test.step("Step 1: Open Help Center links", this.openHelpCenter);
189181
189341
  await test$1.test.step("Step 2: Open and verify status page", async () => {
189182
189342
  const statusPagePromise = this.page.waitForEvent("popup");
189183
189343
  await this.page.getByTestId(HELP_CENTER_SELECTORS.statusButton).click();
@@ -189192,7 +189352,7 @@ class HelpAndProfilePage {
189192
189352
  });
189193
189353
  };
189194
189354
  this.openAndVerifyCommunity = async () => {
189195
- await test$1.test.step("Step 1: Open Help Center links", this.openHelpCenterV2);
189355
+ await test$1.test.step("Step 1: Open Help Center links", this.openHelpCenter);
189196
189356
  await test$1.test.step("Step 2: Open and verify community", async () => {
189197
189357
  const communityPagePromise = this.page.waitForEvent("popup");
189198
189358
  await this.page
@@ -191557,6 +191717,9 @@ class ZapierPage extends IntegrationBase {
191557
191717
  const testTriggerButton = this.zapierWebPage.getByRole("button", {
191558
191718
  name: ZAPIER_WEB_TEXTS.testTrigger,
191559
191719
  });
191720
+ await test$1.expect(this.zapierWebPage.locator(ZAPIER_SELECTORS.spinner)).toBeHidden({
191721
+ timeout: 25000,
191722
+ });
191560
191723
  (await testTriggerButton.isVisible()) && (await testTriggerButton.click());
191561
191724
  await test$1.expect(this.zapierWebPage.getByText(ZAPIER_WEB_TEXTS.testCurrentlyInQueue)).toBeHidden({ timeout: 20000 });
191562
191725
  await test$1.expect(this.zapierWebPage.getByLabel(ZAPIER_WEB_TEXTS.statusLabel, {
@@ -191577,14 +191740,8 @@ class ZapierPage extends IntegrationBase {
191577
191740
  .getByRole("button", { name: ZAPIER_WEB_TEXTS.publish }))
191578
191741
  .click({ timeout: 20000 });
191579
191742
  await this.zapierWebPage
191580
- .getByRole("button", { name: ZAPIER_WEB_TEXTS.confirmPublishing })
191581
- .or(this.zapierWebPage
191582
191743
  .getByRole("dialog")
191583
- .getByLabel(ZAPIER_WEB_TEXTS.publish)
191584
- .or(this.zapierWebPage.getByRole("dialog").getByRole("button", {
191585
- name: ZAPIER_WEB_TEXTS.publish,
191586
- exact: true,
191587
- })))
191744
+ .getByLabel(new RegExp(ZAPIER_WEB_TEXTS.publish, "i"))
191588
191745
  .click();
191589
191746
  await this.zapierWebPage
191590
191747
  .getByLabel(ZAPIER_WEB_TEXTS.publishingZapHeading)
@@ -192912,7 +193069,8 @@ class AuditLogsPage {
192912
193069
  }
192913
193070
 
192914
193071
  class CustomDomainPage {
192915
- constructor(page, neetoPlaywrightUtilities) {
193072
+ constructor(page, neetoPlaywrightUtilities, browser // Made optional to avoid breaking changes during the compliance release
193073
+ ) {
192916
193074
  this.addCustomDomainViaUI = async (domainName) => {
192917
193075
  const addCustomDomainButton = this.page.getByTestId(CUSTOM_DOMAIN_SELECTORS.addCustomDomainButton);
192918
193076
  await test$1.expect(addCustomDomainButton).toBeVisible();
@@ -192949,6 +193107,109 @@ class CustomDomainPage {
192949
193107
  await this.neetoPlaywrightUtilities.verifyToast();
192950
193108
  await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.noDataTitle)).toBeVisible();
192951
193109
  };
193110
+ this.getCustomDomain = (newSubdomain) => {
193111
+ const { subdomainName } = getGlobalUserState();
193112
+ this.subdomain = newSubdomain !== null && newSubdomain !== void 0 ? newSubdomain : subdomainName;
193113
+ return `${this.subdomain}.${CUSTOM_DOMAIN_SUFFIX}`;
193114
+ };
193115
+ this.addCustomDomain = async (domain) => {
193116
+ await this.page
193117
+ .getByTestId(CUSTOM_DOMAIN_SELECTORS.addCustomDomainButton)
193118
+ .click();
193119
+ await this.page
193120
+ .getByTestId(CUSTOM_DOMAIN_SELECTORS.customDomainInputField)
193121
+ .fill(domain);
193122
+ await this.page
193123
+ .getByTestId(CUSTOM_DOMAIN_SELECTORS.submitCustomDomainButton)
193124
+ .click();
193125
+ };
193126
+ this.validateCustomDomain = async (domain) => {
193127
+ const validateButton = this.page.getByTestId(CUSTOM_DOMAIN_SELECTORS.customDomainValidateButton);
193128
+ await Promise.all([
193129
+ test$1.expect(validateButton).toBeVisible(),
193130
+ test$1.expect(this.page.getByTestId(COMMON_SELECTORS.paneBody).getByText(domain)).toBeVisible(),
193131
+ ]);
193132
+ await test$1.expect(async () => {
193133
+ await validateButton.click();
193134
+ await this.neetoPlaywrightUtilities.verifyToast({
193135
+ message: this.t("neetoCustomDomains.validation.successMessage"),
193136
+ });
193137
+ }).toPass({ timeout: 60000 });
193138
+ await this.neetoPlaywrightUtilities.waitForPageLoad();
193139
+ await test$1.expect(this.page.getByTestId(CUSTOM_DOMAIN_SELECTORS.activeTagContainer)).toBeVisible();
193140
+ };
193141
+ this.loginToCustomDomain = async () => {
193142
+ void this.page.close();
193143
+ const loginPage = this.loginPage;
193144
+ const { email } = getGlobalUserState();
193145
+ const loginUrl = `${this.baseURL}${ROUTES.admin}`;
193146
+ const playwrightUtils = new CustomCommands(loginPage, loginPage.request);
193147
+ const organizationPage = new OrganizationPage(loginPage, playwrightUtils);
193148
+ await loginPage.goto(loginUrl);
193149
+ await organizationPage.loginViaSSO(email);
193150
+ await test$1.expect(loginPage).toHaveURL(RegExp(loginUrl), { timeout: 15000 });
193151
+ await playwrightUtils.waitForPageLoad();
193152
+ };
193153
+ this.waitForTrustedSSL = () => test$1.expect
193154
+ .poll(() => new Promise(resolve => {
193155
+ https$1
193156
+ .get(this.baseURL, { rejectUnauthorized: true }, res => {
193157
+ res.resume();
193158
+ resolve(true);
193159
+ })
193160
+ .on("error", () => {
193161
+ resolve(false);
193162
+ });
193163
+ }), { timeout: 25000, intervals: [3000] })
193164
+ .toBe(true);
193165
+ this.saveCustomDomainState = async () => {
193166
+ const { user } = readFileSyncIfExists();
193167
+ await this.loginPage.context().storageState({ path: STORAGE_STATE });
193168
+ const mergedCredentials = ramda.mergeAll([readFileSyncIfExists(), { user }]);
193169
+ writeDataToFile(JSON.stringify(mergedCredentials, null, 2));
193170
+ updateCredentials({ key: "baseUrl", value: this.baseURL });
193171
+ updateCredentials({ key: "domain", value: CUSTOM_DOMAIN_SUFFIX });
193172
+ };
193173
+ this.setupCustomDomain = async (product) => {
193174
+ if (shouldSkipCustomDomainSetup())
193175
+ return;
193176
+ await this.connectCustomDomain(product);
193177
+ const context = await this.browser.newContext(EMPTY_STORAGE_STATE);
193178
+ this.loginPage = await context.newPage();
193179
+ await this.loginToCustomDomain();
193180
+ await this.saveCustomDomainState();
193181
+ };
193182
+ this.connectCustomDomain = async (product, subdomain) => {
193183
+ if (shouldSkipCustomDomainSetup())
193184
+ return;
193185
+ const baseURL = baseURLGenerator(product, subdomain);
193186
+ const domain = this.getCustomDomain(subdomain);
193187
+ this.baseURL = `https://${domain}`;
193188
+ await this.page.goto(`${baseURL}${ROUTES.adminPanel.customDomain}`);
193189
+ await this.neetoPlaywrightUtilities.waitForPageLoad();
193190
+ await this.addCustomDomain(domain);
193191
+ await this.validateCustomDomain(domain);
193192
+ process.env.BASE_URL = this.baseURL;
193193
+ await this.waitForTrustedSSL();
193194
+ };
193195
+ this.disconnectCustomDomain = async (product, subdomain) => {
193196
+ if (shouldSkipCustomDomainSetup())
193197
+ return;
193198
+ const baseURL = baseURLGenerator(product, subdomain);
193199
+ await this.page.goto(`${baseURL}${ROUTES.adminPanel.customDomain}`);
193200
+ await this.neetoPlaywrightUtilities.waitForPageLoad();
193201
+ await this.page.getByTestId(CUSTOM_DOMAIN_SELECTORS.dropdownButton).click();
193202
+ await this.page
193203
+ .getByTestId(CUSTOM_DOMAIN_SELECTORS.deleteCustomDomainButton)
193204
+ .click();
193205
+ await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.alertTitle)).toHaveText(this.t("neetoCustomDomains.delete"));
193206
+ await this.page
193207
+ .getByTestId(COMMON_SELECTORS.alertModalSubmitButton)
193208
+ .click();
193209
+ await this.neetoPlaywrightUtilities.verifyToast();
193210
+ await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.noDataTitle)).toBeVisible();
193211
+ };
193212
+ this.browser = browser;
192952
193213
  this.page = page;
192953
193214
  this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
192954
193215
  this.t = playwrightI18nextFixture.getI18nInstance().t;
@@ -195178,6 +195439,7 @@ exports.COMMON_TEXTS = COMMON_TEXTS;
195178
195439
  exports.COMMUNITY_TEXTS = COMMUNITY_TEXTS;
195179
195440
  exports.CREDENTIALS = CREDENTIALS;
195180
195441
  exports.CUSTOM_DOMAIN_SELECTORS = CUSTOM_DOMAIN_SELECTORS;
195442
+ exports.CUSTOM_DOMAIN_SUFFIX = CUSTOM_DOMAIN_SUFFIX;
195181
195443
  exports.CustomCommands = CustomCommands;
195182
195444
  exports.CustomDomainsPage = CustomDomainPage;
195183
195445
  exports.DATE_PICKER_SELECTORS = DATE_PICKER_SELECTORS;
@@ -195263,6 +195525,7 @@ exports.ZAPIER_SELECTORS = ZAPIER_SELECTORS;
195263
195525
  exports.ZAPIER_TEST_EMAIL = ZAPIER_TEST_EMAIL;
195264
195526
  exports.ZAPIER_WEB_TEXTS = ZAPIER_WEB_TEXTS;
195265
195527
  exports.ZapierPage = ZapierPage;
195528
+ exports.baseURLGenerator = baseURLGenerator;
195266
195529
  exports.basicHTMLContent = basicHTMLContent;
195267
195530
  exports.clearCredentials = clearCredentials;
195268
195531
  exports.commands = commands;
@@ -195282,6 +195545,7 @@ exports.getGlobalUserProps = getGlobalUserProps;
195282
195545
  exports.getGlobalUserState = getGlobalUserState;
195283
195546
  exports.getImagePathAndName = getImagePathAndName;
195284
195547
  exports.getListCount = getListCount;
195548
+ exports.globalShortcuts = globalShortcuts;
195285
195549
  exports.headerUtils = headerUtils;
195286
195550
  exports.hexToRGB = hexToRGB;
195287
195551
  exports.hexToRGBA = hexToRGBA;
@@ -195299,6 +195563,7 @@ exports.networkThrottlingUsingCDP = networkThrottlingUsingCDP;
195299
195563
  exports.readFileSyncIfExists = readFileSyncIfExists;
195300
195564
  exports.removeCredentialFile = removeCredentialFile;
195301
195565
  exports.serializeFileForBrowser = serializeFileForBrowser;
195566
+ exports.shouldSkipCustomDomainSetup = shouldSkipCustomDomainSetup;
195302
195567
  exports.shouldSkipSetupAndTeardown = shouldSkipSetupAndTeardown;
195303
195568
  exports.simulateClickWithDelay = simulateClickWithDelay;
195304
195569
  exports.simulateTypingWithDelay = simulateTypingWithDelay;