@bigbinary/neeto-playwright-commons 1.18.0 → 1.18.1

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
@@ -47,74 +47,6 @@ function _interopNamespaceDefault(e) {
47
47
  var fs__namespace = /*#__PURE__*/_interopNamespaceDefault(fs$d);
48
48
  var Path__namespace = /*#__PURE__*/_interopNamespaceDefault(Path);
49
49
 
50
- const BASE_URL = "/api/v1";
51
- const NEETO_AUTH_BASE_URL = (subdomain = "app") => `https://${subdomain}.neetoauth.net`;
52
- const ROUTES = {
53
- neetoAuthSignup: `${NEETO_AUTH_BASE_URL()}/signups/new`,
54
- neetoAuth: NEETO_AUTH_BASE_URL(),
55
- loginLink: "/login",
56
- profile: "/profile",
57
- admin: "/admin",
58
- myProfile: "/my/profile",
59
- authSettings: "/settings",
60
- webhooks: "/webhooks",
61
- login: `${BASE_URL}/login`,
62
- signup: `${BASE_URL}/signups`,
63
- subdomainAvailability: `${BASE_URL}/subdomain_availability`,
64
- countries: `${BASE_URL}/countries`,
65
- neetoApps: `${BASE_URL}/neeto_apps`,
66
- directUploads: "/direct_uploads",
67
- teamMembers: {
68
- all: "/team_members*/**",
69
- bulkUpdate: "/team_members/teams/bulk_update",
70
- index: "/team_members/teams",
71
- show: (id) => `/team_members/teams/${id}`,
72
- },
73
- attachment: `/neeto_editor${BASE_URL}/direct_uploads/attach`,
74
- dashboard: "/dashboard",
75
- neetoThankYou: "/neeto_thank_you_engine",
76
- };
77
- const API_ROUTES = {
78
- teamMembers: {
79
- all: "/team_members*/**",
80
- bulkUpdate: "/team_members/teams/bulk_update",
81
- index: "/team_members/teams",
82
- show: (id) => `/team_members/teams/${id}`,
83
- creationStatus: (id) => `/team_members/teams/creation_status/${id}`,
84
- },
85
- integrations: {
86
- zapier: {
87
- api_keys: "/neeto_integrations/zapier/api_keys",
88
- },
89
- },
90
- };
91
- const THIRD_PARTY_ROUTES = {
92
- webhooks: { site: "https://webhook.site/" },
93
- slack: {
94
- loginWithPassword: (workspace) => `https://${workspace}.slack.com/sign_in_with_password`,
95
- },
96
- zapier: {
97
- login: "https://zapier.com/",
98
- logOut: "https://zapier.com/logout",
99
- zapEditor: (zapId) => `https://zapier.com/editor/${zapId}`,
100
- },
101
- google: {
102
- signin: "https://accounts.google.com/v3/signin/identifier?hl=en-gb&ifkv=ASKXGp0nW770RS7xin2puSwbGDpGCeaVKDtCgfpEU73fYmhMKbqUjukBQ5x8kdvEVxQ7OvcrnUo8sg&flowName=GlifWebSignIn&flowEntry=ServiceLogin&dsh=S688843923%3A1704795906762870&theme=glif",
103
- password: "https://accounts.google.com/v3/signin/challenge/pwd",
104
- totpChallenge: "https://accounts.google.com/v3/signin/challenge/totp",
105
- challengeSelection: "https://accounts.google.com/v3/signin/challenge/selection",
106
- myAccount: "https://myaccount.google.com/",
107
- chooseAccount: "accounts.google.com/o/oauth2/auth/oauthchooseaccount",
108
- consentScreen: "accounts.google.com/signin/oauth/consent",
109
- warningScreen: "accounts.google.com/signin/oauth/warning",
110
- additionalInfoScreen: "accounts.google.com/signin/oauth/id",
111
- consentSummary: "accounts.google.com/signin/oauth/v2/consentsummary",
112
- },
113
- };
114
- const NEETO_ROUTES = {
115
- imageUploader: "/neeto_image_uploader_engine",
116
- };
117
-
118
50
  const ENVIRONMENT = {
119
51
  development: "development",
120
52
  staging: "staging",
@@ -692,6 +624,7 @@ const CHAT_WIDGET_SELECTORS = {
692
624
  chatBubble: "neeto-chat-widget-chat-message-bubble",
693
625
  closeChat: "neeto-chat-widget-close-btn",
694
626
  chatQuestionHeader: "chat-question-header",
627
+ openChat: "neeto-chat-widget-open-btn",
695
628
  };
696
629
  const CHANGELOG_WIDGET_SELECTORS = {
697
630
  changelogWrapper: ".ne-widget__wrapper",
@@ -3943,34 +3876,30 @@ class CustomCommands {
3943
3876
  };
3944
3877
  this.verifyToast = async ({ message = "", toastType = "success", closeAfterVerification = true, timeout = 10000, customPageContext = this.page, } = {}) => {
3945
3878
  const toastrCloseButton = customPageContext.getByTestId(COMMON_SELECTORS.toastCloseButton);
3946
- if (!ramda.isEmpty(message)) {
3947
- await test$1.expect(customPageContext.getByTestId(COMMON_SELECTORS.toastMessage(toastType))).toContainText(message, { timeout });
3948
- }
3949
- else {
3950
- await test$1.expect(customPageContext.locator(COMMON_SELECTORS.toastIcon)).toContainText("👍", { timeout });
3951
- }
3952
- if (closeAfterVerification && (await toastrCloseButton.isVisible())) {
3953
- const buttonHandle = await toastrCloseButton.elementHandle();
3954
- if (buttonHandle) {
3955
- await customPageContext.evaluate(button => {
3956
- button.dispatchEvent(new Event("click", { bubbles: true }));
3957
- }, buttonHandle);
3958
- // eslint-disable-next-line playwright/no-standalone-expect
3959
- await test$1.expect(toastrCloseButton).toBeHidden();
3960
- }
3879
+ const toastrLocator = ramda.isEmpty(message)
3880
+ ? customPageContext.locator(COMMON_SELECTORS.toastIcon)
3881
+ : customPageContext.getByTestId(COMMON_SELECTORS.toastMessage(toastType));
3882
+ await test$1.expect(toastrLocator).toContainText(ramda.isEmpty(message) ? "👍" : message, {
3883
+ timeout,
3884
+ });
3885
+ if (!closeAfterVerification && (await toastrCloseButton.isHidden()))
3886
+ return;
3887
+ const buttonHandle = await toastrCloseButton.elementHandle();
3888
+ if (buttonHandle) {
3889
+ await customPageContext.evaluate(button => {
3890
+ button.dispatchEvent(new Event("click", { bubbles: true }));
3891
+ }, buttonHandle);
3892
+ // eslint-disable-next-line playwright/no-standalone-expect
3893
+ await test$1.expect(toastrCloseButton).toBeHidden();
3961
3894
  }
3962
3895
  };
3963
- this.reloadAndWait = async (requestCount, customPageContext, interceptMultipleResponsesProps = {}) => {
3964
- const pageContext = customPageContext !== null && customPageContext !== void 0 ? customPageContext : this.page;
3965
- const reloadRequests = this.interceptMultipleResponses({
3966
- times: requestCount,
3967
- ...interceptMultipleResponsesProps,
3968
- });
3969
- await pageContext.reload();
3970
- await Promise.all([
3971
- this.waitForPageLoad({ customPageContext: pageContext }),
3972
- reloadRequests,
3973
- ]);
3896
+ this.reloadAndWait = async (
3897
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
3898
+ requestCount, customPageContext = this.page,
3899
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
3900
+ interceptMultipleResponsesProps = {}) => {
3901
+ await customPageContext.reload();
3902
+ await this.waitForPageLoad({ customPageContext });
3974
3903
  };
3975
3904
  this.waitForPageLoad = async ({ visibilityTimeout = 35000, customPageContext, } = {}) => {
3976
3905
  const pageContext = customPageContext !== null && customPageContext !== void 0 ? customPageContext : this.page;
@@ -4049,13 +3978,9 @@ class CustomCommands {
4049
3978
  await this.page
4050
3979
  .getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.browseText)
4051
3980
  .click();
4052
- const uploadFile = this.interceptMultipleResponses({
4053
- responseUrl: ROUTES.directUploads,
4054
- });
4055
3981
  await this.page
4056
3982
  .getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.fileInput)
4057
3983
  .setInputFiles(imagePath);
4058
- await uploadFile;
4059
3984
  await test$1.expect(this.page.getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.uploadedImage)).toHaveAttribute("src", new RegExp(imageName), { timeout: 20000 });
4060
3985
  };
4061
3986
  this.uploadFileViaDispatch = async ({ fileNameWithType, assetsPath = "../../../e2e/assets/", dispatchEvent = "drop", droppableZone = this.page.getByTestId(COMMON_SELECTORS.fileUploadBody), }) => {
@@ -21335,11 +21260,8 @@ class ThankYouPage {
21335
21260
  constructor(page, neetoPlaywrightUtilities) {
21336
21261
  this.navigateToThankYouPage = async () => {
21337
21262
  await this.page.getByTestId(TAB_SELECTORS.settingsTab).click();
21338
- const fetchConfiguration = this.neetoPlaywrightUtilities.interceptMultipleResponses({
21339
- responseUrl: ROUTES.neetoThankYou,
21340
- });
21341
21263
  await this.page.getByTestId(THANK_YOU_SELECTORS.settingsLink).click();
21342
- await fetchConfiguration;
21264
+ await this.neetoPlaywrightUtilities.waitForPageLoad();
21343
21265
  };
21344
21266
  this.saveChanges = async () => {
21345
21267
  await this.page.getByTestId(THANK_YOU_SELECTORS.saveChangesButton).click();
@@ -21571,6 +21493,74 @@ class EmbedBase {
21571
21493
  }
21572
21494
  }
21573
21495
 
21496
+ const BASE_URL = "/api/v1";
21497
+ const NEETO_AUTH_BASE_URL = (subdomain = "app") => `https://${subdomain}.neetoauth.net`;
21498
+ const ROUTES = {
21499
+ neetoAuthSignup: `${NEETO_AUTH_BASE_URL()}/signups/new`,
21500
+ neetoAuth: NEETO_AUTH_BASE_URL(),
21501
+ loginLink: "/login",
21502
+ profile: "/profile",
21503
+ admin: "/admin",
21504
+ myProfile: "/my/profile",
21505
+ authSettings: "/settings",
21506
+ webhooks: "/webhooks",
21507
+ login: `${BASE_URL}/login`,
21508
+ signup: `${BASE_URL}/signups`,
21509
+ subdomainAvailability: `${BASE_URL}/subdomain_availability`,
21510
+ countries: `${BASE_URL}/countries`,
21511
+ neetoApps: `${BASE_URL}/neeto_apps`,
21512
+ directUploads: "/direct_uploads",
21513
+ teamMembers: {
21514
+ all: "/team_members*/**",
21515
+ bulkUpdate: "/team_members/teams/bulk_update",
21516
+ index: "/team_members/teams",
21517
+ show: (id) => `/team_members/teams/${id}`,
21518
+ },
21519
+ attachment: `/neeto_editor${BASE_URL}/direct_uploads/attach`,
21520
+ dashboard: "/dashboard",
21521
+ neetoThankYou: "/neeto_thank_you_engine",
21522
+ };
21523
+ const API_ROUTES = {
21524
+ teamMembers: {
21525
+ all: "/team_members*/**",
21526
+ bulkUpdate: "/team_members/teams/bulk_update",
21527
+ index: "/team_members/teams",
21528
+ show: (id) => `/team_members/teams/${id}`,
21529
+ creationStatus: (id) => `/team_members/teams/creation_status/${id}`,
21530
+ },
21531
+ integrations: {
21532
+ zapier: {
21533
+ api_keys: "/neeto_integrations/zapier/api_keys",
21534
+ },
21535
+ },
21536
+ };
21537
+ const THIRD_PARTY_ROUTES = {
21538
+ webhooks: { site: "https://webhook.site/" },
21539
+ slack: {
21540
+ loginWithPassword: (workspace) => `https://${workspace}.slack.com/sign_in_with_password`,
21541
+ },
21542
+ zapier: {
21543
+ login: "https://zapier.com/",
21544
+ logOut: "https://zapier.com/logout",
21545
+ zapEditor: (zapId) => `https://zapier.com/editor/${zapId}`,
21546
+ },
21547
+ google: {
21548
+ signin: "https://accounts.google.com/v3/signin/identifier?hl=en-gb&ifkv=ASKXGp0nW770RS7xin2puSwbGDpGCeaVKDtCgfpEU73fYmhMKbqUjukBQ5x8kdvEVxQ7OvcrnUo8sg&flowName=GlifWebSignIn&flowEntry=ServiceLogin&dsh=S688843923%3A1704795906762870&theme=glif",
21549
+ password: "https://accounts.google.com/v3/signin/challenge/pwd",
21550
+ totpChallenge: "https://accounts.google.com/v3/signin/challenge/totp",
21551
+ challengeSelection: "https://accounts.google.com/v3/signin/challenge/selection",
21552
+ myAccount: "https://myaccount.google.com/",
21553
+ chooseAccount: "accounts.google.com/o/oauth2/auth/oauthchooseaccount",
21554
+ consentScreen: "accounts.google.com/signin/oauth/consent",
21555
+ warningScreen: "accounts.google.com/signin/oauth/warning",
21556
+ additionalInfoScreen: "accounts.google.com/signin/oauth/id",
21557
+ consentSummary: "accounts.google.com/signin/oauth/v2/consentsummary",
21558
+ },
21559
+ };
21560
+ const NEETO_ROUTES = {
21561
+ imageUploader: "/neeto_image_uploader_engine",
21562
+ };
21563
+
21574
21564
  const CHAT_WIDGET_TEXTS = {
21575
21565
  newConversation: "Ask a question",
21576
21566
  welcomeChatBubble: "Hi! I'm here to assist you with any questions you may have. What can I do for you?",
@@ -21666,6 +21656,9 @@ const COMMON_TEXTS = {
21666
21656
  skipCleanup: "SKIP_CLEANUP",
21667
21657
  skipSetup: "SKIP_SETUP",
21668
21658
  };
21659
+ const ORGANIZATION_TEXTS = {
21660
+ subdomainAvailable: "Subdomain is available",
21661
+ };
21669
21662
 
21670
21663
  /* eslint-disable playwright/require-top-level-describe */
21671
21664
  /* eslint-disable playwright/no-standalone-expect */
@@ -21695,12 +21688,8 @@ class HelpAndProfilePage {
21695
21688
  }).toPass({ timeout: 35000 + widgetVisibilityTimeout * 2 });
21696
21689
  };
21697
21690
  this.openAndVerifyChatWidgetV2 = async () => {
21698
- const chatInitializationApis = this.neetoPlaywrightUtilities.interceptMultipleResponses({
21699
- baseUrl: this.chatApiBaseURL,
21700
- times: 3,
21701
- });
21702
21691
  await this.page.reload();
21703
- await chatInitializationApis;
21692
+ await this.neetoPlaywrightUtilities.waitForPageLoad();
21704
21693
  await test$1.test.step("Step 1: Open live chat and verify iframe", this.openLiveChatAndVerify);
21705
21694
  await test$1.test.step("Step 2: Close and reopen live chat frame", async () => {
21706
21695
  await this.page.getByTestId(CHAT_WIDGET_SELECTORS.closeChat).click();
@@ -23699,12 +23688,8 @@ class IntegrationBase {
23699
23688
  };
23700
23689
  this.gotoIntegrationIndex = async () => {
23701
23690
  if (neetoCist.isNotEmpty(this.integrationRouteIndex)) {
23702
- const integrationIndexPromise = this.neetoPlaywrightUtilities.interceptMultipleResponses({
23703
- times: 0,
23704
- ...this.integrationRouteResponsesParams,
23705
- });
23706
23691
  await this.page.goto(this.integrationRouteIndex, { timeout: 20000 });
23707
- await integrationIndexPromise;
23692
+ await this.neetoPlaywrightUtilities.waitForPageLoad();
23708
23693
  }
23709
23694
  };
23710
23695
  this.page = page;
@@ -23739,13 +23724,12 @@ class GooglePage extends IntegrationBase {
23739
23724
  await this.selectGoogleAccount(appName);
23740
23725
  if (process.env.TEST_ENV === ENVIRONMENT.staging) {
23741
23726
  await this.stagingConsentFlow();
23727
+ return;
23742
23728
  }
23743
- else {
23744
- await this.page.waitForURL(new RegExp(THIRD_PARTY_ROUTES.google.consentScreen));
23745
- await this.page
23746
- .getByRole("button", { name: GOOGLE_LOGIN_TEXTS.allow })
23747
- .click();
23748
- }
23729
+ await this.page.waitForURL(new RegExp(THIRD_PARTY_ROUTES.google.consentScreen));
23730
+ await this.page
23731
+ .getByRole("button", { name: GOOGLE_LOGIN_TEXTS.allow })
23732
+ .click();
23749
23733
  };
23750
23734
  this.selectGoogleAccount = async (appName) => {
23751
23735
  const neetoAutomationLocator = this.page.getByRole("link", {
@@ -23756,16 +23740,17 @@ class GooglePage extends IntegrationBase {
23756
23740
  const verificationCode = this.page
23757
23741
  .locator("form")
23758
23742
  .getByText(GOOGLE_LOGIN_TEXTS.verificationCode);
23759
- if (this.page.url().includes(THIRD_PARTY_ROUTES.google.totpChallenge)) {
23760
- await this.enterTotpCode(verificationCode);
23761
- }
23743
+ this.page.url().includes(THIRD_PARTY_ROUTES.google.totpChallenge) &&
23744
+ (await this.enterTotpCode(verificationCode));
23762
23745
  await this.handleNotVerifiedPage();
23763
- await test$1.expect(this.page.getByRole("heading", {
23746
+ const signInHeading = this.page.getByRole("heading", {
23764
23747
  name: GOOGLE_LOGIN_TEXTS.signInHeading(appName),
23765
- })).toBeVisible();
23748
+ });
23749
+ await test$1.expect(signInHeading).toBeVisible();
23766
23750
  await this.page
23767
23751
  .getByRole("button", { name: GOOGLE_LOGIN_TEXTS.continue })
23768
23752
  .click();
23753
+ await test$1.expect(signInHeading).toBeHidden({ timeout: 10000 });
23769
23754
  };
23770
23755
  this.loginToGoogle = async () => {
23771
23756
  await this.page.goto(THIRD_PARTY_ROUTES.google.signin, { timeout: 20000 });
@@ -23788,11 +23773,10 @@ class GooglePage extends IntegrationBase {
23788
23773
  await this.page
23789
23774
  .getByRole("button", { name: GOOGLE_LOGIN_TEXTS.next })
23790
23775
  .click();
23791
- if (this.page.url().includes(THIRD_PARTY_ROUTES.google.challengeSelection)) {
23792
- await this.page
23776
+ this.page.url().includes(THIRD_PARTY_ROUTES.google.challengeSelection) &&
23777
+ (await this.page
23793
23778
  .locator(GOOGLE_LOGIN_SELECTORS.totpChallengeSelector)
23794
- .click();
23795
- }
23779
+ .click());
23796
23780
  await this.page.waitForURL(new RegExp(THIRD_PARTY_ROUTES.google.totpChallenge));
23797
23781
  const twoStepVerification = this.page.locator("form").getByRole("heading", {
23798
23782
  name: GOOGLE_LOGIN_TEXTS.twoStepVerification,
@@ -23829,11 +23813,10 @@ class GooglePage extends IntegrationBase {
23829
23813
  };
23830
23814
  this.stagingConsentFlow = async ({ abortFlow = false, allowPermissions = true, } = {}) => {
23831
23815
  await this.handleNotVerifiedPage();
23832
- if (this.page.url().includes(THIRD_PARTY_ROUTES.google.additionalInfoScreen)) {
23833
- await this.page
23816
+ this.page.url().includes(THIRD_PARTY_ROUTES.google.additionalInfoScreen) &&
23817
+ (await this.page
23834
23818
  .getByRole("button", { name: GOOGLE_LOGIN_TEXTS.continue })
23835
- .click({ timeout: 20000 });
23836
- }
23819
+ .click({ timeout: 20000 }));
23837
23820
  await this.page.waitForURL(new RegExp(THIRD_PARTY_ROUTES.google.consentSummary));
23838
23821
  if (abortFlow) {
23839
23822
  await this.page
@@ -23939,39 +23922,33 @@ class SlackPage extends IntegrationBase {
23939
23922
  await this.disconnect();
23940
23923
  await this.verifyIntegrationStatus("disconnected");
23941
23924
  };
23942
- this.updateConfigureSlackChannel = async ({ newSlackChannel = "random", interceptMultipleResponsesParams = {}, refreshInterceptMultipleResponsesParams = {}, refreshChannelList = false, }) => {
23925
+ this.updateConfigureSlackChannel = async ({ newSlackChannel = "random",
23926
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
23927
+ interceptMultipleResponsesParams = {},
23928
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
23929
+ refreshInterceptMultipleResponsesParams = {}, refreshChannelList = false, }) => {
23943
23930
  await this.page.getByTestId(INTEGRATION_SELECTORS.manageButton).click();
23944
23931
  await this.page
23945
23932
  .getByRole("button", { name: this.t("neetoSlack.common.edit") })
23946
23933
  .click();
23947
- if (refreshChannelList) {
23948
- await this.clickOnChannelListRefreshButton(refreshInterceptMultipleResponsesParams);
23949
- }
23934
+ refreshChannelList && (await this.clickOnChannelListRefreshButton());
23950
23935
  await this.page.getByTestId(COMMON_SELECTORS.selectContainer).click();
23951
23936
  await this.page
23952
23937
  .getByTestId(COMMON_SELECTORS.dropdownMenu)
23953
23938
  .getByText(newSlackChannel)
23954
23939
  .click();
23955
- const savePromise = this.neetoPlaywrightUtilities.interceptMultipleResponses({
23956
- times: 0,
23957
- ...interceptMultipleResponsesParams,
23958
- });
23959
- await this.page
23960
- .getByRole("button", { name: this.t("neetoSlack.common.save") })
23961
- .click();
23962
- await savePromise;
23940
+ await this.neetoPlaywrightUtilities.saveChanges();
23963
23941
  };
23964
- this.clickOnChannelListRefreshButton = async (refreshInterceptMultipleResponsesParams) => {
23965
- const refreshChannelPromise = this.neetoPlaywrightUtilities.interceptMultipleResponses({
23966
- times: 0,
23967
- ...refreshInterceptMultipleResponsesParams,
23968
- });
23942
+ this.clickOnChannelListRefreshButton = async () => {
23943
+ //Use getByTestId when this issue https://github.com/bigbinary/neeto-slack-nano/issues/438 is resolved
23969
23944
  await this.page
23970
23945
  .getByRole("button", {
23971
23946
  name: this.t("neetoSlack.slack.channelListRefreshButton"),
23972
23947
  })
23973
23948
  .click();
23974
- await refreshChannelPromise;
23949
+ await this.neetoPlaywrightUtilities.verifyToast({
23950
+ message: this.t("neetoSlack.slack.channelListRefreshToastr"),
23951
+ });
23975
23952
  };
23976
23953
  this.loginToSlackWebapp = async (slackWebappPage, customCredentials) => {
23977
23954
  this.slackWebappPage = slackWebappPage;
@@ -23994,10 +23971,9 @@ class SlackPage extends IntegrationBase {
23994
23971
  .locator(SLACK_SELECTORS.redirectOpenInBrowser)
23995
23972
  .click();
23996
23973
  await this.setupCloseHandlers(slackWebappPage);
23974
+ return;
23997
23975
  }
23998
- else {
23999
- throw new Error("ENV variable SLACK_LOGIN_EMAIL or SLACK_LOGIN_PASSWORD or SLACK_WORKSPACE is not defined.");
24000
- }
23976
+ throw new Error("ENV variable SLACK_LOGIN_EMAIL or SLACK_LOGIN_PASSWORD or SLACK_WORKSPACE is not defined.");
24001
23977
  };
24002
23978
  this.logoutFromSlackWebApp = async () => {
24003
23979
  await this.slackWebappPage
@@ -24641,9 +24617,6 @@ class EditorPage {
24641
24617
  const fileUploader = await fileUploaderPromise;
24642
24618
  const imagePath = Path__namespace.join(__dirname, filePath);
24643
24619
  await fileUploader.setFiles(imagePath);
24644
- await this.neetoPlaywrightUtilities.interceptMultipleResponses({
24645
- responseUrl: ROUTES.attachment,
24646
- });
24647
24620
  await test$1.expect(this.attachmentPreview).toBeVisible();
24648
24621
  if (shouldRemoveAttachment) {
24649
24622
  await this.attachmentPreview
@@ -24858,13 +24831,9 @@ class EditorPage {
24858
24831
  class ImageUploader {
24859
24832
  constructor(page, neetoPlaywrightUtilities) {
24860
24833
  this.submitCroppedImage = async () => {
24861
- const cropImage = this.neetoPlaywrightUtilities.interceptMultipleResponses({
24862
- responseUrl: ROUTES.directUploads,
24863
- });
24864
24834
  await this.page
24865
24835
  .getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.cropSubmitButton)
24866
24836
  .click();
24867
- await cropImage;
24868
24837
  };
24869
24838
  this.removeImage = async () => {
24870
24839
  await this.page
@@ -24928,13 +24897,9 @@ class ImageUploader {
24928
24897
  };
24929
24898
  this.selectImageFromWeb = async ({ nthImage = 0, searchTerm = "", toggleOrginalImage = false, toggleAspectRatioLock = false, aspectRatioHeight = "9", aspectRatioWidth = "16", width = "100", height = "100", } = {}) => {
24930
24899
  await this.openImageLibrary();
24931
- const switchImageTab = this.neetoPlaywrightUtilities.interceptMultipleResponses({
24932
- responseUrl: NEETO_ROUTES.imageUploader,
24933
- });
24934
24900
  await this.page
24935
24901
  .getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.unsplashTab)
24936
24902
  .click();
24937
- await switchImageTab;
24938
24903
  if (neetoCist.isNotEmpty(searchTerm)) {
24939
24904
  await this.page
24940
24905
  .getByTestId(NEETO_IMAGE_UPLOADER_SELECTORS.unsplashSearchInput)
@@ -25033,17 +24998,15 @@ class TeamMembers {
25033
24998
  await this.neetoPlaywrightUtilities.waitForPageLoad();
25034
24999
  await this.neetoPlaywrightUtilities.verifyToast();
25035
25000
  };
25036
- this.searchAndVerifyMemberByEmail = async ({ email, interceptOptions = {}, }) => {
25037
- const searchMembers = this.neetoPlaywrightUtilities.interceptMultipleResponses({
25038
- responseUrl: API_ROUTES.teamMembers.index,
25039
- ...interceptOptions,
25040
- });
25001
+ this.searchAndVerifyMemberByEmail = async ({ email,
25002
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
25003
+ interceptOptions = {}, }) => {
25041
25004
  await this.page.getByTestId(MEMBER_SELECTORS.searchTextField).fill(email);
25042
- await searchMembers;
25043
25005
  const emailSubstr = email.length > 20 ? email.substring(0, 20) : email;
25044
25006
  await test$1.expect(this.page.getByTestId(NEETO_FILTERS_SELECTORS.searchTermBlock)).toContainText(emailSubstr);
25007
+ await this.neetoPlaywrightUtilities.waitForPageLoad();
25008
+ await test$1.expect(this.page.locator(COMMON_SELECTORS.tableSpinner)).toBeHidden();
25045
25009
  await test$1.expect(this.page.getByRole("cell", { name: email, exact: true })).toBeVisible();
25046
- await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.tableSpinner)).toBeHidden();
25047
25010
  };
25048
25011
  this.editMemberViaUI = async ({ email = "", firstName = "", lastName = "", role = "standard", } = {}) => {
25049
25012
  await this.page.getByTestId(MEMBER_SELECTORS.dropDownIcon).click();
@@ -25080,13 +25043,9 @@ class TeamMembers {
25080
25043
  .getByTestId(COMMON_SELECTORS.actionSelectIndicator)
25081
25044
  .click();
25082
25045
  for (const option of selectedOptions) {
25083
- const fetchMembers = this.neetoPlaywrightUtilities.interceptMultipleResponses({
25084
- responseUrl: API_ROUTES.teamMembers.index,
25085
- });
25086
25046
  await this.page
25087
25047
  .getByTestId(COMMON_SELECTORS.selectOption(option))
25088
25048
  .click();
25089
- await fetchMembers;
25090
25049
  }
25091
25050
  };
25092
25051
  this.filterMembers = async ({ email = { id: "", condition: "Is" }, roles = [], name = "", }) => {
@@ -25099,23 +25058,14 @@ class TeamMembers {
25099
25058
  await this.page
25100
25059
  .getByTestId(COMMON_SELECTORS.selectOption(email.condition))
25101
25060
  .click();
25102
- const fetchMembers = this.neetoPlaywrightUtilities.interceptMultipleResponses({
25103
- responseUrl: API_ROUTES.teamMembers.index,
25104
- });
25105
25061
  await this.page
25106
25062
  .getByTestId(NEETO_FILTERS_SELECTORS.filtersEmailFilter)
25107
25063
  .fill(email.id);
25108
- await fetchMembers;
25109
25064
  }
25110
- if (neetoCist.isPresent(name)) {
25111
- const fetchMembers = this.neetoPlaywrightUtilities.interceptMultipleResponses({
25112
- responseUrl: API_ROUTES.teamMembers.index,
25113
- });
25114
- await this.page
25065
+ neetoCist.isPresent(name) &&
25066
+ (await this.page
25115
25067
  .getByTestId(NEETO_FILTERS_SELECTORS.neetoFiltersNameFilterField)
25116
- .fill(name);
25117
- await fetchMembers;
25118
- }
25068
+ .fill(name));
25119
25069
  neetoCist.isPresent(roles) &&
25120
25070
  (await this.filterMembersByMultiSelect({ selectedOptions: roles }));
25121
25071
  await this.page
@@ -25163,7 +25113,8 @@ class TeamMembers {
25163
25113
  .getByTestId(TABLE_SELECTORS.columnMenuButton)
25164
25114
  .click();
25165
25115
  await this.page.getByRole("button", { name: actionButtonText }).click();
25166
- await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.tableSpinner)).toBeHidden();
25116
+ await this.neetoPlaywrightUtilities.waitForPageLoad();
25117
+ await test$1.expect(this.page.locator(COMMON_SELECTORS.tableSpinner)).toBeHidden();
25167
25118
  };
25168
25119
  this.toggleMemberColumns = async ({ columns = [], bulkAction, }) => {
25169
25120
  await this.page.getByTestId(COMMON_SELECTORS.columnsDropdownButton).click();
@@ -25196,7 +25147,9 @@ class TeamMembers {
25196
25147
  }
25197
25148
  }
25198
25149
 
25199
- const loginWithoutSSO = async ({ page, neetoPlaywrightUtilities, loginPath = "/", }) => {
25150
+ const loginWithoutSSO = async ({ page,
25151
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
25152
+ neetoPlaywrightUtilities, loginPath = "/", }) => {
25200
25153
  if (shouldSkipSetupAndTeardown())
25201
25154
  return;
25202
25155
  await page.goto(loginPath, { timeout: 20000 });
@@ -25206,11 +25159,9 @@ const loginWithoutSSO = async ({ page, neetoPlaywrightUtilities, loginPath = "/"
25206
25159
  await page
25207
25160
  .getByTestId(LOGIN_SELECTORS.passwordTextField)
25208
25161
  .fill(CREDENTIALS.password);
25209
- const login = neetoPlaywrightUtilities.interceptMultipleResponses({
25210
- times: 1,
25211
- });
25212
- await page.getByTestId(LOGIN_SELECTORS.submitButton).click();
25213
- await login;
25162
+ const submitButton = page.getByTestId(LOGIN_SELECTORS.submitButton);
25163
+ await submitButton.click();
25164
+ await test$1.expect(submitButton).toBeHidden({ timeout: 15000 });
25214
25165
  const userCredentials = readFileSyncIfExists();
25215
25166
  await page.context().storageState({ path: STORAGE_STATE });
25216
25167
  const mergedCredentials = ramda.mergeAll([readFileSyncIfExists(), userCredentials]);
@@ -25244,14 +25195,11 @@ class OrganizationPage {
25244
25195
  isNeetoAuth
25245
25196
  ? await this.page.goto(ROUTES.neetoAuthSignup, { timeout: 20000 })
25246
25197
  : await this.page.goto(`${ROUTES.neetoAuthSignup}?redirect_uri=${appNameInLowerCase}.net/admin`, { timeout: 20000 });
25198
+ const submitButton = this.page.getByTestId(SIGNUP_SELECTORS.submitButton);
25247
25199
  await this.page.getByTestId(SIGNUP_SELECTORS.emailTextField).fill(email);
25248
- const signup = this.neetoPlaywrightUtilities.interceptMultipleResponses({
25249
- responseUrl: ROUTES.signup,
25250
- timeout: 60 * 1000,
25251
- baseUrl: NEETO_AUTH_BASE_URL(),
25252
- });
25253
- await this.page.getByTestId(SIGNUP_SELECTORS.submitButton).click();
25254
- await signup;
25200
+ await submitButton.click();
25201
+ await test$1.expect(submitButton).toBeHidden({ timeout: 30000 });
25202
+ await this.neetoPlaywrightUtilities.waitForPageLoad();
25255
25203
  await this.page.getByTestId(SIGNUP_SELECTORS.otpTextBox).fill(defaultOtp);
25256
25204
  await this.fillOrganizationDetails({
25257
25205
  credentials: {
@@ -25303,15 +25251,9 @@ class OrganizationPage {
25303
25251
  if (subdomainErrorCount !== 0) {
25304
25252
  const subdomainErrorText = await subdomainError.innerText();
25305
25253
  const newOrganizationName = extractSubdomainFromError(subdomainErrorText);
25306
- const subdomainAvailability = this.neetoPlaywrightUtilities.interceptMultipleResponses({
25307
- responseUrl: ROUTES.subdomainAvailability,
25308
- timeout: 60 * 1000,
25309
- baseUrl: NEETO_AUTH_BASE_URL(),
25310
- });
25311
25254
  await this.page
25312
25255
  .getByTestId(SIGNUP_SELECTORS.subdomainNameTextField)
25313
25256
  .fill(newOrganizationName);
25314
- await subdomainAvailability;
25315
25257
  subdomainErrorCount = await subdomainError.count();
25316
25258
  if (subdomainErrorCount === 0) {
25317
25259
  updateCredentials({
@@ -25354,15 +25296,10 @@ class OrganizationPage {
25354
25296
  .fill(lastName);
25355
25297
  country && (await this.changeCountry(country));
25356
25298
  await this.page.getByTestId(COMMON_SELECTORS.checkbox).click();
25357
- const submitProfile = this.neetoPlaywrightUtilities.interceptMultipleResponses({
25358
- customPageContext: this.page,
25359
- responseUrl: ROUTES.signup,
25360
- baseUrl: NEETO_AUTH_BASE_URL(),
25361
- timeout: 60000,
25362
- });
25363
- await this.page.getByTestId(SIGNUP_SELECTORS.profileSubmitButton).click();
25364
- await submitProfile;
25365
- await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.pageLoader)).toBeHidden({ timeout: 15000 });
25299
+ const profileSubmitButton = this.page.getByTestId(SIGNUP_SELECTORS.profileSubmitButton);
25300
+ await profileSubmitButton.click();
25301
+ await test$1.expect(profileSubmitButton).toBeHidden({ timeout: 45000 });
25302
+ await this.neetoPlaywrightUtilities.waitForPageLoad();
25366
25303
  };
25367
25304
  this.loginAndOnboard = async ({ email, firstName, lastName, country, handleOnboarding, baseURL = process.env.BASE_URL, }) => {
25368
25305
  await this.page.goto(`${baseURL}${ROUTES.admin}`, { timeout: 20000 });
@@ -25379,13 +25316,9 @@ class OrganizationPage {
25379
25316
  await this.page
25380
25317
  .getByTestId(SIGNUP_SELECTORS.emailTextField)
25381
25318
  .fill(credentials.email);
25382
- const signup = this.neetoPlaywrightUtilities.interceptMultipleResponses({
25383
- responseUrl: ROUTES.signup,
25384
- timeout: 60 * 1000,
25385
- baseUrl: NEETO_AUTH_BASE_URL(),
25386
- });
25387
- await this.page.getByTestId(SIGNUP_SELECTORS.submitButton).click();
25388
- await signup;
25319
+ const submitButton = this.page.getByTestId(SIGNUP_SELECTORS.submitButton);
25320
+ await submitButton.click();
25321
+ await test$1.expect(submitButton).toBeHidden({ timeout: 10000 });
25389
25322
  if (fetchOtpFromEmail !== undefined) {
25390
25323
  otp = await fetchOtpFromEmail({
25391
25324
  email: credentials.email,
@@ -25402,35 +25335,27 @@ class OrganizationPage {
25402
25335
  return { STORAGE_STATE, baseURL: process.env.BASE_URL };
25403
25336
  };
25404
25337
  this.fillOrganizationDetails = async ({ credentials, appName, }) => {
25338
+ const subdomainError = this.page.getByTestId(SIGNUP_SELECTORS.subdomainError);
25339
+ const organizationSubmitButton = this.page.getByTestId(SIGNUP_SELECTORS.organizationSubmitButton);
25405
25340
  await this.page
25406
25341
  .getByTestId(SIGNUP_SELECTORS.organizationNameTextField)
25407
25342
  .fill(neetoCist.humanize(credentials.businessName));
25408
- const fetchSubdomainAvailability = this.neetoPlaywrightUtilities.interceptMultipleResponses({
25409
- responseUrl: ROUTES.subdomainAvailability,
25410
- timeout: 60 * 1000,
25411
- baseUrl: NEETO_AUTH_BASE_URL(),
25412
- });
25413
25343
  await this.page
25414
25344
  .getByTestId(SIGNUP_SELECTORS.subdomainNameTextField)
25415
25345
  .fill(credentials.subdomainName);
25416
- await fetchSubdomainAvailability;
25417
- const subdomainError = this.page.getByTestId(SIGNUP_SELECTORS.subdomainError);
25418
25346
  const subdomainErrorCount = await subdomainError.count();
25419
- if (subdomainErrorCount !== 0) {
25420
- await this.updateSubdomainIfExists(appName);
25421
- }
25422
- const fetchProfile = this.neetoPlaywrightUtilities.interceptMultipleResponses({
25423
- times: 2,
25424
- timeout: 60 * 1000,
25425
- baseUrl: NEETO_AUTH_BASE_URL(),
25426
- });
25427
- await this.page
25428
- .getByTestId(SIGNUP_SELECTORS.organizationSubmitButton)
25429
- .click();
25430
- await fetchProfile;
25431
- await this.page.waitForURL(`**${ROUTES.profile}`, {
25432
- timeout: 60 * 1000,
25347
+ subdomainErrorCount !== 0 && (await this.updateSubdomainIfExists(appName));
25348
+ //TODO: Use getByTestId when this issue https://github.com/bigbinary/neeto-auth-web/issues/6460 is resolved
25349
+ await test$1.expect(this.page.getByTitle(ORGANIZATION_TEXTS.subdomainAvailable)).toBeVisible({
25350
+ timeout: 45000,
25433
25351
  });
25352
+ await organizationSubmitButton.click();
25353
+ await Promise.all([
25354
+ test$1.expect(organizationSubmitButton).toBeHidden({ timeout: 45 * 1000 }),
25355
+ this.page.waitForURL(`**${ROUTES.profile}`, {
25356
+ timeout: 45 * 1000,
25357
+ }),
25358
+ ]);
25434
25359
  await this.setupProfile({
25435
25360
  firstName: credentials.firstName,
25436
25361
  lastName: credentials.lastName,
@@ -25748,7 +25673,9 @@ class TagsPage {
25748
25673
  await this.page.getByTestId(TAGS_SELECTORS.searchTextField).fill(tagName);
25749
25674
  await test$1.expect(this.page.getByRole("row", { name: tagName })).toBeVisible();
25750
25675
  };
25751
- this.addTagViaUI = async ({ tagName, addTagsLabel, tagsResponseUrl, }) => {
25676
+ this.addTagViaUI = async ({ tagName, addTagsLabel,
25677
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
25678
+ tagsResponseUrl, }) => {
25752
25679
  await this.page
25753
25680
  .getByTestId(COMMON_SELECTORS.header)
25754
25681
  .getByTestId(TAGS_SELECTORS.newTagButton)
@@ -25758,11 +25685,7 @@ class TagsPage {
25758
25685
  await this.page
25759
25686
  .getByTestId(TAGS_SELECTORS.descriptionTextArea)
25760
25687
  .fill(faker.faker.lorem.word(7));
25761
- const waitForSave = this.neetoPlaywrightUtilities.interceptMultipleResponses({
25762
- responseUrl: tagsResponseUrl,
25763
- });
25764
25688
  await this.page.getByTestId(TAGS_SELECTORS.submitButton).click();
25765
- await waitForSave;
25766
25689
  await this.neetoPlaywrightUtilities.verifyToast();
25767
25690
  await this.searchAndVerifyTags(tagName);
25768
25691
  };
@@ -159096,6 +159019,7 @@ exports.NEETO_FILTERS_SELECTORS = NEETO_FILTERS_SELECTORS;
159096
159019
  exports.NEETO_IMAGE_UPLOADER_SELECTORS = NEETO_IMAGE_UPLOADER_SELECTORS;
159097
159020
  exports.NEETO_ROUTES = NEETO_ROUTES;
159098
159021
  exports.NEETO_TEXT_MODIFIER_SELECTORS = NEETO_TEXT_MODIFIER_SELECTORS;
159022
+ exports.ORGANIZATION_TEXTS = ORGANIZATION_TEXTS;
159099
159023
  exports.OTP_EMAIL_PATTERN = OTP_EMAIL_PATTERN;
159100
159024
  exports.OrganizationPage = OrganizationPage;
159101
159025
  exports.PLURAL = PLURAL;