@bigbinary/neeto-playwright-commons 1.8.40 → 1.8.42

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
@@ -247,6 +247,8 @@ const COMMON_SELECTORS = {
247
247
  columnsDropdownButton: "columns-dropdown-button",
248
248
  breadcrumbHeader: "header-breadcrumb",
249
249
  header: "neeto-molecules-header",
250
+ sidebarSubLink: (label) => `${hyphenize(label)}-sub-link`,
251
+ sidebarGoBackButton: (label) => `${hyphenize(label)}-go-back-button`,
250
252
  };
251
253
 
252
254
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
@@ -12463,7 +12465,9 @@ class EmbedBase {
12463
12465
  await test$1.expect(this.page.frameLocator("iframe").getByTestId(headingTestId)).toBeVisible({ timeout: 10000 });
12464
12466
  const iframeHeight = await iframe.evaluate(node => node.getAttribute("height"));
12465
12467
  const iframeWidth = await iframe.evaluate(node => node.getAttribute("width"));
12468
+ // eslint-disable-next-line playwright/no-standalone-expect
12466
12469
  test$1.expect(iframeHeight).toStrictEqual(embedHeightPercentage);
12470
+ // eslint-disable-next-line playwright/no-standalone-expect
12467
12471
  test$1.expect(iframeWidth).toStrictEqual(embedWidthPercentage);
12468
12472
  };
12469
12473
  this.verifyFloatingPopupCustomization = async (customizationOptions) => {
@@ -12498,13 +12502,20 @@ class EmbedBase {
12498
12502
  .getByTestId(EMBED_SELECTORS.colorpickerEditableInput)
12499
12503
  .getByRole("textbox")
12500
12504
  .fill(customizationOptions.buttonTextColorHex);
12501
- await this.page.getByTestId(EMBED_SELECTORS.showIconCheckbox).click();
12505
+ const showIconCheckbox = this.page.getByTestId(EMBED_SELECTORS.showIconCheckbox);
12506
+ if (customizationOptions.showIcon === true) {
12507
+ await showIconCheckbox.check();
12508
+ await test$1.expect(this.codeBlock).toContainText("showIcon: true");
12509
+ }
12510
+ else if (customizationOptions.showIcon === false) {
12511
+ await showIconCheckbox.uncheck();
12512
+ await test$1.expect(this.codeBlock).toContainText("showIcon: false");
12513
+ }
12502
12514
  await this.expectMultipleTextsInCodeblock([
12503
12515
  `btnColor: "${customizationOptions.buttonColorHex}"`,
12504
12516
  `btnTextColor: "${customizationOptions.buttonTextColorHex}"`,
12505
12517
  `btnPosition: "${toCamelCase(customizationOptions.buttonPosition)}"`,
12506
12518
  `btnText: "${customizationOptions.buttonText}"`,
12507
- "showIcon: false",
12508
12519
  ]);
12509
12520
  await this.previewTab.click();
12510
12521
  const floatingButton = this.page.getByRole("button", {
@@ -12516,7 +12527,13 @@ class EmbedBase {
12516
12527
  .toLocaleLowerCase()
12517
12528
  .replace(" ", ".*");
12518
12529
  await test$1.expect(floatingButton).toHaveClass(RegExp(classRegExp));
12519
- await test$1.expect(floatingButton.locator("svg")).toBeHidden();
12530
+ const floatingButtonIcon = floatingButton.locator("svg");
12531
+ if (customizationOptions.showIcon === true) {
12532
+ await test$1.expect(floatingButtonIcon).toBeVisible();
12533
+ }
12534
+ else if (customizationOptions.showIcon === false) {
12535
+ await test$1.expect(floatingButtonIcon).toBeHidden();
12536
+ }
12520
12537
  };
12521
12538
  this.verifyElementClickCustomization = async (customizationOptions) => {
12522
12539
  await this.page
@@ -13374,6 +13391,16 @@ class OrganizationPage {
13374
13391
  }
13375
13392
  }
13376
13393
 
13394
+ class SidebarSection {
13395
+ constructor(page, neetoPlaywrightUtilities) {
13396
+ this.clickOnSubLink = (label) => this.page.getByTestId(COMMON_SELECTORS.sidebarSubLink(label)).click();
13397
+ this.clickOnGoBackButton = (label) => this.page.getByTestId(COMMON_SELECTORS.sidebarGoBackButton(label)).click();
13398
+ this.page = page;
13399
+ this.neetoPlaywrightUtilities = neetoPlaywrightUtilities;
13400
+ this.t = playwrightI18nextFixture.getI18nInstance().t;
13401
+ }
13402
+ }
13403
+
13377
13404
  const USER_AGENTS = {
13378
13405
  windows: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36",
13379
13406
  mac: "Mozilla/5.0 (Macintosh; Intel Mac OS X 14_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
@@ -147154,6 +147181,7 @@ exports.CHAT_WIDGET_TEXTS = CHAT_WIDGET_TEXTS;
147154
147181
  exports.COMMON_SELECTORS = COMMON_SELECTORS;
147155
147182
  exports.CREDENTIALS = CREDENTIALS;
147156
147183
  exports.CustomCommands = CustomCommands;
147184
+ exports.EMBED_SELECTORS = EMBED_SELECTORS;
147157
147185
  exports.ENVIRONMENT = ENVIRONMENT;
147158
147186
  exports.EmbedBase = EmbedBase;
147159
147187
  exports.GLOBAL_TRANSLATIONS_PATTERN = GLOBAL_TRANSLATIONS_PATTERN;
@@ -147185,11 +147213,13 @@ exports.SLACK_DEFAULT_CHANNEL = SLACK_DEFAULT_CHANNEL;
147185
147213
  exports.SLACK_SELECTORS = SLACK_SELECTORS;
147186
147214
  exports.SLACK_WEB_TEXTS = SLACK_WEB_TEXTS;
147187
147215
  exports.STORAGE_STATE = STORAGE_STATE;
147216
+ exports.SidebarSection = SidebarSection;
147188
147217
  exports.SlackPage = SlackPage;
147189
147218
  exports.TAGS_SELECTORS = TAGS_SELECTORS;
147190
147219
  exports.THIRD_PARTY_ROUTES = THIRD_PARTY_ROUTES;
147191
147220
  exports.USER_AGENTS = USER_AGENTS;
147192
147221
  exports.WebhooksPage = WebhooksPage;
147222
+ exports.basicHTMLContent = basicHTMLContent;
147193
147223
  exports.clearCredentials = clearCredentials;
147194
147224
  exports.commands = commands;
147195
147225
  exports.cpuThrottlingUsingCDP = cpuThrottlingUsingCDP;
@@ -147201,6 +147231,7 @@ exports.generateStagingData = generateStagingData;
147201
147231
  exports.getByDataQA = getByDataQA;
147202
147232
  exports.getGlobalUserState = getGlobalUserState;
147203
147233
  exports.headerUtils = headerUtils;
147234
+ exports.hexToRGB = hexToRGB;
147204
147235
  exports.hyphenize = hyphenize;
147205
147236
  exports.i18nFixture = i18nFixture;
147206
147237
  exports.initializeCredentials = initializeCredentials;