@bigbinary/neeto-playwright-commons 1.9.22 → 1.9.24

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
@@ -939,6 +939,18 @@ declare class SlackPage extends IntegrationBase {
939
939
  neetoPlaywrightUtilities,
940
940
  integrationRouteIndex
941
941
  }: SlackPageParams);
942
+ /**
943
+ *
944
+ * Closes the coach mark modal that appears when a user logs in to Slack for the first time. It can be useful in scenarios where the coach mark is blocking the view of the elements that need to be interacted with. It takes the following parameters:
945
+ *
946
+ * slackWebappPage (optional): Playwright Page object for Slack web app.
947
+ *
948
+ * @example
949
+ *
950
+ * await slackPage.closeCoachMark(slackWebappPageInstance);
951
+ * @endexample
952
+ */
953
+ closeCoachMark: (slackWebappPage?: Page) => Promise<void>;
942
954
  /**
943
955
  *
944
956
  * Connects to slack integration and verifies the connection. It takes the following parameters:
@@ -3530,6 +3542,7 @@ declare const SLACK_SELECTORS: {
3530
3542
  */
3531
3543
  declare const SLACK_DATA_QA_SELECTORS: {
3532
3544
  sectionHeadingButton: string;
3545
+ coachMarkCloseButton: string;
3533
3546
  channelSectionSubmenuCreate: string;
3534
3547
  channelSectionMenuCreateChannel: string;
3535
3548
  skModalContent: string;
package/index.js CHANGED
@@ -13884,6 +13884,7 @@ const SLACK_SELECTORS = {
13884
13884
  };
13885
13885
  const SLACK_DATA_QA_SELECTORS = {
13886
13886
  sectionHeadingButton: "section_heading_button__channels",
13887
+ coachMarkCloseButton: "coachmark-close-button",
13887
13888
  channelSectionSubmenuCreate: "channel_section_submenu_create",
13888
13889
  channelSectionMenuCreateChannel: "channel_section_menu__create_channel",
13889
13890
  skModalContent: "sk-modal-content",
@@ -13906,6 +13907,11 @@ class SlackPage extends IntegrationBase {
13906
13907
  integration: "slack",
13907
13908
  integrationRouteIndex,
13908
13909
  });
13910
+ this.closeCoachMark = async (slackWebappPage = this.page) => {
13911
+ const slackWebappPageDataQa = getByDataQA(slackWebappPage);
13912
+ const closeCoachMarkButton = slackWebappPageDataQa(SLACK_DATA_QA_SELECTORS.coachMarkCloseButton);
13913
+ await closeCoachMarkButton.click();
13914
+ };
13909
13915
  this.connectAndVerifyIntegration = async (redirectUrl, customSteps, channelToConfigure = SLACK_DEFAULT_CHANNEL) => {
13910
13916
  await this.connect();
13911
13917
  await this.page
@@ -14010,6 +14016,7 @@ class SlackPage extends IntegrationBase {
14010
14016
  await slackWebappPage
14011
14017
  .locator(SLACK_SELECTORS.redirectOpenInBrowser)
14012
14018
  .click();
14019
+ await this.closeCoachMark(slackWebappPage);
14013
14020
  }
14014
14021
  else {
14015
14022
  throw new Error("ENV variable SLACK_LOGIN_EMAIL or SLACK_LOGIN_PASSWORD or SLACK_WORKSPACE is not defined.");
@@ -14032,6 +14039,9 @@ class SlackPage extends IntegrationBase {
14032
14039
  .click();
14033
14040
  };
14034
14041
  this.createNewSlackChannel = async ({ channelName, kind = "public", }) => {
14042
+ const closeCoachMarkButton = this.slackWebappPageDataQa(SLACK_DATA_QA_SELECTORS.coachMarkCloseButton);
14043
+ (await closeCoachMarkButton.isVisible()) &&
14044
+ (await closeCoachMarkButton.click());
14035
14045
  await this.slackWebappPageDataQa(SLACK_DATA_QA_SELECTORS.sectionHeadingButton).click();
14036
14046
  await this.slackWebappPageDataQa(SLACK_DATA_QA_SELECTORS.channelSectionSubmenuCreate).click();
14037
14047
  await this.slackWebappPageDataQa(SLACK_DATA_QA_SELECTORS.channelSectionMenuCreateChannel).click();