@bigbinary/neeto-playwright-commons 1.22.49 → 1.23.0
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 +0 -39
- package/index.cjs.js.map +1 -1
- package/index.d.ts +0 -4
- package/index.js +0 -39
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -4525,9 +4525,6 @@ const COMMON_SELECTORS = {
|
|
|
4525
4525
|
selectOptionError: (option) => `${neetoCist.hyphenate(option)}-select-error`,
|
|
4526
4526
|
button: (label) => `${neetoCist.hyphenate(label)}-button`,
|
|
4527
4527
|
customDropDownMenu: (label = "nui") => `${neetoCist.hyphenate(label)}-select-menu`,
|
|
4528
|
-
columnSortableItem: "column-sortable-item",
|
|
4529
|
-
columnsDropdownIcon: "columns-dropdown-icon",
|
|
4530
|
-
columnDragHandle: "column-drag-handle",
|
|
4531
4528
|
};
|
|
4532
4529
|
|
|
4533
4530
|
const THANK_YOU_SELECTORS = {
|
|
@@ -123105,47 +123102,11 @@ const validateColumnNames = async (columnHeaders, columnOffset, originalColumnNa
|
|
|
123105
123102
|
await test.expect(columnHeaders[i]).toHaveText(expectedName);
|
|
123106
123103
|
}
|
|
123107
123104
|
};
|
|
123108
|
-
const verifyReorderColumns = async (page) => {
|
|
123109
|
-
const columnDropdownButton = page.getByTestId(COMMON_SELECTORS.columnsDropdownIcon);
|
|
123110
|
-
const columnSearchInput = page.getByTestId(COMMON_SELECTORS.columnsSearchInput);
|
|
123111
|
-
const columnSortableItems = page.getByTestId(COMMON_SELECTORS.columnSortableItem);
|
|
123112
|
-
await columnDropdownButton.click();
|
|
123113
|
-
await test.expect(columnSearchInput).toBeVisible({ timeout: 10000 });
|
|
123114
|
-
let columnNames = await columnSortableItems.allTextContents();
|
|
123115
|
-
const shuffledColumnOrder = [...columnNames].sort(() => Math.random() - 0.5);
|
|
123116
|
-
for (let columnIndex = 0; columnIndex < shuffledColumnOrder.length; columnIndex++) {
|
|
123117
|
-
const shuffledColumnName = shuffledColumnOrder[columnIndex];
|
|
123118
|
-
const currentColumnName = columnNames[columnIndex];
|
|
123119
|
-
if (currentColumnName === shuffledColumnName)
|
|
123120
|
-
continue;
|
|
123121
|
-
const currentColumnHandle = columnSortableItems
|
|
123122
|
-
.filter({ hasText: new RegExp(`^${currentColumnName}$`) })
|
|
123123
|
-
.getByTestId(COMMON_SELECTORS.columnDragHandle);
|
|
123124
|
-
const shuffledColumnHandle = columnSortableItems
|
|
123125
|
-
.filter({ hasText: new RegExp(`^${shuffledColumnName}$`) })
|
|
123126
|
-
.getByTestId(COMMON_SELECTORS.columnDragHandle);
|
|
123127
|
-
await shuffledColumnHandle.dragTo(currentColumnHandle);
|
|
123128
|
-
await test.expect
|
|
123129
|
-
.poll(async () => (await columnSortableItems.allTextContents())[columnIndex], {
|
|
123130
|
-
timeout: 10000,
|
|
123131
|
-
})
|
|
123132
|
-
.toBe(shuffledColumnName);
|
|
123133
|
-
columnNames = await columnSortableItems.allTextContents();
|
|
123134
|
-
}
|
|
123135
|
-
test.expect(columnNames).toStrictEqual(shuffledColumnOrder);
|
|
123136
|
-
await columnDropdownButton.click();
|
|
123137
|
-
await test.expect(columnSearchInput).toBeHidden({ timeout: 10000 });
|
|
123138
|
-
const tableHeaders = await page.getByRole("columnheader").allTextContents();
|
|
123139
|
-
const expectedTableHeaders = shuffledColumnOrder.filter(columnName => tableHeaders.includes(columnName));
|
|
123140
|
-
const actualTableHeaders = tableHeaders.filter(columnName => shuffledColumnOrder.includes(columnName));
|
|
123141
|
-
test.expect(actualTableHeaders).toStrictEqual(expectedTableHeaders);
|
|
123142
|
-
};
|
|
123143
123105
|
const tableUtils = {
|
|
123144
123106
|
verifyTableColumnsExistence,
|
|
123145
123107
|
assertColumnHeaderVisibility,
|
|
123146
123108
|
toggleColumnCheckboxAndVerifyVisibility,
|
|
123147
123109
|
verifyFreezeColumnAction,
|
|
123148
|
-
verifyReorderColumns,
|
|
123149
123110
|
};
|
|
123150
123111
|
|
|
123151
123112
|
/**
|