@bigbinary/neeto-playwright-commons 1.16.3 → 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 +65 -4
- package/index.cjs.js.map +1 -1
- package/index.d.ts +67 -1
- package/index.js +65 -4
- package/index.js.map +1 -1
- package/package.json +1 -1
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 = {
|
|
@@ -3914,8 +3925,14 @@ class CustomCommands {
|
|
|
3914
3925
|
await test$1.expect(customPageContext.locator(COMMON_SELECTORS.toastIcon)).toContainText("👍", { timeout });
|
|
3915
3926
|
}
|
|
3916
3927
|
if (closeAfterVerification && (await toastrCloseButton.isVisible())) {
|
|
3917
|
-
await toastrCloseButton.
|
|
3918
|
-
|
|
3928
|
+
const buttonHandle = await toastrCloseButton.elementHandle();
|
|
3929
|
+
if (buttonHandle) {
|
|
3930
|
+
await customPageContext.evaluate(button => {
|
|
3931
|
+
button.dispatchEvent(new Event("click", { bubbles: true }));
|
|
3932
|
+
}, buttonHandle);
|
|
3933
|
+
// eslint-disable-next-line playwright/no-standalone-expect
|
|
3934
|
+
await test$1.expect(toastrCloseButton).toBeHidden();
|
|
3935
|
+
}
|
|
3919
3936
|
}
|
|
3920
3937
|
};
|
|
3921
3938
|
this.reloadAndWait = async (requestCount, customPageContext, interceptMultipleResponsesProps = {}) => {
|
|
@@ -4027,8 +4044,12 @@ class CustomCommands {
|
|
|
4027
4044
|
}, { buffer, fileNameWithType });
|
|
4028
4045
|
await droppableZone.dispatchEvent(dispatchEvent, { dataTransfer });
|
|
4029
4046
|
};
|
|
4030
|
-
this.
|
|
4047
|
+
this.hoverOnElement = (triggerElement, customPageContext = this.page) => test$1.expect(async () => {
|
|
4031
4048
|
await triggerElement.hover();
|
|
4049
|
+
await test$1.expect(customPageContext.getByTestId(COMMON_SELECTORS.tooltip)).toBeVisible({ timeout: 3000 });
|
|
4050
|
+
}).toPass({ timeout: 10000 });
|
|
4051
|
+
this.verifyTooltip = async ({ triggerElement, content, customPageContext = this.page, }) => {
|
|
4052
|
+
await this.hoverOnElement(triggerElement, customPageContext);
|
|
4032
4053
|
await test$1.expect(customPageContext.getByTestId(COMMON_SELECTORS.tooltip)).toContainText(content);
|
|
4033
4054
|
await this.hideTooltip(triggerElement, customPageContext);
|
|
4034
4055
|
};
|
|
@@ -25535,10 +25556,50 @@ const toggleColumnCheckboxAndVerifyVisibility = async ({ page, tableColumns, sho
|
|
|
25535
25556
|
});
|
|
25536
25557
|
}
|
|
25537
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
|
+
};
|
|
25538
25598
|
const tableUtils = {
|
|
25539
25599
|
verifyTableColumnsExistence,
|
|
25540
25600
|
assertColumnHeaderVisibility,
|
|
25541
25601
|
toggleColumnCheckboxAndVerifyVisibility,
|
|
25602
|
+
verifyFreezeColumnAction,
|
|
25542
25603
|
};
|
|
25543
25604
|
|
|
25544
25605
|
const verifyBreadcrumbs = async ({ page, titlesAndRoutes, }) => {
|