@bigbinary/neeto-playwright-commons 1.26.18 → 1.26.19

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
557
  * titlesAndRoutes: An array of objects containing the titles and routes of the breadcrumbs to verify.
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
7986
  * titlesAndRoutes: An array of objects containing the titles and routes of the breadcrumbs to verify.
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`,
@@ -5937,7 +5938,15 @@ class CustomCommands {
5937
5938
  this.verifyBreadcrumbs = async (titlesAndRoutes) => {
5938
5939
  const breadcrumbHeader = this.page.getByTestId(COMMON_SELECTORS.breadcrumbHeader);
5939
5940
  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)));
5941
+ await Promise.all(titlesAndRoutes.map(async ({ title, route }) => {
5942
+ const isRoutePresent = isPresent(route);
5943
+ const breadcrumb = isRoutePresent
5944
+ ? breadcrumbHeader.getByRole("link", { name: title, exact: true })
5945
+ : breadcrumbHeader.getByTestId(COMMON_SELECTORS.breadcrumb(title));
5946
+ return isRoutePresent
5947
+ ? await expect(breadcrumb).toHaveAttribute("href", route)
5948
+ : await expect(breadcrumb).toBeVisible();
5949
+ }));
5941
5950
  };
5942
5951
  this.uploadFileViaDispatchV2 = async ({ droppableZone = this.page.getByTestId(COMMON_SELECTORS.fileUploadBody), dispatchEvent = "drop", timeout = 45000, file, }) => {
5943
5952
  const serializedFile = await serializeFileForBrowser(file);
@@ -117138,6 +117147,9 @@ class ZapierPage extends IntegrationBase {
117138
117147
  });
117139
117148
  await this.zapierWebPage.close();
117140
117149
  };
117150
+ /**
117151
+ * @deprecated This method is deprecated. Use reconnectAccount instead.
117152
+ */
117141
117153
  this.reconnectAccountAndPublish = async (zapierApiKey, appName) => {
117142
117154
  var _a;
117143
117155
  await this.zapierWebPage.goto(THIRD_PARTY_ROUTES.zapier.zapEditor(process.env.ZAP_ID));
@@ -117220,6 +117232,9 @@ class ZapierPage extends IntegrationBase {
117220
117232
  .waitFor();
117221
117233
  await expect(this.zapierWebPage.getByLabel(ZAPIER_WEB_TEXTS.publishingZapHeading)).toBeHidden({ timeout: 15000 });
117222
117234
  };
117235
+ /**
117236
+ * @deprecated This method is deprecated. You do not need to call this method if reconnectAccount is used.
117237
+ */
117223
117238
  this.deleteAllConnections = async (zapierAppLink) => {
117224
117239
  await this.zapierWebPage.goto(zapierAppLink);
117225
117240
  await this.zapierWebPage.waitForLoadState();
@@ -119906,6 +119921,9 @@ const verifyBreadcrumbs = async ({ page, titlesAndRoutes, }) => {
119906
119921
  exact: true,
119907
119922
  })).toHaveAttribute("href", route)));
119908
119923
  };
119924
+ /**
119925
+ * @deprecated This is deprecated. Use neetoPlaywrightUtilities.verifyBreadcrumbs instead.
119926
+ */
119909
119927
  const headerUtils = {
119910
119928
  verifyBreadcrumbs,
119911
119929
  };