@bigbinary/neeto-playwright-commons 3.2.1 → 3.2.2

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
@@ -31,6 +31,7 @@ interface ExecuteRecursivelyParams {
31
31
  interface VerifyToastParams {
32
32
  message: string;
33
33
  timeout?: number;
34
+ toastCloseTimeout?: number;
34
35
  closeAfterVerification: boolean;
35
36
  toastType: "success" | "error";
36
37
  customPageContext?: Page;
@@ -219,6 +220,8 @@ declare class CustomCommands {
219
220
  *
220
221
  * timeout(optional): Timeout in milliseconds to wait for the toast to appear. Default is 10_000.
221
222
  *
223
+ * toastCloseTimeout(optional): Timeout in milliseconds to wait for the toast to disappear after closing. Default is 10_000.
224
+ *
222
225
  * customPageContext(optional): Custom page context on which to verify the toast.
223
226
  *
224
227
  * @example
@@ -228,6 +231,7 @@ declare class CustomCommands {
228
231
  * closeAfterVerification: false,
229
232
  * toastType: "error",
230
233
  * timeout: 20_000,
234
+ * toastCloseTimeout: 15_000,
231
235
  * customPageContext: this.page,
232
236
  * });
233
237
  * @endexample
@@ -237,6 +241,7 @@ declare class CustomCommands {
237
241
  toastType,
238
242
  closeAfterVerification,
239
243
  timeout,
244
+ toastCloseTimeout,
240
245
  customPageContext
241
246
  }?: Partial<VerifyToastParams>) => Promise<void>;
242
247
  /**
package/index.js CHANGED
@@ -6050,7 +6050,7 @@ class CustomCommands {
6050
6050
  const startTime = Date.now();
6051
6051
  return await this.recursiveMethod(callback, condition, timeout, startTime, 1);
6052
6052
  };
6053
- verifyToast = async ({ message = "", toastType = "success", closeAfterVerification = true, timeout = 10_000, customPageContext = this.page, } = {}) => {
6053
+ verifyToast = async ({ message = "", toastType = "success", closeAfterVerification = true, timeout = 10_000, toastCloseTimeout = 10_000, customPageContext = this.page, } = {}) => {
6054
6054
  // React-toastify does not support adding data-* attributes to toast DOM elements: https://github.com/fkhadra/react-toastify/issues/1106
6055
6055
  const toastrLocator = customPageContext
6056
6056
  .locator(COMMON_SELECTORS.neetoUiToastr)
@@ -6071,7 +6071,9 @@ class CustomCommands {
6071
6071
  await customPageContext.evaluate(button => {
6072
6072
  button.dispatchEvent(new Event("click", { bubbles: true }));
6073
6073
  }, buttonHandle);
6074
- await expect(toastrCloseButton).toBeHidden({ timeout: 10_000 });
6074
+ await expect(toastrCloseButton).toBeHidden({
6075
+ timeout: toastCloseTimeout,
6076
+ });
6075
6077
  }
6076
6078
  };
6077
6079
  waitForPageLoad = async ({ visibilityTimeout = 35_000, customPageContext = this.page, waitForOption = "serial", } = {}) => {