@bigbinary/neeto-playwright-commons 1.16.4 → 1.16.5

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
@@ -3,6 +3,7 @@
3
3
  var fs$d = require('fs');
4
4
  var Path = require('path');
5
5
  var test$1 = require('@playwright/test');
6
+ var neetoCist = require('@bigbinary/neeto-cist');
6
7
  var child_process = require('child_process');
7
8
  var ramda = require('ramda');
8
9
  var require$$0$1 = require('util');
@@ -14,7 +15,6 @@ var stealth$1 = require('puppeteer-extra-plugin-stealth');
14
15
  var Stream$4 = require('stream');
15
16
  var require$$0$4 = require('events');
16
17
  var playwrightI18nextFixture = require('playwright-i18next-fixture');
17
- var neetoCist = require('@bigbinary/neeto-cist');
18
18
  var http$1 = require('http');
19
19
  var Url = require('url');
20
20
  var require$$0$5 = require('punycode');
@@ -329,6 +329,17 @@ const COMMON_SELECTORS = {
329
329
  helpPopoverDesc: "help-popover-description",
330
330
  helpPopoverLinkButton: "help-popover-link-button",
331
331
  copyToClipboardButton: "copy-to-clipboard-button",
332
+ subheaderRight: "subheader-right",
333
+ customInputLabel: (name = "nui") => `${neetoCist.hyphenate(name)}-input-label`,
334
+ customInputField: (name = "nui") => `${neetoCist.hyphenate(name)}-input-field`,
335
+ customSelectContainer: (name) => `${neetoCist.hyphenate(name)}-select-container`,
336
+ customCheckboxLabel: (name) => `${neetoCist.hyphenate(name)}-checkbox-label`,
337
+ errorImage: "error-image",
338
+ customDropdownIcon: (label = "nui") => `${neetoCist.hyphenate(label)}-dropdown-icon`,
339
+ customDropdownContainer: (label = "nui") => `${neetoCist.hyphenate(label)}-dropdown-container`,
340
+ checkboxInput: (option = "i-agree") => `${neetoCist.hyphenate(option)}-checkbox-input`,
341
+ radioInput: (option = "i-agree") => `${neetoCist.hyphenate(option)}-radio-input`,
342
+ selectOptionError: (option) => `${neetoCist.hyphenate(option)}-select-error`,
332
343
  };
333
344
 
334
345
  const THANK_YOU_SELECTORS = {
@@ -25545,10 +25556,50 @@ const toggleColumnCheckboxAndVerifyVisibility = async ({ page, tableColumns, sho
25545
25556
  });
25546
25557
  }
25547
25558
  };
25559
+ const verifyFreezeColumnAction = async (page, t) => {
25560
+ var _a, _b;
25561
+ const columnHeader = page.getByRole("columnheader");
25562
+ const checkboxVisible = await columnHeader.getByRole("checkbox").isVisible();
25563
+ const columnOffset = checkboxVisible ? 1 : 0;
25564
+ const freezeColumnButton = page.getByRole("button", {
25565
+ name: (_a = t("neetoui.table.freezeColumn")) !== null && _a !== void 0 ? _a : "",
25566
+ });
25567
+ const unFreezeColumnButton = page.getByRole("button", {
25568
+ name: (_b = t("neetoui.table.unFreezeColumn")) !== null && _b !== void 0 ? _b : "",
25569
+ });
25570
+ const [columnHeaders, originalColumnNames] = await Promise.all([
25571
+ columnHeader.all(),
25572
+ columnHeader.allTextContents(),
25573
+ ]);
25574
+ for (let i = columnHeaders.length - 1; i >= columnOffset; i--) {
25575
+ const currentHeader = columnHeaders[i];
25576
+ await currentHeader.getByTestId(COMMON_SELECTORS.dropdownIcon).click();
25577
+ (await unFreezeColumnButton.isVisible())
25578
+ ? await unFreezeColumnButton.click()
25579
+ : await currentHeader.getByTestId(COMMON_SELECTORS.dropdownIcon).click();
25580
+ }
25581
+ for (let i = columnOffset; i < columnHeaders.length - 1; i++) {
25582
+ const lastDropdown = columnHeaders[columnHeaders.length - 1];
25583
+ await lastDropdown.getByTestId(COMMON_SELECTORS.dropdownIcon).click();
25584
+ await freezeColumnButton.click();
25585
+ }
25586
+ for (let i = columnOffset; i < originalColumnNames.length - 1; i++) {
25587
+ const expectedName = originalColumnNames[i + 1];
25588
+ await test$1.expect(columnHeaders[i]).toHaveText(expectedName);
25589
+ }
25590
+ for (let i = columnOffset; i < columnHeaders.length - 1; i++) {
25591
+ const currentHeader = columnHeaders[columnOffset];
25592
+ await currentHeader.getByTestId(COMMON_SELECTORS.dropdownIcon).click();
25593
+ await unFreezeColumnButton.click();
25594
+ }
25595
+ const currentColumnNames = await columnHeader.allTextContents();
25596
+ test$1.expect(currentColumnNames).toStrictEqual(originalColumnNames);
25597
+ };
25548
25598
  const tableUtils = {
25549
25599
  verifyTableColumnsExistence,
25550
25600
  assertColumnHeaderVisibility,
25551
25601
  toggleColumnCheckboxAndVerifyVisibility,
25602
+ verifyFreezeColumnAction,
25552
25603
  };
25553
25604
 
25554
25605
  const verifyBreadcrumbs = async ({ page, titlesAndRoutes, }) => {