@bigbinary/neeto-playwright-commons 1.14.0 → 1.14.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.cjs.js CHANGED
@@ -472,6 +472,7 @@ const NEETO_FILTERS_SELECTORS = {
472
472
  paneModalCrossIcon: "neeto-filters-close-button",
473
473
  searchTermBlock: "neeto-filters-search-term-block",
474
474
  neetoFiltersFilter: (filterName) => `neeto-filters-${hyphenize(filterName)}-filter`,
475
+ filtersTermBlock: (filterType = "search-term") => `neeto-filters-${hyphenize(filterType)}-block`,
475
476
  };
476
477
 
477
478
  const HELP_CENTER_SELECTORS = {
@@ -4043,6 +4044,21 @@ class CustomCommands {
4043
4044
  await customPageContext.mouse.move(0, 0);
4044
4045
  await test$1.expect(tooltipBox).toBeHidden();
4045
4046
  };
4047
+ this.verifySearchTermBlock = async (searchTerm) => {
4048
+ const filtersSearchTermBlock = this.page.getByTestId(NEETO_FILTERS_SELECTORS.filtersTermBlock());
4049
+ if (searchTerm) {
4050
+ const textContent = await (filtersSearchTermBlock === null || filtersSearchTermBlock === void 0 ? void 0 : filtersSearchTermBlock.textContent());
4051
+ (textContent === null || textContent === void 0 ? void 0 : textContent.includes(".."))
4052
+ ? await this.verifyTooltip({
4053
+ triggerElement: filtersSearchTermBlock,
4054
+ content: searchTerm,
4055
+ })
4056
+ : await test$1.expect(filtersSearchTermBlock).toContainText(searchTerm);
4057
+ }
4058
+ else {
4059
+ await test$1.expect(filtersSearchTermBlock).toBeHidden();
4060
+ }
4061
+ };
4046
4062
  this.page = page;
4047
4063
  this.responses = [];
4048
4064
  this.request = request;
@@ -21313,7 +21329,7 @@ class EmbedBase {
21313
21329
  `width: "${embedWidthPercentage}"`,
21314
21330
  ]);
21315
21331
  const inlineEmbedPromise = this.neetoPlaywrightUtilities.interceptMultipleResponses(inlineEmbedInterceptParams);
21316
- await this.previewTab.click();
21332
+ (await this.previewTab.isVisible()) && (await this.previewTab.click());
21317
21333
  await inlineEmbedPromise;
21318
21334
  const iframe = this.page.locator("iframe");
21319
21335
  await iframe.waitFor({ state: "visible" });
@@ -21372,7 +21388,7 @@ class EmbedBase {
21372
21388
  `btnPosition: "${toCamelCase(customizationOptions.buttonPosition)}"`,
21373
21389
  `btnText: "${customizationOptions.buttonText}"`,
21374
21390
  ]);
21375
- await this.previewTab.click();
21391
+ (await this.previewTab.isVisible()) && (await this.previewTab.click());
21376
21392
  const floatingButton = this.page.getByRole("button", {
21377
21393
  name: customizationOptions.buttonText,
21378
21394
  });
@@ -21395,7 +21411,7 @@ class EmbedBase {
21395
21411
  .getByTestId(EMBED_SELECTORS.elementIdInput)
21396
21412
  .fill(customizationOptions.customId);
21397
21413
  await test$1.expect(this.codeBlock).toContainText(`elementSelector: "#${customizationOptions.customId}"`);
21398
- await this.previewTab.click();
21414
+ (await this.previewTab.isVisible()) && (await this.previewTab.click());
21399
21415
  await test$1.expect(this.page.getByTestId(EMBED_SELECTORS.previewElementPopupButton)).toBeVisible();
21400
21416
  await test$1.expect(this.page.locator(`#${customizationOptions.customId}`)).toBeVisible();
21401
21417
  };