@bigbinary/neeto-playwright-commons 1.9.21 → 1.9.22

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
@@ -359,6 +359,7 @@ const COMMON_SELECTORS = {
359
359
  actionSelectIndicator: "action-select-indicator",
360
360
  takeActionDropdown: "take-action-dropdown-icon",
361
361
  columnsSearchInput: "neeto-ui-columns-search",
362
+ errorToastIcon: "error-toast-icon",
362
363
  };
363
364
 
364
365
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
@@ -3473,6 +3474,9 @@ class CustomCommands {
3473
3474
  const startTime = Date.now();
3474
3475
  await this.recursiveMethod(callback, condition, timeout, startTime);
3475
3476
  };
3477
+ /**
3478
+ * @deprecated Use verifyToast instead.
3479
+ */
3476
3480
  this.verifySuccessToast = async ({ message = "", closeAfterVerification = true, } = {}) => {
3477
3481
  if (!ramda.isEmpty(message)) {
3478
3482
  await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.toastMessage)).toContainText(message);
@@ -3484,6 +3488,22 @@ class CustomCommands {
3484
3488
  (await this.page.getByTestId(COMMON_SELECTORS.toastCloseButton).click());
3485
3489
  await test$1.expect(this.page.locator(COMMON_SELECTORS.toastIcon)).toBeHidden();
3486
3490
  };
3491
+ this.verifyToast = async ({ message = "", toastType = "success", closeAfterVerification = true, } = {}) => {
3492
+ if (toastType === "error") {
3493
+ await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.errorToastIcon)).toBeVisible({ timeout: 10000 });
3494
+ }
3495
+ const toastrCloseButton = this.page.getByTestId(COMMON_SELECTORS.toastCloseButton);
3496
+ if (!ramda.isEmpty(message)) {
3497
+ await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.toastMessage)).toContainText(message, { timeout: 10000 });
3498
+ }
3499
+ else {
3500
+ await test$1.expect(this.page.locator(COMMON_SELECTORS.toastIcon)).toContainText("👍");
3501
+ }
3502
+ if (closeAfterVerification && (await toastrCloseButton.isVisible())) {
3503
+ await toastrCloseButton.click();
3504
+ await test$1.expect(toastrCloseButton).toBeHidden();
3505
+ }
3506
+ };
3487
3507
  this.reloadAndWait = async (requestCount, customPageContext, interceptMultipleResponsesProps = {}) => {
3488
3508
  const pageContext = customPageContext !== null && customPageContext !== void 0 ? customPageContext : this.page;
3489
3509
  const reloadRequests = this.interceptMultipleResponses({