@bigbinary/neeto-playwright-commons 1.23.5 → 1.23.6

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
@@ -5398,9 +5398,7 @@ class CustomCommands {
5398
5398
  const toastrLocator = ramda.isEmpty(message)
5399
5399
  ? customPageContext.locator(COMMON_SELECTORS.toastIcon)
5400
5400
  : customPageContext.getByTestId(COMMON_SELECTORS.toastMessage(toastType));
5401
- await test.expect(toastrLocator).toContainText(ramda.isEmpty(message) ? "👍" : message, {
5402
- timeout,
5403
- });
5401
+ await test.expect(toastrLocator).toContainText(ramda.isEmpty(message) ? "👍" : message, { timeout });
5404
5402
  if (!closeAfterVerification && (await toastrCloseButton.isHidden()))
5405
5403
  return;
5406
5404
  const buttonHandle = await toastrCloseButton.elementHandle();
@@ -5452,9 +5450,7 @@ class CustomCommands {
5452
5450
  };
5453
5451
  const formattedUrl = ramda.isEmpty(params)
5454
5452
  ? url
5455
- : `${url}?${qs.stringify(params, {
5456
- arrayFormat: "brackets",
5457
- })}`;
5453
+ : `${url}?${qs.stringify(params, { arrayFormat: "brackets" })}`;
5458
5454
  return await this.request[method](formattedUrl, requestOptions);
5459
5455
  };
5460
5456
  this.selectOptionFromDropdown = async ({ label = "nui", value, page = this.page, options = {}, }) => {
@@ -5527,16 +5523,15 @@ class CustomCommands {
5527
5523
  }).toPass({ timeout: 10000 });
5528
5524
  this.verifyTooltip = async ({ triggerElement, content, customPageContext = this.page, }) => {
5529
5525
  await this.hoverOnElement(triggerElement, customPageContext);
5530
- await test.expect(customPageContext.getByTestId(COMMON_SELECTORS.tooltip)).toContainText(content);
5526
+ const resolvedContent = typeof content === "function" ? await content() : content;
5527
+ await test.expect(customPageContext.getByTestId(COMMON_SELECTORS.tooltip)).toContainText(resolvedContent);
5531
5528
  await this.hideTooltip(triggerElement, customPageContext);
5532
5529
  };
5533
5530
  this.verifyHelpPopover = async ({ triggerElement = this.page.getByTestId(COMMON_SELECTORS.helpPopoverButton), title, content, helpURL, customPageContext = this.page, }) => {
5534
5531
  const tooltipBox = customPageContext.getByTestId(COMMON_SELECTORS.tooltip);
5535
5532
  await triggerElement.hover();
5536
5533
  title &&
5537
- (await test.expect(tooltipBox.getByRole("heading", {
5538
- name: title,
5539
- })).toBeVisible());
5534
+ (await test.expect(tooltipBox.getByRole("heading", { name: title })).toBeVisible());
5540
5535
  content && (await test.expect(tooltipBox).toContainText(content));
5541
5536
  helpURL &&
5542
5537
  (await test.expect(tooltipBox.getByTestId(COMMON_SELECTORS.helpPopoverLinkButton)).toHaveAttribute("href", new RegExp(helpURL, "i")));
@@ -5609,10 +5604,7 @@ class CustomCommands {
5609
5604
  this.verifyBreadcrumbs = async (titlesAndRoutes) => {
5610
5605
  const breadcrumbHeader = this.page.getByTestId(COMMON_SELECTORS.breadcrumbHeader);
5611
5606
  await test.expect(breadcrumbHeader).toHaveCount(titlesAndRoutes.length);
5612
- await Promise.all(titlesAndRoutes.map(({ title, route }) => test.expect(breadcrumbHeader.getByRole("link", {
5613
- name: title,
5614
- exact: true,
5615
- })).toHaveAttribute("href", route)));
5607
+ await Promise.all(titlesAndRoutes.map(({ title, route }) => test.expect(breadcrumbHeader.getByRole("link", { name: title, exact: true })).toHaveAttribute("href", route)));
5616
5608
  };
5617
5609
  this.uploadFileViaDispatchV2 = async ({ droppableZone = this.page.getByTestId(COMMON_SELECTORS.fileUploadBody), dispatchEvent = "drop", file, }) => {
5618
5610
  const serializedFile = await serializeFileForBrowser(file);