@bigbinary/neeto-playwright-commons 1.8.11 → 1.8.12
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 +37 -0
- package/index.cjs.js.map +1 -1
- package/index.d.ts +18 -1
- package/index.js +37 -1
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -187,6 +187,8 @@ const COMMON_SELECTORS = {
|
|
|
187
187
|
homeButton: "home-button",
|
|
188
188
|
neetoUiSwitch: "nui-switch",
|
|
189
189
|
floatingActionMenuButton: "floating-action-menu-container",
|
|
190
|
+
columnsDropdownContainer: "columns-dropdown-container",
|
|
191
|
+
columnsDropdownButton: "columns-dropdown-button",
|
|
190
192
|
};
|
|
191
193
|
|
|
192
194
|
class CustomCommands {
|
|
@@ -8314,6 +8316,40 @@ const memberUtils = {
|
|
|
8314
8316
|
deactivateMemberViaRequest,
|
|
8315
8317
|
};
|
|
8316
8318
|
|
|
8319
|
+
const assertColumnHeaderVisibility = async ({ page, columnName, shouldBeVisible, }) => {
|
|
8320
|
+
const visibilityAssertion = shouldBeVisible ? "toBeVisible" : "toBeHidden";
|
|
8321
|
+
await test.expect(page.getByRole("columnheader", { name: columnName }))[visibilityAssertion]();
|
|
8322
|
+
};
|
|
8323
|
+
const toggleColumnCheckboxAndVerifyVisibility = async ({ page, tableColumns, shouldBeChecked, }) => {
|
|
8324
|
+
await page.getByTestId(COMMON_SELECTORS.columnsDropdownButton).click();
|
|
8325
|
+
for (const columnName of tableColumns) {
|
|
8326
|
+
const checkbox = page
|
|
8327
|
+
.getByTestId(COMMON_SELECTORS.columnsDropdownContainer)
|
|
8328
|
+
.getByRole("listitem")
|
|
8329
|
+
.filter({ hasText: columnName })
|
|
8330
|
+
.getByRole("checkbox");
|
|
8331
|
+
const isCheckBoxChecked = await checkbox.isChecked();
|
|
8332
|
+
if (isCheckBoxChecked !== shouldBeChecked) {
|
|
8333
|
+
await checkbox.click();
|
|
8334
|
+
}
|
|
8335
|
+
shouldBeChecked
|
|
8336
|
+
? await test.expect(checkbox).toBeChecked()
|
|
8337
|
+
: await test.expect(checkbox).not.toBeChecked();
|
|
8338
|
+
}
|
|
8339
|
+
await page.getByTestId(COMMON_SELECTORS.columnsDropdownButton).click();
|
|
8340
|
+
for (const columnName of tableColumns) {
|
|
8341
|
+
await assertColumnHeaderVisibility({
|
|
8342
|
+
page,
|
|
8343
|
+
columnName,
|
|
8344
|
+
shouldBeVisible: shouldBeChecked,
|
|
8345
|
+
});
|
|
8346
|
+
}
|
|
8347
|
+
};
|
|
8348
|
+
const tableUtils = {
|
|
8349
|
+
assertColumnHeaderVisibility,
|
|
8350
|
+
toggleColumnCheckboxAndVerifyVisibility,
|
|
8351
|
+
};
|
|
8352
|
+
|
|
8317
8353
|
var main$2 = {exports: {}};
|
|
8318
8354
|
|
|
8319
8355
|
var name = "dotenv";
|
|
@@ -8904,6 +8940,7 @@ exports.readFileSyncIfExists = readFileSyncIfExists;
|
|
|
8904
8940
|
exports.removeCredentialFile = removeCredentialFile;
|
|
8905
8941
|
exports.shouldSkipSetupAndTeardown = shouldSkipSetupAndTeardown;
|
|
8906
8942
|
exports.skipTest = skipTest;
|
|
8943
|
+
exports.tableUtils = tableUtils;
|
|
8907
8944
|
exports.updateCredentials = updateCredentials;
|
|
8908
8945
|
exports.writeDataToFile = writeDataToFile;
|
|
8909
8946
|
//# sourceMappingURL=index.cjs.js.map
|