@bigbinary/neeto-playwright-commons 1.13.13 → 1.13.14

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.d.ts CHANGED
@@ -34,6 +34,7 @@ interface VerifyToastParams {
34
34
  timeout?: number;
35
35
  closeAfterVerification: boolean;
36
36
  toastType: "success" | "error";
37
+ customPageContext?: Page;
37
38
  }
38
39
  interface VerifyHelpPopoverProps {
39
40
  triggerElement?: Locator;
@@ -195,7 +196,9 @@ declare class CustomCommands {
195
196
  *
196
197
  * toastType(optional): Type of toast. It takes either success or error as it's value. Default is success.
197
198
  *
198
- * timeout(optional): Timeout in milliseconds to wait for the toast to appear. Default is 10_000
199
+ * timeout(optional): Timeout in milliseconds to wait for the toast to appear. Default is 10_000.
200
+ *
201
+ * customPageContext(optional): Custom page context on which to verify the toast.
199
202
  *
200
203
  * @example
201
204
  *
@@ -204,6 +207,7 @@ declare class CustomCommands {
204
207
  * closeAfterVerification: false,
205
208
  * toastType: "error",
206
209
  * timeout: 20_000,
210
+ * customPageContext: this.page,
207
211
  * });
208
212
  * @endexample
209
213
  */
@@ -211,7 +215,8 @@ declare class CustomCommands {
211
215
  message,
212
216
  toastType,
213
217
  closeAfterVerification,
214
- timeout
218
+ timeout,
219
+ customPageContext
215
220
  }?: Partial<VerifyToastParams>) => Promise<void>;
216
221
  /**
217
222
  *
package/index.js CHANGED
@@ -3882,13 +3882,13 @@ class CustomCommands {
3882
3882
  (await this.page.getByTestId(COMMON_SELECTORS.toastCloseButton).click());
3883
3883
  await expect(this.page.locator(COMMON_SELECTORS.toastIcon)).toBeHidden();
3884
3884
  };
3885
- this.verifyToast = async ({ message = "", toastType = "success", closeAfterVerification = true, timeout = 10000, } = {}) => {
3886
- const toastrCloseButton = this.page.getByTestId(COMMON_SELECTORS.toastCloseButton);
3885
+ this.verifyToast = async ({ message = "", toastType = "success", closeAfterVerification = true, timeout = 10000, customPageContext = this.page, } = {}) => {
3886
+ const toastrCloseButton = customPageContext.getByTestId(COMMON_SELECTORS.toastCloseButton);
3887
3887
  if (!isEmpty$1(message)) {
3888
- await expect(this.page.getByTestId(COMMON_SELECTORS.toastMessage(toastType))).toContainText(message, { timeout });
3888
+ await expect(customPageContext.getByTestId(COMMON_SELECTORS.toastMessage(toastType))).toContainText(message, { timeout });
3889
3889
  }
3890
3890
  else {
3891
- await expect(this.page.locator(COMMON_SELECTORS.toastIcon)).toContainText("👍", { timeout });
3891
+ await expect(customPageContext.locator(COMMON_SELECTORS.toastIcon)).toContainText("👍", { timeout });
3892
3892
  }
3893
3893
  if (closeAfterVerification && (await toastrCloseButton.isVisible())) {
3894
3894
  await toastrCloseButton.click();
@@ -21248,10 +21248,15 @@ class EmbedBase {
21248
21248
  this.clickOnPopupButton = async (popUpButtonSelectorOptions) => {
21249
21249
  const popUpButton = this.embedTestPage.getByRole(this.embedTestPageType === "floatingPopup" ? "button" : "link", popUpButtonSelectorOptions);
21250
21250
  await expect(popUpButton).toBeVisible();
21251
- await popUpButton.click();
21252
- await expect(this.embedTestPage.locator(EMBED_SELECTORS.loader(this.appName))).toBeHidden({
21253
- timeout: 40000,
21254
- });
21251
+ await expect(async () => {
21252
+ await popUpButton.click();
21253
+ await expect(this.embedTestPage.locator(EMBED_SELECTORS.loader(this.appName))).toBeHidden({
21254
+ timeout: 40000,
21255
+ });
21256
+ await expect(this.embedTestPage.locator(EMBED_SELECTORS.iframe(this.appName))).toBeVisible({
21257
+ timeout: 10000,
21258
+ });
21259
+ }).toPass({ timeout: 2 * 60 * 1000 });
21255
21260
  };
21256
21261
  this.copyEmbedScript = async ({ embedLabel }) => {
21257
21262
  await this.page
@@ -23696,12 +23701,14 @@ class SlackPage extends IntegrationBase {
23696
23701
  .textContent()) || "";
23697
23702
  await allowButton.click();
23698
23703
  await this.page.waitForURL(redirectUrl);
23699
- await expect(this.page.getByTestId(COMMON_SELECTORS.pageLoader)).toBeHidden({ timeout: 10000 });
23704
+ await this.neetoPlaywrightUtilities.waitForPageLoad({
23705
+ visibilityTimeout: 10000,
23706
+ });
23700
23707
  await expect(this.page.getByRole("heading", {
23701
23708
  name: this.t("neetoSlack.slack.configure.title", {
23702
23709
  teamName: currentWorkspace,
23703
23710
  }),
23704
- })).toBeVisible();
23711
+ })).toBeVisible({ timeout: 10000 });
23705
23712
  await this.neetoPlaywrightUtilities.selectOptionFromDropdown({
23706
23713
  value: channelToConfigure,
23707
23714
  });
@@ -24674,7 +24681,12 @@ class TeamMembers {
24674
24681
  }
24675
24682
  // eslint-disable-next-line playwright/no-standalone-expect
24676
24683
  await expect(async () => {
24677
- await this.page.getByTestId(MEMBER_SELECTORS.submitButton).click();
24684
+ const submitButton = this.page.getByTestId(MEMBER_SELECTORS.submitButton);
24685
+ await submitButton.click();
24686
+ // eslint-disable-next-line playwright/no-standalone-expect
24687
+ await expect(submitButton.locator(COMMON_SELECTORS.buttonSpinner)).toBeHidden({
24688
+ timeout: 15000,
24689
+ });
24678
24690
  // eslint-disable-next-line playwright/no-standalone-expect
24679
24691
  await expect(this.page.getByTestId(COMMON_SELECTORS.paneBody)).toBeHidden();
24680
24692
  }).toPass({ timeout: 40000 });