@thinkwise/testwise 0.2.20 → 0.2.62
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/Testwise.ts +2 -0
- package/artifact-builder/SelectorBuilder.ts +2 -2
- package/artifact-builder/SubjectComponentGenerator.ts +21 -12
- package/artifact-builder/SubjectGenerator.ts +24 -8
- package/components/action-bar/ActionBar.ts +7 -7
- package/components/action-bar/CustomActionBar.ts +0 -5
- package/components/cardlist/Cardlist.ts +3 -3
- package/components/chart/Chart.ts +3 -3
- package/components/combined-filter/CombinedFilter.ts +3 -3
- package/components/cube-view-bar/CubeViewBar.ts +3 -3
- package/components/filter/ExcelStyleFilterPopup.ts +29 -0
- package/components/filter/ExcelStyleFilterPopupObjects.ts +20 -0
- package/components/filter/FilterForm.ts +3 -3
- package/components/filter/FilterPopup.ts +187 -0
- package/components/filter/FilterPopupObjects.ts +63 -0
- package/components/filter/ManagePrefilterPopup.ts +44 -0
- package/components/filter/ManagePrefilterPopupObjects.ts +28 -0
- package/components/form/Form.ts +3 -3
- package/components/grid/Grid.ts +15 -119
- package/components/grid/GridObjects.ts +0 -4
- package/components/index.ts +4 -0
- package/components/maps/Maps.ts +3 -3
- package/components/menu/ListBarMenuComponent.ts +11 -0
- package/components/menu/ListBarMenuComponentObjects.ts +6 -0
- package/components/pivot-grid/PivotGrid.ts +3 -3
- package/components/pivot-grid/PivotGridFieldList.ts +3 -3
- package/components/pop-up/AllRowsPopUp.ts +29 -0
- package/components/pop-up/AllRowsPopUpObjects.ts +22 -0
- package/components/prefilter-list/PrefilterList.ts +3 -3
- package/components/preview/Preview.ts +3 -3
- package/components/report-bar/ReportBar.ts +3 -3
- package/components/report-tiles/ReportTiles.ts +3 -3
- package/components/scheduler/Scheduler.ts +3 -3
- package/components/splitter/Splitter.ts +3 -3
- package/components/tab/BaseTab.ts +3 -3
- package/components/tab/DetailTabPage.ts +4 -4
- package/components/tab/Tab.ts +4 -4
- package/components/task/TaskBar.ts +3 -3
- package/components/task/TaskTiles.ts +3 -3
- package/components/topbar/TopBar.ts +2 -0
- package/components/tree-view/TreeView.ts +3 -3
- package/controls/DateControl.ts +6 -6
- package/controls/DateControlObjects.ts +0 -0
- package/controls/FormComboBox.ts +7 -7
- package/controls/FormComboBoxObjects.ts +0 -0
- package/controls/GridColumnControl.ts +68 -0
- package/controls/GridColumnControlObjects.ts +20 -0
- package/controls/InputFieldControl.ts +6 -6
- package/controls/InputFieldControlObjects.ts +0 -0
- package/controls/LookupDropdown.ts +58 -16
- package/controls/index.ts +1 -0
- package/dist/Testwise.d.ts +1 -0
- package/dist/Testwise.js +1 -0
- package/dist/Testwise.js.map +1 -1
- package/dist/artifact-builder/SelectorBuilder.d.ts +1 -1
- package/dist/artifact-builder/SelectorBuilder.js +2 -2
- package/dist/artifact-builder/SelectorBuilder.js.map +1 -1
- package/dist/artifact-builder/SubjectComponentGenerator.js +18 -12
- package/dist/artifact-builder/SubjectComponentGenerator.js.map +1 -1
- package/dist/artifact-builder/SubjectGenerator.d.ts +1 -0
- package/dist/artifact-builder/SubjectGenerator.js +20 -8
- package/dist/artifact-builder/SubjectGenerator.js.map +1 -1
- package/dist/components/action-bar/ActionBar.d.ts +2 -2
- package/dist/components/action-bar/ActionBar.js +7 -7
- package/dist/components/action-bar/ActionBar.js.map +1 -1
- package/dist/components/action-bar/CustomActionBar.d.ts +0 -2
- package/dist/components/action-bar/CustomActionBar.js +0 -3
- package/dist/components/action-bar/CustomActionBar.js.map +1 -1
- package/dist/components/cardlist/Cardlist.d.ts +2 -2
- package/dist/components/cardlist/Cardlist.js +2 -2
- package/dist/components/cardlist/Cardlist.js.map +1 -1
- package/dist/components/chart/Chart.d.ts +2 -2
- package/dist/components/chart/Chart.js +2 -2
- package/dist/components/chart/Chart.js.map +1 -1
- package/dist/components/combined-filter/CombinedFilter.d.ts +2 -2
- package/dist/components/combined-filter/CombinedFilter.js +2 -2
- package/dist/components/combined-filter/CombinedFilter.js.map +1 -1
- package/dist/components/cube-view-bar/CubeViewBar.d.ts +2 -2
- package/dist/components/cube-view-bar/CubeViewBar.js +2 -2
- package/dist/components/cube-view-bar/CubeViewBar.js.map +1 -1
- package/dist/components/filter/ExcelStyleFilterPopup.d.ts +9 -0
- package/dist/components/filter/ExcelStyleFilterPopup.js +22 -0
- package/dist/components/filter/ExcelStyleFilterPopup.js.map +1 -0
- package/dist/components/filter/ExcelStyleFilterPopupObjects.d.ts +9 -0
- package/dist/components/filter/ExcelStyleFilterPopupObjects.js +13 -0
- package/dist/components/filter/ExcelStyleFilterPopupObjects.js.map +1 -0
- package/dist/components/filter/FilterForm.d.ts +2 -2
- package/dist/components/filter/FilterForm.js +2 -2
- package/dist/components/filter/FilterForm.js.map +1 -1
- package/dist/components/filter/FilterPopup.d.ts +41 -0
- package/dist/components/filter/FilterPopup.js +126 -0
- package/dist/components/filter/FilterPopup.js.map +1 -0
- package/dist/components/filter/FilterPopupObjects.d.ts +29 -0
- package/dist/components/filter/FilterPopupObjects.js +30 -0
- package/dist/components/filter/FilterPopupObjects.js.map +1 -0
- package/dist/components/filter/ManagePrefilterPopup.d.ts +14 -0
- package/dist/components/filter/ManagePrefilterPopup.js +33 -0
- package/dist/components/filter/ManagePrefilterPopup.js.map +1 -0
- package/dist/components/filter/ManagePrefilterPopupObjects.d.ts +11 -0
- package/dist/components/filter/ManagePrefilterPopupObjects.js +19 -0
- package/dist/components/filter/ManagePrefilterPopupObjects.js.map +1 -0
- package/dist/components/form/Form.d.ts +2 -2
- package/dist/components/form/Form.js +2 -2
- package/dist/components/form/Form.js.map +1 -1
- package/dist/components/grid/Grid.d.ts +4 -36
- package/dist/components/grid/Grid.js +14 -102
- package/dist/components/grid/Grid.js.map +1 -1
- package/dist/components/grid/GridObjects.d.ts +0 -2
- package/dist/components/grid/GridObjects.js +0 -2
- package/dist/components/grid/GridObjects.js.map +1 -1
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.js +4 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/maps/Maps.d.ts +2 -2
- package/dist/components/maps/Maps.js +2 -2
- package/dist/components/maps/Maps.js.map +1 -1
- package/dist/components/menu/ListBarMenuComponent.d.ts +6 -0
- package/dist/components/menu/ListBarMenuComponent.js +10 -0
- package/dist/components/menu/ListBarMenuComponent.js.map +1 -1
- package/dist/components/menu/ListBarMenuComponentObjects.d.ts +2 -0
- package/dist/components/menu/ListBarMenuComponentObjects.js +2 -0
- package/dist/components/menu/ListBarMenuComponentObjects.js.map +1 -1
- package/dist/components/pivot-grid/PivotGrid.d.ts +2 -2
- package/dist/components/pivot-grid/PivotGrid.js +2 -2
- package/dist/components/pivot-grid/PivotGrid.js.map +1 -1
- package/dist/components/pivot-grid/PivotGridFieldList.d.ts +2 -2
- package/dist/components/pivot-grid/PivotGridFieldList.js +2 -2
- package/dist/components/pivot-grid/PivotGridFieldList.js.map +1 -1
- package/dist/components/pop-up/AllRowsPopUp.d.ts +12 -0
- package/dist/components/pop-up/AllRowsPopUp.js +19 -0
- package/dist/components/pop-up/AllRowsPopUp.js.map +1 -0
- package/dist/components/pop-up/AllRowsPopUpObjects.d.ts +11 -0
- package/dist/components/pop-up/AllRowsPopUpObjects.js +13 -0
- package/dist/components/pop-up/AllRowsPopUpObjects.js.map +1 -0
- package/dist/components/prefilter-list/PrefilterList.d.ts +2 -2
- package/dist/components/prefilter-list/PrefilterList.js +2 -2
- package/dist/components/prefilter-list/PrefilterList.js.map +1 -1
- package/dist/components/preview/Preview.d.ts +2 -2
- package/dist/components/preview/Preview.js +2 -2
- package/dist/components/preview/Preview.js.map +1 -1
- package/dist/components/report-bar/ReportBar.d.ts +2 -2
- package/dist/components/report-bar/ReportBar.js +2 -2
- package/dist/components/report-bar/ReportBar.js.map +1 -1
- package/dist/components/report-tiles/ReportTiles.d.ts +2 -2
- package/dist/components/report-tiles/ReportTiles.js +2 -2
- package/dist/components/report-tiles/ReportTiles.js.map +1 -1
- package/dist/components/scheduler/Scheduler.d.ts +2 -2
- package/dist/components/scheduler/Scheduler.js +2 -2
- package/dist/components/scheduler/Scheduler.js.map +1 -1
- package/dist/components/splitter/Splitter.d.ts +2 -2
- package/dist/components/splitter/Splitter.js +2 -2
- package/dist/components/splitter/Splitter.js.map +1 -1
- package/dist/components/tab/BaseTab.d.ts +2 -2
- package/dist/components/tab/BaseTab.js +2 -2
- package/dist/components/tab/BaseTab.js.map +1 -1
- package/dist/components/tab/DetailTabPage.d.ts +2 -2
- package/dist/components/tab/DetailTabPage.js +3 -3
- package/dist/components/tab/DetailTabPage.js.map +1 -1
- package/dist/components/tab/Tab.d.ts +2 -2
- package/dist/components/tab/Tab.js +3 -3
- package/dist/components/tab/Tab.js.map +1 -1
- package/dist/components/task/TaskBar.d.ts +2 -2
- package/dist/components/task/TaskBar.js +2 -2
- package/dist/components/task/TaskBar.js.map +1 -1
- package/dist/components/task/TaskTiles.d.ts +2 -2
- package/dist/components/task/TaskTiles.js +2 -2
- package/dist/components/task/TaskTiles.js.map +1 -1
- package/dist/components/topbar/TopBar.d.ts +1 -0
- package/dist/components/topbar/TopBar.js +1 -0
- package/dist/components/topbar/TopBar.js.map +1 -1
- package/dist/components/tree-view/TreeView.d.ts +2 -2
- package/dist/components/tree-view/TreeView.js +2 -2
- package/dist/components/tree-view/TreeView.js.map +1 -1
- package/dist/controls/DateControl.d.ts +3 -3
- package/dist/controls/DateControl.js +5 -5
- package/dist/controls/DateControl.js.map +1 -1
- package/dist/controls/DateControlObjects.d.ts +1 -0
- package/dist/controls/DateControlObjects.js +2 -0
- package/dist/controls/DateControlObjects.js.map +1 -0
- package/dist/controls/FormComboBox.d.ts +2 -2
- package/dist/controls/FormComboBox.js +6 -6
- package/dist/controls/FormComboBox.js.map +1 -1
- package/dist/controls/FormComboBoxObjects.d.ts +1 -0
- package/dist/controls/FormComboBoxObjects.js +2 -0
- package/dist/controls/FormComboBoxObjects.js.map +1 -0
- package/dist/controls/GridColumnControl.d.ts +10 -0
- package/dist/controls/GridColumnControl.js +43 -0
- package/dist/controls/GridColumnControl.js.map +1 -0
- package/dist/controls/GridColumnControlObjects.d.ts +9 -0
- package/dist/controls/GridColumnControlObjects.js +13 -0
- package/dist/controls/GridColumnControlObjects.js.map +1 -0
- package/dist/controls/InputFieldControl.d.ts +3 -3
- package/dist/controls/InputFieldControl.js +5 -5
- package/dist/controls/InputFieldControl.js.map +1 -1
- package/dist/controls/InputFieldControlObjects.d.ts +1 -0
- package/dist/controls/InputFieldControlObjects.js +2 -0
- package/dist/controls/InputFieldControlObjects.js.map +1 -0
- package/dist/controls/LookupDropdown.d.ts +6 -1
- package/dist/controls/LookupDropdown.js +42 -13
- package/dist/controls/LookupDropdown.js.map +1 -1
- package/dist/controls/index.d.ts +1 -0
- package/dist/controls/index.js +1 -0
- package/dist/controls/index.js.map +1 -1
- package/dist/enums/ElementTypes.d.ts +1 -1
- package/dist/enums/ElementTypes.js +1 -1
- package/dist/enums/ElementTypes.js.map +1 -1
- package/dist/helpers/FlightTracker.d.ts +7 -0
- package/dist/helpers/FlightTracker.js +63 -11
- package/dist/helpers/FlightTracker.js.map +1 -1
- package/dist/helpers/LoginHelper.d.ts +11 -3
- package/dist/helpers/LoginHelper.js +59 -13
- package/dist/helpers/LoginHelper.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/page-extensions/GlobalComponents.d.ts +2 -1
- package/dist/page-extensions/GlobalComponents.js +2 -1
- package/dist/page-extensions/GlobalComponents.js.map +1 -1
- package/dist/page-overrides/ClickOverride.d.ts +1 -0
- package/dist/page-overrides/ClickOverride.js +57 -46
- package/dist/page-overrides/ClickOverride.js.map +1 -1
- package/dist/types/Universal.d.ts +1 -0
- package/enums/ElementTypes.ts +1 -1
- package/helpers/FlightTracker.ts +71 -11
- package/helpers/LoginHelper.ts +79 -21
- package/index.ts +1 -1
- package/package.json +6 -5
- package/page-extensions/GlobalComponents.ts +3 -0
- package/page-overrides/ClickOverride.ts +69 -64
- package/types/Universal.ts +1 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { Locator, Page } from '@playwright/test';
|
|
2
|
+
import { PopUpComponent } from '../pop-up/PopUpComponent.js';
|
|
3
|
+
import { ManagePrefilterPopupObjects } from './ManagePrefilterPopupObjects.js';
|
|
4
|
+
|
|
5
|
+
export class ManagePrefilterPopup extends PopUpComponent {
|
|
6
|
+
private readonly _page: Page;
|
|
7
|
+
private _managePrefilterPopupObjects: ManagePrefilterPopupObjects;
|
|
8
|
+
|
|
9
|
+
constructor(page: Page) {
|
|
10
|
+
super(page);
|
|
11
|
+
this._page = page;
|
|
12
|
+
this._managePrefilterPopupObjects = new ManagePrefilterPopupObjects(page);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
public dialog(): Locator {
|
|
16
|
+
return this._managePrefilterPopupObjects.dialog();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public list(): Locator {
|
|
20
|
+
return this._managePrefilterPopupObjects.list();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public getRowByName(name: string): Locator {
|
|
24
|
+
return this._managePrefilterPopupObjects.rowByName(name);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
public async closeDialog(): Promise<void> {
|
|
28
|
+
await this._managePrefilterPopupObjects.closeButton().click();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
public async deletePrefilterAndConfirm(name: string): Promise<void> {
|
|
32
|
+
const row = this.getRowByName(name);
|
|
33
|
+
await this._managePrefilterPopupObjects.deleteButtonByRow(row).click();
|
|
34
|
+
await this.confirmDelete();
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public async confirmDelete(): Promise<void> {
|
|
38
|
+
await this._page.components.popUp.getActionButtonByText('yes').click();
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
public async confirmNo(): Promise<void> {
|
|
42
|
+
await this._page.components.popUp.getActionButtonByText('no').click();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Locator, Page } from '@playwright/test';
|
|
2
|
+
import { BaseComponentObjects } from '../BaseComponentObjects.js';
|
|
3
|
+
|
|
4
|
+
export class ManagePrefilterPopupObjects extends BaseComponentObjects {
|
|
5
|
+
private _page: Page;
|
|
6
|
+
|
|
7
|
+
constructor(page: Page) {
|
|
8
|
+
super(page, page.locator('body'));
|
|
9
|
+
this._page = page;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
public dialog = () =>
|
|
13
|
+
this._page
|
|
14
|
+
.locator('[role="dialog"]')
|
|
15
|
+
.filter({ has: this._page.getByTestId('popup__userpreferenceprefilterpopup__title') });
|
|
16
|
+
|
|
17
|
+
public list = () => this._page.getByTestId('popup__user-preference__up-prefilters');
|
|
18
|
+
|
|
19
|
+
// The <li> has a GUID testid, so don't use it. Use "li hasText"
|
|
20
|
+
public rowByName = (name: string) => {
|
|
21
|
+
const nameSpan = this.list().getByText(name, { exact: true });
|
|
22
|
+
return nameSpan.locator('xpath=ancestor::li[1]');
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
public deleteButtonByRow = (row: Locator) => row.locator('button:has([data-testid="DeleteIcon"])');
|
|
26
|
+
|
|
27
|
+
public closeButton = () => this.dialog().getByTestId('popup__userpreferenceprefilterpopup__actions__close');
|
|
28
|
+
}
|
package/components/form/Form.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { Locator
|
|
1
|
+
import type { Locator } from '@playwright/test';
|
|
2
2
|
import { FormObjects } from './FormObjects.js';
|
|
3
3
|
|
|
4
4
|
export class Form {
|
|
5
5
|
private _objects: FormObjects;
|
|
6
6
|
|
|
7
|
-
constructor(
|
|
8
|
-
this._objects = new FormObjects(page, formContext);
|
|
7
|
+
constructor(formContext: Locator) {
|
|
8
|
+
this._objects = new FormObjects(formContext.page(), formContext);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
public getFieldByValue = (value: string): Locator => {
|
package/components/grid/Grid.ts
CHANGED
|
@@ -7,9 +7,9 @@ export class Grid {
|
|
|
7
7
|
private _gridObjects: GridObjects;
|
|
8
8
|
private _page: Page;
|
|
9
9
|
|
|
10
|
-
constructor(
|
|
11
|
-
this._gridObjects = new GridObjects(page, gridContext);
|
|
12
|
-
this._page = page;
|
|
10
|
+
constructor(gridContext: Locator) {
|
|
11
|
+
this._gridObjects = new GridObjects(gridContext.page(), gridContext);
|
|
12
|
+
this._page = gridContext.page();
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
protected get page() {
|
|
@@ -84,138 +84,34 @@ export class Grid {
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
/**
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
* This method scrolls the grid's vertical scrollbar in increments equal to the visible height of the viewport
|
|
90
|
-
* until no further scrolling is possible. It optionally executes a callback after each scroll step, which can
|
|
91
|
-
* be used to process loaded content (e.g., extract cell values).
|
|
92
|
-
*
|
|
93
|
-
* @param {Locator} scrollbar - Locator pointing to the grid's vertical scrollbar container.
|
|
94
|
-
* @param {() => Promise<void>} onScrollStep - Optional async callback invoked after each scroll step.
|
|
95
|
-
* @returns {Promise<void>} A promise that resolves once the scrolling is complete.
|
|
96
|
-
*/
|
|
97
|
-
private async scrollGridToLoadAllRows(scrollbar: Locator, onScrollStep?: () => Promise<void>): Promise<void> {
|
|
98
|
-
// Reset scroll to the top to start from the beginning
|
|
99
|
-
await scrollbar.evaluate((el) => {
|
|
100
|
-
el.scrollTop = 0;
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
let lastScrollTop = -1;
|
|
104
|
-
|
|
105
|
-
while (true) {
|
|
106
|
-
// Get the current vertical scroll position
|
|
107
|
-
const scrollTop = await scrollbar.evaluate((el) => el.scrollTop);
|
|
108
|
-
|
|
109
|
-
// Stop if the scroll position hasn’t changed — end of scroll reached
|
|
110
|
-
if (scrollTop === lastScrollTop) break;
|
|
111
|
-
|
|
112
|
-
lastScrollTop = scrollTop;
|
|
113
|
-
|
|
114
|
-
// Scroll one viewport height down
|
|
115
|
-
await scrollbar.evaluate((el) => {
|
|
116
|
-
el.scrollBy({ top: el.clientHeight, behavior: 'instant' });
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
// Optional callback to collect or act on content loaded during this scroll step
|
|
120
|
-
if (onScrollStep) {
|
|
121
|
-
await onScrollStep();
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
// Wait briefly for the new rows to render
|
|
125
|
-
await this._page.waitForTimeout(100);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Retrieves all unique cell values from a specific column in the grid,
|
|
131
|
-
* including values that are only loaded upon scrolling.
|
|
132
|
-
*
|
|
133
|
-
* Internally uses vertical scrolling to ensure that all rows are loaded,
|
|
134
|
-
* and collects cell text content from the specified column.
|
|
135
|
-
*
|
|
136
|
-
* @param {string} colId - The ID of the column to extract values from.
|
|
137
|
-
* @returns {Promise<string[]>} A promise that resolves to an array of unique values from the column.
|
|
87
|
+
* Gets all unique cell values for a specified column by its column ID.
|
|
138
88
|
*/
|
|
139
89
|
public async getCellValuesByColId(colId: string): Promise<string[]> {
|
|
140
|
-
// Locator for vertical scrollbar used to scroll through grid rows
|
|
141
|
-
const scrollbar = this._gridObjects.verticalScrollbar();
|
|
142
|
-
// Locator for cells in the specified column using AG Grid col-id
|
|
143
90
|
const cellsLocator = this._gridObjects.cellsByColumnId(colId);
|
|
144
|
-
|
|
91
|
+
const visibleValues = await cellsLocator.allTextContents();
|
|
145
92
|
const collected = new Set<string>();
|
|
146
|
-
// Scroll the grid and collect visible cell values after each scroll step
|
|
147
|
-
await this.scrollGridToLoadAllRows(scrollbar, async () => {
|
|
148
|
-
const visibleValues = await cellsLocator.allTextContents();
|
|
149
|
-
|
|
150
|
-
for (const value of visibleValues.map((value: string) => value.trim()).filter(Boolean)) {
|
|
151
|
-
collected.add(value);
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
// Return unique values as an array
|
|
155
|
-
return Array.from(collected);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* Scrolls through the horizontal grid viewport to ensure all columns are loaded.
|
|
160
|
-
*
|
|
161
|
-
* This method scrolls the grid's horizontal scrollbar in increments equal to the visible width
|
|
162
|
-
* of the viewport until no further scrolling is possible. It optionally executes a callback
|
|
163
|
-
* after each scroll step, useful for collecting or processing visible column headers.
|
|
164
|
-
*
|
|
165
|
-
* @param {Locator} scrollbar - Locator pointing to the horizontal scrollbar container.
|
|
166
|
-
* @param {() => Promise<void>} onScrollStep - Optional async callback executed after each scroll step.
|
|
167
|
-
* @returns {Promise<void>} A promise that resolves when horizontal scrolling is complete.
|
|
168
|
-
*/
|
|
169
|
-
private async scrollGridHorizontallyToLoadAllColumns(
|
|
170
|
-
scrollbar: Locator,
|
|
171
|
-
onScrollStep?: () => Promise<void>
|
|
172
|
-
): Promise<void> {
|
|
173
|
-
// Reset scroll to the far left
|
|
174
|
-
await scrollbar.evaluate((el) => {
|
|
175
|
-
el.scrollLeft = 0;
|
|
176
|
-
});
|
|
177
|
-
|
|
178
|
-
let lastScrollLeft = -1;
|
|
179
|
-
|
|
180
|
-
while (true) {
|
|
181
|
-
const scrollLeft = await scrollbar.evaluate((el) => el.scrollLeft);
|
|
182
93
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
lastScrollLeft = scrollLeft;
|
|
186
|
-
|
|
187
|
-
// Scroll one viewport width to the right
|
|
188
|
-
await scrollbar.evaluate((el) => {
|
|
189
|
-
el.scrollBy({ left: el.clientWidth, behavior: 'instant' });
|
|
190
|
-
});
|
|
191
|
-
|
|
192
|
-
if (onScrollStep) {
|
|
193
|
-
await onScrollStep();
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
await this._page.waitForTimeout(100); // Allow time for rendering
|
|
94
|
+
for (const value of visibleValues.map((value: string) => value.trim()).filter(Boolean)) {
|
|
95
|
+
collected.add(value);
|
|
197
96
|
}
|
|
97
|
+
|
|
98
|
+
return Array.from(collected);
|
|
198
99
|
}
|
|
199
100
|
|
|
200
101
|
/**
|
|
201
|
-
* Retrieves all column header values from the grid
|
|
102
|
+
* Retrieves all column header values from the grid.
|
|
202
103
|
*
|
|
203
|
-
* This method
|
|
204
|
-
* collects the text content of each header, and returns a unique list of trimmed, non-empty values.
|
|
104
|
+
* This method collects the text content of each header and returns a unique list of trimmed, non-empty values.
|
|
205
105
|
*
|
|
206
106
|
* @returns {Promise<string[]>} A promise that resolves to an array of unique column header values.
|
|
207
107
|
*/
|
|
208
108
|
public async getColumnHeaderValues(): Promise<string[]> {
|
|
209
|
-
const scrollbar = this._gridObjects.horizontalScrollbar();
|
|
210
109
|
const headersLocator = this._gridObjects.columnHeaders();
|
|
211
110
|
const collected = new Set<string>();
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
collected.add(header);
|
|
217
|
-
}
|
|
218
|
-
});
|
|
111
|
+
const visibleHeaders = await headersLocator.allTextContents();
|
|
112
|
+
for (const header of visibleHeaders.map((header) => header.trim()).filter(Boolean)) {
|
|
113
|
+
collected.add(header);
|
|
114
|
+
}
|
|
219
115
|
|
|
220
116
|
return Array.from(collected);
|
|
221
117
|
}
|
|
@@ -29,10 +29,6 @@ export class GridObjects extends BaseComponentObjects {
|
|
|
29
29
|
|
|
30
30
|
public rows = () => this.context.locator('[role="row"]');
|
|
31
31
|
|
|
32
|
-
public verticalScrollbar = () => this.context.locator('.ag-body-vertical-scroll-viewport');
|
|
33
|
-
|
|
34
|
-
public horizontalScrollbar = () => this.context.locator('.ag-body-horizontal-scroll-viewport');
|
|
35
|
-
|
|
36
32
|
public cellsByColumnId = (colId: string) => this.context.locator(`[col-id="${colId}"] .value-renderer`);
|
|
37
33
|
|
|
38
34
|
public columnByRowLocator = (rowLocator: Locator) => rowLocator.locator('.ag-cell');
|
package/components/index.ts
CHANGED
|
@@ -5,13 +5,17 @@ export * from './chart/Chart.js';
|
|
|
5
5
|
export * from './combined-filter/CombinedFilter.js';
|
|
6
6
|
export * from './cube-view-bar/CubeViewBar.js';
|
|
7
7
|
export * from './export/ExportComponent.js';
|
|
8
|
+
export * from './filter/ExcelStyleFilterPopup.js';
|
|
8
9
|
export * from './filter/FilterForm.js';
|
|
10
|
+
export * from './filter/FilterPopup.js';
|
|
11
|
+
export * from './filter/ManagePrefilterPopup.js';
|
|
9
12
|
export * from './form/Form.js';
|
|
10
13
|
export * from './grid/Grid.js';
|
|
11
14
|
export * from './maps/Maps.js';
|
|
12
15
|
export * from './menu/ListBarMenuComponent.js';
|
|
13
16
|
export * from './pivot-grid/PivotGrid.js';
|
|
14
17
|
export * from './pivot-grid/PivotGridFieldList.js';
|
|
18
|
+
export * from './pop-up/AllRowsPopUp.js';
|
|
15
19
|
export * from './pop-up/PopUpComponent.js';
|
|
16
20
|
export * from './prefilter-list/PrefilterList.js';
|
|
17
21
|
export * from './preview/Preview.js';
|
package/components/maps/Maps.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { Locator
|
|
1
|
+
import type { Locator } from '@playwright/test';
|
|
2
2
|
import { MapsObjects } from './MapsObjects.js';
|
|
3
3
|
|
|
4
4
|
export class Maps {
|
|
5
5
|
mapsObjects: MapsObjects;
|
|
6
6
|
|
|
7
|
-
constructor(
|
|
8
|
-
this.mapsObjects = new MapsObjects(page, context);
|
|
7
|
+
constructor(context: Locator) {
|
|
8
|
+
this.mapsObjects = new MapsObjects(context.page(), context);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
public get context(): Locator | null {
|
|
@@ -34,4 +34,15 @@ export class ListBarMenuComponent {
|
|
|
34
34
|
public getMenuItemByName(groupName: string, itemName: string): Locator {
|
|
35
35
|
return this._objects.menuItem(groupName, itemName);
|
|
36
36
|
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Closes a document in the list bar.
|
|
40
|
+
* @param documentId The ID of the document to close.
|
|
41
|
+
* @param hasUnsavedChanges Whether the document has unsaved changes.
|
|
42
|
+
*/
|
|
43
|
+
public async closeDocument(documentId: string, hasUnsavedChanges: boolean = false) {
|
|
44
|
+
if (hasUnsavedChanges) await this._objects.openedDocumentUnsavedChangesIcon(documentId).hover();
|
|
45
|
+
|
|
46
|
+
await this._objects.openedDocumentCloseButton(documentId).click();
|
|
47
|
+
}
|
|
37
48
|
}
|
|
@@ -11,4 +11,10 @@ export class ListBarMenuComponentObjects {
|
|
|
11
11
|
|
|
12
12
|
public menuItem = (groupName: string, itemName: string) =>
|
|
13
13
|
this._page.locator(`[data-testid="listbar__${groupName}__item__${itemName}"]`);
|
|
14
|
+
|
|
15
|
+
public openedDocumentCloseButton = (documentId: string) =>
|
|
16
|
+
this._page.locator(`[data-testid^="opened-document__${documentId}"][data-testid$="__close"]`);
|
|
17
|
+
|
|
18
|
+
public openedDocumentUnsavedChangesIcon = (documentId: string) =>
|
|
19
|
+
this._page.locator(`[data-testid^="opened-document__${documentId}"][data-testid$="__unsaved-changes"]`);
|
|
14
20
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { Locator
|
|
1
|
+
import type { Locator } from '@playwright/test';
|
|
2
2
|
import { PivotGridObjects } from './PivotGridObjects.js';
|
|
3
3
|
|
|
4
4
|
export class PivotGrid {
|
|
5
5
|
pivotGridObjects: PivotGridObjects;
|
|
6
6
|
|
|
7
|
-
constructor(
|
|
8
|
-
this.pivotGridObjects = new PivotGridObjects(page, context);
|
|
7
|
+
constructor(context: Locator) {
|
|
8
|
+
this.pivotGridObjects = new PivotGridObjects(context.page(), context);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
public get context(): Locator | null {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { Locator
|
|
1
|
+
import type { Locator } from '@playwright/test';
|
|
2
2
|
import { PivotGridFieldListObjects } from './PivotGridFieldListObjects.js';
|
|
3
3
|
|
|
4
4
|
export class PivotGridFieldList {
|
|
5
5
|
pivotGridFieldListObjects: PivotGridFieldListObjects;
|
|
6
6
|
|
|
7
|
-
constructor(
|
|
8
|
-
this.pivotGridFieldListObjects = new PivotGridFieldListObjects(page
|
|
7
|
+
constructor(context: Locator) {
|
|
8
|
+
this.pivotGridFieldListObjects = new PivotGridFieldListObjects(context.page());
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
public get context(): Locator | null {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Locator, Page } from '@playwright/test';
|
|
2
|
+
import { pollUntil } from '../../helpers/Poll.js';
|
|
3
|
+
import { AllRowsPopupObjects } from './AllRowsPopUpObjects.js';
|
|
4
|
+
|
|
5
|
+
export class AllRowsPopup {
|
|
6
|
+
private readonly deletePopup: boolean;
|
|
7
|
+
private _allRowsPopupObjects: AllRowsPopupObjects;
|
|
8
|
+
|
|
9
|
+
constructor(page: Page, deletePopup?: boolean) {
|
|
10
|
+
this.deletePopup = deletePopup ?? false;
|
|
11
|
+
this._allRowsPopupObjects = new AllRowsPopupObjects(page);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
anchor(): Locator {
|
|
15
|
+
return this._allRowsPopupObjects.anchor(this.deletePopup);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async waitForOpen(): Promise<void> {
|
|
19
|
+
await pollUntil(() => this._allRowsPopupObjects.anchor(this.deletePopup).isVisible(), { predicate: Boolean });
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
public selectedRowsRadioButton = (): Locator => this._allRowsPopupObjects.selectedRowsRadioButton();
|
|
23
|
+
|
|
24
|
+
public allRowsRadioButton = (): Locator => this._allRowsPopupObjects.allRowsRadioButton();
|
|
25
|
+
|
|
26
|
+
public confirmButton = (): Locator => this._allRowsPopupObjects.confirmButton();
|
|
27
|
+
|
|
28
|
+
public cancelButton = (): Locator => this._allRowsPopupObjects.cancelButton();
|
|
29
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Page } from '@playwright/test';
|
|
2
|
+
import { BaseComponentObjects } from '../BaseComponentObjects.js';
|
|
3
|
+
|
|
4
|
+
export class AllRowsPopupObjects extends BaseComponentObjects {
|
|
5
|
+
private _page: Page;
|
|
6
|
+
|
|
7
|
+
constructor(page: Page) {
|
|
8
|
+
super(page, page.locator('body'));
|
|
9
|
+
this._page = page;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
public anchor = (deletePopup: boolean) =>
|
|
13
|
+
this._page.getByTestId(deletePopup ? 'popup__allrowsdelete__content' : 'popup__allrows__content');
|
|
14
|
+
|
|
15
|
+
public selectedRowsRadioButton = () => this._page.getByTestId('radio-button-option__selected-rows__input');
|
|
16
|
+
|
|
17
|
+
public allRowsRadioButton = () => this._page.getByTestId('radio-button-option__all-rows__input');
|
|
18
|
+
|
|
19
|
+
public confirmButton = () => this._page.getByTestId('all-rows-complete-button');
|
|
20
|
+
|
|
21
|
+
public cancelButton = () => this._page.getByTestId('all-rows-cancel-button');
|
|
22
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { Locator
|
|
1
|
+
import type { Locator } from '@playwright/test';
|
|
2
2
|
import { PrefilterListObjects } from './PrefilterListObjects.js';
|
|
3
3
|
|
|
4
4
|
export class PrefilterList {
|
|
5
5
|
prefilterListObjects: PrefilterListObjects;
|
|
6
6
|
|
|
7
|
-
constructor(
|
|
8
|
-
this.prefilterListObjects = new PrefilterListObjects(page, context);
|
|
7
|
+
constructor(context: Locator) {
|
|
8
|
+
this.prefilterListObjects = new PrefilterListObjects(context.page(), context);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
public get context(): Locator | null {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { Locator
|
|
1
|
+
import type { Locator } from '@playwright/test';
|
|
2
2
|
import { PreviewObjects } from './PreviewObjects.js';
|
|
3
3
|
|
|
4
4
|
export class Preview {
|
|
5
5
|
previewObjects: PreviewObjects;
|
|
6
6
|
|
|
7
|
-
constructor(
|
|
8
|
-
this.previewObjects = new PreviewObjects(page, context);
|
|
7
|
+
constructor(context: Locator) {
|
|
8
|
+
this.previewObjects = new PreviewObjects(context.page(), context);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
public get context(): Locator | null {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { Locator
|
|
1
|
+
import type { Locator } from '@playwright/test';
|
|
2
2
|
import { ReportBarObjects } from './ReportBarObjects.js';
|
|
3
3
|
|
|
4
4
|
export class ReportBar {
|
|
5
5
|
reportBarObjects: ReportBarObjects;
|
|
6
6
|
|
|
7
|
-
constructor(
|
|
8
|
-
this.reportBarObjects = new ReportBarObjects(page, context);
|
|
7
|
+
constructor(context: Locator) {
|
|
8
|
+
this.reportBarObjects = new ReportBarObjects(context.page(), context);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
public get context(): Locator | null {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { Locator
|
|
1
|
+
import type { Locator } from '@playwright/test';
|
|
2
2
|
import { ReportTilesObjects } from './ReportTilesObjects.js';
|
|
3
3
|
|
|
4
4
|
export class ReportTiles {
|
|
5
5
|
reportTilesObjects: ReportTilesObjects;
|
|
6
6
|
|
|
7
|
-
constructor(
|
|
8
|
-
this.reportTilesObjects = new ReportTilesObjects(page, context);
|
|
7
|
+
constructor(context: Locator) {
|
|
8
|
+
this.reportTilesObjects = new ReportTilesObjects(context.page(), context);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
public get context(): Locator | null {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { Locator
|
|
1
|
+
import type { Locator } from '@playwright/test';
|
|
2
2
|
import { SchedulerObjects } from './SchedulerObjects.js';
|
|
3
3
|
|
|
4
4
|
export class Scheduler {
|
|
5
5
|
treeViewObjects: SchedulerObjects;
|
|
6
6
|
|
|
7
|
-
constructor(
|
|
8
|
-
this.treeViewObjects = new SchedulerObjects(page, context);
|
|
7
|
+
constructor(context: Locator) {
|
|
8
|
+
this.treeViewObjects = new SchedulerObjects(context.page(), context);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
public get context(): Locator | null {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { Locator
|
|
1
|
+
import type { Locator } from '@playwright/test';
|
|
2
2
|
import { SplitterObjects } from './SplitterObjects.js';
|
|
3
3
|
|
|
4
4
|
export class Splitter {
|
|
5
5
|
splitterObjects: SplitterObjects;
|
|
6
6
|
|
|
7
7
|
// ToDo: this is not the correct implementation, its temporary to allow generation to continue
|
|
8
|
-
constructor(
|
|
9
|
-
this.splitterObjects = new SplitterObjects(page, context);
|
|
8
|
+
constructor(context: Locator) {
|
|
9
|
+
this.splitterObjects = new SplitterObjects(context.page(), context);
|
|
10
10
|
}
|
|
11
11
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { Locator
|
|
1
|
+
import type { Locator } from '@playwright/test';
|
|
2
2
|
import { BaseTabObjects } from './BaseTabObjects.js';
|
|
3
3
|
|
|
4
4
|
export class BaseTab {
|
|
5
5
|
protected _objects: BaseTabObjects;
|
|
6
6
|
|
|
7
|
-
constructor(
|
|
8
|
-
this._objects = new BaseTabObjects(page, context);
|
|
7
|
+
constructor(context: Locator) {
|
|
8
|
+
this._objects = new BaseTabObjects(context.page(), context);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
// --- Common actions ---
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type { Locator
|
|
1
|
+
import type { Locator } from '@playwright/test';
|
|
2
2
|
import { BaseTab } from './BaseTab.js';
|
|
3
3
|
import { DetailTabPageObjects } from './DetailTabPageObjects.js';
|
|
4
4
|
|
|
5
5
|
export class DetailTabPage extends BaseTab {
|
|
6
6
|
protected _objects: DetailTabPageObjects;
|
|
7
7
|
|
|
8
|
-
constructor(
|
|
9
|
-
super(
|
|
10
|
-
this._objects = new DetailTabPageObjects(page, context);
|
|
8
|
+
constructor(context: Locator) {
|
|
9
|
+
super(context);
|
|
10
|
+
this._objects = new DetailTabPageObjects(context.page(), context);
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
public getDetailTabPageById(name: string): Locator {
|
package/components/tab/Tab.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type { Locator
|
|
1
|
+
import type { Locator } from '@playwright/test';
|
|
2
2
|
import { BaseTab } from './BaseTab.js';
|
|
3
3
|
import { TabObjects } from './TabObjects.js';
|
|
4
4
|
|
|
5
5
|
export class Tab extends BaseTab {
|
|
6
6
|
protected _objects: TabObjects;
|
|
7
7
|
|
|
8
|
-
constructor(
|
|
9
|
-
super(
|
|
10
|
-
this._objects = new TabObjects(page, context);
|
|
8
|
+
constructor(context: Locator) {
|
|
9
|
+
super(context);
|
|
10
|
+
this._objects = new TabObjects(context.page(), context);
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
// --- Component-specific helpers ---
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Locator
|
|
1
|
+
import type { Locator } from '@playwright/test';
|
|
2
2
|
import { TaskBarObjects } from './TaskBarObjects.js';
|
|
3
3
|
|
|
4
4
|
export class TaskBar {
|
|
@@ -7,8 +7,8 @@ export class TaskBar {
|
|
|
7
7
|
/**
|
|
8
8
|
* @param taskBarContext the taskbar container element (same idea as Grid's context)
|
|
9
9
|
*/
|
|
10
|
-
constructor(
|
|
11
|
-
this._taskBarObjects = new TaskBarObjects(page, taskBarContext);
|
|
10
|
+
constructor(taskBarContext: Locator) {
|
|
11
|
+
this._taskBarObjects = new TaskBarObjects(taskBarContext.page(), taskBarContext);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
/** returns all task buttons */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Locator
|
|
1
|
+
import type { Locator } from '@playwright/test';
|
|
2
2
|
import { TaskTilesObjects } from './TaskTilesObjects.js';
|
|
3
3
|
|
|
4
4
|
export class TaskTiles {
|
|
@@ -7,8 +7,8 @@ export class TaskTiles {
|
|
|
7
7
|
/**
|
|
8
8
|
* @param taskTilesContext the taskTiles container element
|
|
9
9
|
*/
|
|
10
|
-
constructor(
|
|
11
|
-
this._taskTilesObjects = new TaskTilesObjects(page, taskTilesContext);
|
|
10
|
+
constructor(taskTilesContext: Locator) {
|
|
11
|
+
this._taskTilesObjects = new TaskTilesObjects(taskTilesContext.page(), taskTilesContext);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
/** returns all task tile buttons */
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { Locator
|
|
1
|
+
import type { Locator } from '@playwright/test';
|
|
2
2
|
import { TreeViewObjects } from './TreeViewObjects.js';
|
|
3
3
|
|
|
4
4
|
export class TreeView {
|
|
5
5
|
treeViewObjects: TreeViewObjects;
|
|
6
6
|
|
|
7
|
-
constructor(
|
|
8
|
-
this.treeViewObjects = new TreeViewObjects(page, context);
|
|
7
|
+
constructor(context: Locator) {
|
|
8
|
+
this.treeViewObjects = new TreeViewObjects(context.page(), context);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
public get context(): Locator | null {
|