@bigbinary/neeto-playwright-commons 1.26.18 → 1.26.20

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
@@ -70,7 +70,7 @@ type ParamProps = Record<string, number | string | boolean | ParamFilters>;
70
70
  type HttpMethods = "get" | "patch" | "post" | "put" | "delete";
71
71
  interface BreadcrumbTitleAndRoute$1 {
72
72
  title: string;
73
- route: string;
73
+ route?: string;
74
74
  }
75
75
  interface ApiRequestProps {
76
76
  url: string;
@@ -554,25 +554,15 @@ declare class CustomCommands {
554
554
  *
555
555
  * Verifies the breadcrumbs in the header of a web page. It takes the following parameters:
556
556
  *
557
- * page: An instance of the Playwright Page class representing the web page where the breadcrumbs are located.
558
- *
559
- * titlesAndRoutes: An array of objects containing the titles and routes of the breadcrumbs to verify.
557
+ * titlesAndRoutes: An array of objects containing the titles and routes of the breadcrumbs to verify. The order of the array must match the display order of breadcrumbs on the page.
560
558
  *
561
559
  * @example
562
560
  *
563
- * import { Page } from "@playwright/test";
564
- * import { headerUtils } from "@bigbinary/neeto-playwright-commons";
565
- *
566
- * const breadcrumbs = [
561
+ * await neetoPlaywrightUtilities.verifyBreadcrumbs([
567
562
  * { title: "Home", route: "/" },
568
563
  * { title: "Category", route: "/category" },
569
564
  * { title: "Subcategory", route: "/category/subcategory" }
570
- * ];
571
- *
572
- * await headerUtils.verifyBreadcrumbs({
573
- * page,
574
- * titlesAndRoutes: breadcrumbs
575
- * });
565
+ * ]);
576
566
  * @endexample
577
567
  */
578
568
  verifyBreadcrumbs: (titlesAndRoutes: BreadcrumbTitleAndRoute$1[]) => Promise<void>;
@@ -2708,30 +2698,12 @@ declare class ZapierPage extends IntegrationBase {
2708
2698
  */
2709
2699
  logoutFromZapier: () => Promise<void>;
2710
2700
  /**
2711
- *
2712
- * Reconnects zapier account and publishes changes. It takes the following
2713
- *
2714
- * parameters:
2715
- *
2716
- * zapierApiKey: Zapier API key. appName: Name of the application.
2717
- *
2718
- * @example
2719
- *
2720
- * await zapierPage.reconnectAccountAndPublish("your-zapier-api-key", "neetoForm");
2721
- * @endexample
2722
- */
2701
+ * @deprecated This method is deprecated. Use reconnectAccount instead.
2702
+ */
2723
2703
  reconnectAccountAndPublish: (zapierApiKey: string, appName: string) => Promise<void>;
2724
2704
  /**
2725
- *
2726
- * Deletes all connections in zapier. It takes the following parameters:
2727
- *
2728
- * zapierAppLink: Link to Zapier app.
2729
- *
2730
- * @example
2731
- *
2732
- * await zapierPage.deleteAllConnections("https://zapier.com/app/dashboard");
2733
- * @endexample
2734
- */
2705
+ * @deprecated This method is deprecated. You do not need to call this method if reconnectAccount is used.
2706
+ */
2735
2707
  deleteAllConnections: (zapierAppLink: string) => Promise<void>;
2736
2708
  /**
2737
2709
  *
@@ -5822,6 +5794,7 @@ declare const COMMON_SELECTORS: {
5822
5794
  columnsDropdownContainer: string;
5823
5795
  columnsDropdownButton: string;
5824
5796
  breadcrumbHeader: string;
5797
+ breadcrumb: (title: string) => string;
5825
5798
  header: string;
5826
5799
  sidebarSubLink: (label: string) => string;
5827
5800
  sidebarGoBackButton: (label: string) => string;
@@ -8002,30 +7975,23 @@ interface VerifyBreadcrumbProps {
8002
7975
  page: Page;
8003
7976
  titlesAndRoutes: BreadcrumbTitleAndRoute[];
8004
7977
  }
7978
+ /**
7979
+ * @deprecated This is deprecated. Use neetoPlaywrightUtilities.verifyBreadcrumbs instead.
7980
+ */
8005
7981
  declare const headerUtils: {
8006
7982
  /**
8007
7983
  *
8008
7984
  * Verifies the breadcrumbs in the header of a web page. It takes the following parameters:
8009
7985
  *
8010
- * page: An instance of the Playwright Page class representing the web page where the breadcrumbs are located.
8011
- *
8012
- * titlesAndRoutes: An array of objects containing the titles and routes of the breadcrumbs to verify.
7986
+ * titlesAndRoutes: An array of objects containing the titles and routes of the breadcrumbs to verify. The order of the array must match the display order of breadcrumbs on the page.
8013
7987
  *
8014
7988
  * @example
8015
7989
  *
8016
- * import { Page } from "@playwright/test";
8017
- * import { headerUtils } from "@bigbinary/neeto-playwright-commons";
8018
- *
8019
- * const breadcrumbs = [
7990
+ * await neetoPlaywrightUtilities.verifyBreadcrumbs([
8020
7991
  * { title: "Home", route: "/" },
8021
7992
  * { title: "Category", route: "/category" },
8022
7993
  * { title: "Subcategory", route: "/category/subcategory" }
8023
- * ];
8024
- *
8025
- * await headerUtils.verifyBreadcrumbs({
8026
- * page,
8027
- * titlesAndRoutes: breadcrumbs
8028
- * });
7994
+ * ]);
8029
7995
  * @endexample
8030
7996
  */
8031
7997
  verifyBreadcrumbs: ({
package/index.js CHANGED
@@ -4726,6 +4726,7 @@ const COMMON_SELECTORS = {
4726
4726
  columnsDropdownContainer: "customize-columns-dropdown-container",
4727
4727
  columnsDropdownButton: "columns-dropdown-button",
4728
4728
  breadcrumbHeader: "header-breadcrumb",
4729
+ breadcrumb: (title) => `${hyphenate(title)}-breadcrumb`,
4729
4730
  header: "neeto-molecules-header",
4730
4731
  sidebarSubLink: (label) => `${hyphenate(label)}-sub-link`,
4731
4732
  sidebarGoBackButton: (label) => `${hyphenate(label)}-go-back-button`,
@@ -5935,9 +5936,15 @@ class CustomCommands {
5935
5936
  }).toPass({ timeout: 30000 });
5936
5937
  };
5937
5938
  this.verifyBreadcrumbs = async (titlesAndRoutes) => {
5938
- const breadcrumbHeader = this.page.getByTestId(COMMON_SELECTORS.breadcrumbHeader);
5939
- await expect(breadcrumbHeader).toHaveCount(titlesAndRoutes.length);
5940
- await Promise.all(titlesAndRoutes.map(({ title, route }) => expect(breadcrumbHeader.getByRole("link", { name: title, exact: true })).toHaveAttribute("href", route)));
5939
+ const header = this.page.getByTestId(COMMON_SELECTORS.breadcrumbHeader);
5940
+ const titles = pluck("title", titlesAndRoutes);
5941
+ const [last, ...links] = titlesAndRoutes.slice().reverse();
5942
+ await Promise.all([
5943
+ expect(header).toContainText(titles),
5944
+ expect(header).toHaveCount(titlesAndRoutes.length),
5945
+ expect(header.getByRole("link", { name: last === null || last === void 0 ? void 0 : last.title, exact: true })).toHaveCount(0),
5946
+ ...links.map(({ title, route }) => expect(header.getByRole("link", { name: title, exact: true })).toHaveAttribute("href", route)),
5947
+ ]);
5941
5948
  };
5942
5949
  this.uploadFileViaDispatchV2 = async ({ droppableZone = this.page.getByTestId(COMMON_SELECTORS.fileUploadBody), dispatchEvent = "drop", timeout = 45000, file, }) => {
5943
5950
  const serializedFile = await serializeFileForBrowser(file);
@@ -117138,6 +117145,9 @@ class ZapierPage extends IntegrationBase {
117138
117145
  });
117139
117146
  await this.zapierWebPage.close();
117140
117147
  };
117148
+ /**
117149
+ * @deprecated This method is deprecated. Use reconnectAccount instead.
117150
+ */
117141
117151
  this.reconnectAccountAndPublish = async (zapierApiKey, appName) => {
117142
117152
  var _a;
117143
117153
  await this.zapierWebPage.goto(THIRD_PARTY_ROUTES.zapier.zapEditor(process.env.ZAP_ID));
@@ -117220,6 +117230,9 @@ class ZapierPage extends IntegrationBase {
117220
117230
  .waitFor();
117221
117231
  await expect(this.zapierWebPage.getByLabel(ZAPIER_WEB_TEXTS.publishingZapHeading)).toBeHidden({ timeout: 15000 });
117222
117232
  };
117233
+ /**
117234
+ * @deprecated This method is deprecated. You do not need to call this method if reconnectAccount is used.
117235
+ */
117223
117236
  this.deleteAllConnections = async (zapierAppLink) => {
117224
117237
  await this.zapierWebPage.goto(zapierAppLink);
117225
117238
  await this.zapierWebPage.waitForLoadState();
@@ -119906,6 +119919,9 @@ const verifyBreadcrumbs = async ({ page, titlesAndRoutes, }) => {
119906
119919
  exact: true,
119907
119920
  })).toHaveAttribute("href", route)));
119908
119921
  };
119922
+ /**
119923
+ * @deprecated This is deprecated. Use neetoPlaywrightUtilities.verifyBreadcrumbs instead.
119924
+ */
119909
119925
  const headerUtils = {
119910
119926
  verifyBreadcrumbs,
119911
119927
  };