@thinkwise/testwise 0.2.21 → 0.2.67

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.
Files changed (234) hide show
  1. package/Testwise.ts +2 -0
  2. package/artifact-builder/SelectorBuilder.ts +2 -2
  3. package/artifact-builder/SubjectComponentGenerator.ts +21 -12
  4. package/artifact-builder/SubjectGenerator.ts +20 -6
  5. package/components/action-bar/ActionBar.ts +7 -7
  6. package/components/action-bar/CustomActionBar.ts +0 -5
  7. package/components/cardlist/Cardlist.ts +3 -3
  8. package/components/chart/Chart.ts +3 -3
  9. package/components/combined-filter/CombinedFilter.ts +3 -3
  10. package/components/cube-view-bar/CubeViewBar.ts +3 -3
  11. package/components/filter/ExcelStyleFilterPopup.ts +69 -0
  12. package/components/filter/ExcelStyleFilterPopupObjects.ts +46 -0
  13. package/components/filter/FilterForm.ts +3 -3
  14. package/components/filter/FilterPopup.ts +187 -0
  15. package/components/filter/FilterPopupObjects.ts +63 -0
  16. package/components/filter/ManagePrefilterPopup.ts +44 -0
  17. package/components/filter/ManagePrefilterPopupObjects.ts +28 -0
  18. package/components/form/Form.ts +3 -3
  19. package/components/grid/Grid.ts +48 -133
  20. package/components/grid/GridObjects.ts +0 -19
  21. package/components/index.ts +4 -0
  22. package/components/maps/Maps.ts +3 -3
  23. package/components/menu/ListBarMenuComponent.ts +11 -0
  24. package/components/menu/ListBarMenuComponentObjects.ts +6 -0
  25. package/components/pivot-grid/PivotGrid.ts +3 -3
  26. package/components/pivot-grid/PivotGridFieldList.ts +3 -3
  27. package/components/pop-up/AllRowsPopUp.ts +29 -0
  28. package/components/pop-up/AllRowsPopUpObjects.ts +22 -0
  29. package/components/prefilter-list/PrefilterList.ts +3 -3
  30. package/components/preview/Preview.ts +3 -3
  31. package/components/report-bar/ReportBar.ts +3 -3
  32. package/components/report-tiles/ReportTiles.ts +3 -3
  33. package/components/scheduler/Scheduler.ts +3 -3
  34. package/components/splitter/Splitter.ts +3 -3
  35. package/components/tab/BaseTab.ts +3 -3
  36. package/components/tab/DetailTabPage.ts +4 -4
  37. package/components/tab/Tab.ts +4 -4
  38. package/components/task/TaskBar.ts +3 -3
  39. package/components/task/TaskTiles.ts +3 -3
  40. package/components/topbar/TopBar.ts +2 -0
  41. package/components/tree-view/TreeView.ts +3 -3
  42. package/controls/DateControl.ts +13 -14
  43. package/controls/DateControlObjects.ts +15 -0
  44. package/controls/FormComboBox.ts +17 -30
  45. package/controls/FormComboBoxObjects.ts +27 -0
  46. package/controls/GridColumnControl.ts +68 -0
  47. package/controls/GridColumnControlObjects.ts +20 -0
  48. package/controls/InputFieldControl.ts +17 -20
  49. package/controls/InputFieldControlObjects.ts +19 -0
  50. package/controls/LookupDropdown.ts +65 -24
  51. package/controls/LookupDropdownObjects.ts +19 -0
  52. package/controls/index.ts +1 -0
  53. package/dist/Testwise.d.ts +1 -0
  54. package/dist/Testwise.js +1 -0
  55. package/dist/Testwise.js.map +1 -1
  56. package/dist/artifact-builder/SelectorBuilder.d.ts +1 -1
  57. package/dist/artifact-builder/SelectorBuilder.js +2 -2
  58. package/dist/artifact-builder/SelectorBuilder.js.map +1 -1
  59. package/dist/artifact-builder/SubjectComponentGenerator.js +18 -12
  60. package/dist/artifact-builder/SubjectComponentGenerator.js.map +1 -1
  61. package/dist/artifact-builder/SubjectGenerator.d.ts +1 -0
  62. package/dist/artifact-builder/SubjectGenerator.js +16 -6
  63. package/dist/artifact-builder/SubjectGenerator.js.map +1 -1
  64. package/dist/components/action-bar/ActionBar.d.ts +2 -2
  65. package/dist/components/action-bar/ActionBar.js +7 -7
  66. package/dist/components/action-bar/ActionBar.js.map +1 -1
  67. package/dist/components/action-bar/CustomActionBar.d.ts +0 -2
  68. package/dist/components/action-bar/CustomActionBar.js +0 -3
  69. package/dist/components/action-bar/CustomActionBar.js.map +1 -1
  70. package/dist/components/cardlist/Cardlist.d.ts +2 -2
  71. package/dist/components/cardlist/Cardlist.js +2 -2
  72. package/dist/components/cardlist/Cardlist.js.map +1 -1
  73. package/dist/components/chart/Chart.d.ts +2 -2
  74. package/dist/components/chart/Chart.js +2 -2
  75. package/dist/components/chart/Chart.js.map +1 -1
  76. package/dist/components/combined-filter/CombinedFilter.d.ts +2 -2
  77. package/dist/components/combined-filter/CombinedFilter.js +2 -2
  78. package/dist/components/combined-filter/CombinedFilter.js.map +1 -1
  79. package/dist/components/cube-view-bar/CubeViewBar.d.ts +2 -2
  80. package/dist/components/cube-view-bar/CubeViewBar.js +2 -2
  81. package/dist/components/cube-view-bar/CubeViewBar.js.map +1 -1
  82. package/dist/components/filter/ExcelStyleFilterPopup.d.ts +19 -0
  83. package/dist/components/filter/ExcelStyleFilterPopup.js +64 -0
  84. package/dist/components/filter/ExcelStyleFilterPopup.js.map +1 -0
  85. package/dist/components/filter/ExcelStyleFilterPopupObjects.d.ts +16 -0
  86. package/dist/components/filter/ExcelStyleFilterPopupObjects.js +26 -0
  87. package/dist/components/filter/ExcelStyleFilterPopupObjects.js.map +1 -0
  88. package/dist/components/filter/FilterForm.d.ts +2 -2
  89. package/dist/components/filter/FilterForm.js +2 -2
  90. package/dist/components/filter/FilterForm.js.map +1 -1
  91. package/dist/components/filter/FilterPopup.d.ts +41 -0
  92. package/dist/components/filter/FilterPopup.js +126 -0
  93. package/dist/components/filter/FilterPopup.js.map +1 -0
  94. package/dist/components/filter/FilterPopupObjects.d.ts +29 -0
  95. package/dist/components/filter/FilterPopupObjects.js +30 -0
  96. package/dist/components/filter/FilterPopupObjects.js.map +1 -0
  97. package/dist/components/filter/ManagePrefilterPopup.d.ts +14 -0
  98. package/dist/components/filter/ManagePrefilterPopup.js +33 -0
  99. package/dist/components/filter/ManagePrefilterPopup.js.map +1 -0
  100. package/dist/components/filter/ManagePrefilterPopupObjects.d.ts +11 -0
  101. package/dist/components/filter/ManagePrefilterPopupObjects.js +19 -0
  102. package/dist/components/filter/ManagePrefilterPopupObjects.js.map +1 -0
  103. package/dist/components/form/Form.d.ts +2 -2
  104. package/dist/components/form/Form.js +2 -2
  105. package/dist/components/form/Form.js.map +1 -1
  106. package/dist/components/grid/Grid.d.ts +7 -37
  107. package/dist/components/grid/Grid.js +32 -127
  108. package/dist/components/grid/Grid.js.map +1 -1
  109. package/dist/components/grid/GridObjects.d.ts +0 -6
  110. package/dist/components/grid/GridObjects.js +0 -8
  111. package/dist/components/grid/GridObjects.js.map +1 -1
  112. package/dist/components/index.d.ts +4 -0
  113. package/dist/components/index.js +4 -0
  114. package/dist/components/index.js.map +1 -1
  115. package/dist/components/maps/Maps.d.ts +2 -2
  116. package/dist/components/maps/Maps.js +2 -2
  117. package/dist/components/maps/Maps.js.map +1 -1
  118. package/dist/components/menu/ListBarMenuComponent.d.ts +6 -0
  119. package/dist/components/menu/ListBarMenuComponent.js +10 -0
  120. package/dist/components/menu/ListBarMenuComponent.js.map +1 -1
  121. package/dist/components/menu/ListBarMenuComponentObjects.d.ts +2 -0
  122. package/dist/components/menu/ListBarMenuComponentObjects.js +2 -0
  123. package/dist/components/menu/ListBarMenuComponentObjects.js.map +1 -1
  124. package/dist/components/pivot-grid/PivotGrid.d.ts +2 -2
  125. package/dist/components/pivot-grid/PivotGrid.js +2 -2
  126. package/dist/components/pivot-grid/PivotGrid.js.map +1 -1
  127. package/dist/components/pivot-grid/PivotGridFieldList.d.ts +2 -2
  128. package/dist/components/pivot-grid/PivotGridFieldList.js +2 -2
  129. package/dist/components/pivot-grid/PivotGridFieldList.js.map +1 -1
  130. package/dist/components/pop-up/AllRowsPopUp.d.ts +12 -0
  131. package/dist/components/pop-up/AllRowsPopUp.js +19 -0
  132. package/dist/components/pop-up/AllRowsPopUp.js.map +1 -0
  133. package/dist/components/pop-up/AllRowsPopUpObjects.d.ts +11 -0
  134. package/dist/components/pop-up/AllRowsPopUpObjects.js +13 -0
  135. package/dist/components/pop-up/AllRowsPopUpObjects.js.map +1 -0
  136. package/dist/components/prefilter-list/PrefilterList.d.ts +2 -2
  137. package/dist/components/prefilter-list/PrefilterList.js +2 -2
  138. package/dist/components/prefilter-list/PrefilterList.js.map +1 -1
  139. package/dist/components/preview/Preview.d.ts +2 -2
  140. package/dist/components/preview/Preview.js +2 -2
  141. package/dist/components/preview/Preview.js.map +1 -1
  142. package/dist/components/report-bar/ReportBar.d.ts +2 -2
  143. package/dist/components/report-bar/ReportBar.js +2 -2
  144. package/dist/components/report-bar/ReportBar.js.map +1 -1
  145. package/dist/components/report-tiles/ReportTiles.d.ts +2 -2
  146. package/dist/components/report-tiles/ReportTiles.js +2 -2
  147. package/dist/components/report-tiles/ReportTiles.js.map +1 -1
  148. package/dist/components/scheduler/Scheduler.d.ts +2 -2
  149. package/dist/components/scheduler/Scheduler.js +2 -2
  150. package/dist/components/scheduler/Scheduler.js.map +1 -1
  151. package/dist/components/splitter/Splitter.d.ts +2 -2
  152. package/dist/components/splitter/Splitter.js +2 -2
  153. package/dist/components/splitter/Splitter.js.map +1 -1
  154. package/dist/components/tab/BaseTab.d.ts +2 -2
  155. package/dist/components/tab/BaseTab.js +2 -2
  156. package/dist/components/tab/BaseTab.js.map +1 -1
  157. package/dist/components/tab/DetailTabPage.d.ts +2 -2
  158. package/dist/components/tab/DetailTabPage.js +3 -3
  159. package/dist/components/tab/DetailTabPage.js.map +1 -1
  160. package/dist/components/tab/Tab.d.ts +2 -2
  161. package/dist/components/tab/Tab.js +3 -3
  162. package/dist/components/tab/Tab.js.map +1 -1
  163. package/dist/components/task/TaskBar.d.ts +2 -2
  164. package/dist/components/task/TaskBar.js +2 -2
  165. package/dist/components/task/TaskBar.js.map +1 -1
  166. package/dist/components/task/TaskTiles.d.ts +2 -2
  167. package/dist/components/task/TaskTiles.js +2 -2
  168. package/dist/components/task/TaskTiles.js.map +1 -1
  169. package/dist/components/topbar/TopBar.d.ts +1 -0
  170. package/dist/components/topbar/TopBar.js +1 -0
  171. package/dist/components/topbar/TopBar.js.map +1 -1
  172. package/dist/components/tree-view/TreeView.d.ts +2 -2
  173. package/dist/components/tree-view/TreeView.js +2 -2
  174. package/dist/components/tree-view/TreeView.js.map +1 -1
  175. package/dist/controls/DateControl.d.ts +4 -5
  176. package/dist/controls/DateControl.js +11 -11
  177. package/dist/controls/DateControl.js.map +1 -1
  178. package/dist/controls/DateControlObjects.d.ts +8 -0
  179. package/dist/controls/DateControlObjects.js +9 -0
  180. package/dist/controls/DateControlObjects.js.map +1 -0
  181. package/dist/controls/FormComboBox.d.ts +2 -2
  182. package/dist/controls/FormComboBox.js +15 -20
  183. package/dist/controls/FormComboBox.js.map +1 -1
  184. package/dist/controls/FormComboBoxObjects.d.ts +12 -0
  185. package/dist/controls/FormComboBoxObjects.js +16 -0
  186. package/dist/controls/FormComboBoxObjects.js.map +1 -0
  187. package/dist/controls/GridColumnControl.d.ts +10 -0
  188. package/dist/controls/GridColumnControl.js +43 -0
  189. package/dist/controls/GridColumnControl.js.map +1 -0
  190. package/dist/controls/GridColumnControlObjects.d.ts +9 -0
  191. package/dist/controls/GridColumnControlObjects.js +13 -0
  192. package/dist/controls/GridColumnControlObjects.js.map +1 -0
  193. package/dist/controls/InputFieldControl.d.ts +4 -6
  194. package/dist/controls/InputFieldControl.js +14 -15
  195. package/dist/controls/InputFieldControl.js.map +1 -1
  196. package/dist/controls/InputFieldControlObjects.d.ts +10 -0
  197. package/dist/controls/InputFieldControlObjects.js +11 -0
  198. package/dist/controls/InputFieldControlObjects.js.map +1 -0
  199. package/dist/controls/LookupDropdown.d.ts +6 -1
  200. package/dist/controls/LookupDropdown.js +51 -19
  201. package/dist/controls/LookupDropdown.js.map +1 -1
  202. package/dist/controls/LookupDropdownObjects.d.ts +10 -0
  203. package/dist/controls/LookupDropdownObjects.js +11 -0
  204. package/dist/controls/LookupDropdownObjects.js.map +1 -0
  205. package/dist/controls/index.d.ts +1 -0
  206. package/dist/controls/index.js +1 -0
  207. package/dist/controls/index.js.map +1 -1
  208. package/dist/enums/ElementTypes.d.ts +1 -1
  209. package/dist/enums/ElementTypes.js +1 -1
  210. package/dist/enums/ElementTypes.js.map +1 -1
  211. package/dist/helpers/FlightTracker.d.ts +7 -0
  212. package/dist/helpers/FlightTracker.js +63 -11
  213. package/dist/helpers/FlightTracker.js.map +1 -1
  214. package/dist/helpers/LoginHelper.d.ts +11 -3
  215. package/dist/helpers/LoginHelper.js +59 -13
  216. package/dist/helpers/LoginHelper.js.map +1 -1
  217. package/dist/index.d.ts +1 -1
  218. package/dist/index.js +1 -1
  219. package/dist/index.js.map +1 -1
  220. package/dist/page-extensions/GlobalComponents.d.ts +2 -1
  221. package/dist/page-extensions/GlobalComponents.js +2 -1
  222. package/dist/page-extensions/GlobalComponents.js.map +1 -1
  223. package/dist/page-overrides/ClickOverride.d.ts +1 -0
  224. package/dist/page-overrides/ClickOverride.js +57 -46
  225. package/dist/page-overrides/ClickOverride.js.map +1 -1
  226. package/dist/types/Universal.d.ts +1 -0
  227. package/enums/ElementTypes.ts +1 -1
  228. package/helpers/FlightTracker.ts +71 -11
  229. package/helpers/LoginHelper.ts +79 -21
  230. package/index.ts +1 -1
  231. package/package.json +6 -5
  232. package/page-extensions/GlobalComponents.ts +3 -0
  233. package/page-overrides/ClickOverride.ts +69 -64
  234. package/types/Universal.ts +1 -0
@@ -0,0 +1,63 @@
1
+ import type { Locator, Page } from '@playwright/test';
2
+ import { BaseComponentObjects } from '../BaseComponentObjects.js';
3
+ import type { AutocompleteKey } from './FilterPopup.js';
4
+
5
+ export class FilterPopupObjects extends BaseComponentObjects {
6
+ private _page: Page;
7
+
8
+ constructor(page: Page, body: Locator) {
9
+ super(page, body);
10
+ this._page = page;
11
+ }
12
+
13
+ public applyFilterButton = () => this.context.getByTestId('split-button-main');
14
+
15
+ public applySaveButton = () => this.context.getByTestId('split-button-arrow');
16
+
17
+ public advancedToggleCheckbox = () => this._page.getByRole('checkbox', { name: 'Advanced filter' });
18
+
19
+ public advancedGroupSelect = () => this.context.getByTestId('advanced-filter-group-select');
20
+
21
+ public groupConditionOption = (key: 'all-of-the-following' | 'any-of-the-following') =>
22
+ this._page.getByTestId(`group-condition-select__${key}`);
23
+
24
+ public fieldInput = (fieldId: string) => this.context.getByTestId(`form-field__${fieldId}__input`);
25
+
26
+ public prefilterNameInput = () => this.context.getByTestId('prefilter__name__input');
27
+
28
+ public saveAsOption = () => this._page.getByRole('menuitem', { name: 'Save' });
29
+
30
+ public saveButton = () => this._page.getByRole('button', { name: 'Save' });
31
+
32
+ public valueInput = (fieldId: string, part: string) =>
33
+ this.context.getByTestId(`form-field__${fieldId}__${part}__input`);
34
+
35
+ public dateInput = (fieldId: string) => this.valueInput(fieldId, 'date');
36
+
37
+ public fieldControl = (fieldId: string, part: string) =>
38
+ this.context.getByTestId(`form-field__${fieldId}__${part}__control`).getByRole('button', { name: 'Open' });
39
+
40
+ public operatorControl = (fieldId: string) =>
41
+ this.context.getByTestId(`form-field__${fieldId}__operator__control`).getByRole('button', { name: 'Open' });
42
+
43
+ public timeOperatorControl = () =>
44
+ this.context.getByTestId('form-field__event-time__operator__control').getByRole('button', { name: 'Open' });
45
+
46
+ public intervalSelector = (rowIndex: number, colId: string) =>
47
+ this.context.getByTestId(`advanced-filter-grid__row${rowIndex}__${colId}__select-interval`);
48
+
49
+ public intervalSelectorInput = (rowIndex: number, colId: string) =>
50
+ this.intervalSelector(rowIndex, colId).getByTestId('select-interval__input');
51
+
52
+ public autocompleteOption = (key: AutocompleteKey) => this._page.getByTestId(`autocomplete-option-${key}`);
53
+
54
+ public emptySelectFieldRow = () => this.context.getByTestId('advanced-filter-grid__row-empty-select-field');
55
+
56
+ public emptySelectFieldRowButton = () => this.emptySelectFieldRow().getByRole('button');
57
+
58
+ public selectFieldButton = () => this._page.getByRole('button', { name: 'Select field' });
59
+
60
+ public addFieldButton = () => this._page.getByRole('button', { name: 'Add field' });
61
+
62
+ public colIdOption = (field: string) => this._page.getByTestId(`col-id-${field}`);
63
+ }
@@ -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
+ }
@@ -1,11 +1,11 @@
1
- import type { Locator, Page } from '@playwright/test';
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(page: Page, formContext: Locator | null = null) {
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 => {
@@ -1,15 +1,18 @@
1
1
  import type { Locator, Page } from '@playwright/test';
2
2
  import { pollUntil } from '../../helpers/Poll.js';
3
3
  import { escapeRegex } from '../../helpers/RegexHelper.js';
4
+ import { ExcelStyleFilterPopup } from '../index.js';
4
5
  import { GridObjects } from './GridObjects.js';
5
6
 
6
7
  export class Grid {
7
8
  private _gridObjects: GridObjects;
8
9
  private _page: Page;
10
+ private _excelStyleFilterPopup: ExcelStyleFilterPopup;
9
11
 
10
- constructor(page: Page, gridContext: Locator | null = null) {
11
- this._gridObjects = new GridObjects(page, gridContext);
12
- this._page = page;
12
+ constructor(gridContext: Locator) {
13
+ this._gridObjects = new GridObjects(gridContext.page(), gridContext);
14
+ this._page = gridContext.page();
15
+ this._excelStyleFilterPopup = new ExcelStyleFilterPopup(this._page);
13
16
  }
14
17
 
15
18
  protected get page() {
@@ -57,8 +60,11 @@ export class Grid {
57
60
  * @param columnName - The name of the column for which to open the filter popup.
58
61
  * @returns A promise that resolves when the filter popup is opened.
59
62
  */
60
- public openExcelStyleFilterPopup = async (columnName: string) => {
61
- const filterIcon = this._gridObjects.menuIconByColumnHeaderName(columnName);
63
+ public openExcelStyleFilterPopup = async (columnNameOrHeader: string | Locator) => {
64
+ const filterIcon =
65
+ typeof columnNameOrHeader === 'string'
66
+ ? this._gridObjects.menuIconByColumnHeaderName(columnNameOrHeader)
67
+ : columnNameOrHeader.getByTestId('grid__custom__filter__icon');
62
68
  await filterIcon.click({ force: true });
63
69
  };
64
70
 
@@ -84,138 +90,34 @@ export class Grid {
84
90
  }
85
91
 
86
92
  /**
87
- * Scrolls through the vertical grid viewport to ensure that all rows are loaded.
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.
93
+ * Gets all unique cell values for a specified column by its column ID.
138
94
  */
139
95
  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
96
  const cellsLocator = this._gridObjects.cellsByColumnId(colId);
144
- // Use a Set to ensure uniqueness of values
97
+ const visibleValues = await cellsLocator.allTextContents();
145
98
  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
-
183
- // Exit loop if no further horizontal scroll is possible
184
- if (scrollLeft === lastScrollLeft) break;
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
99
 
196
- await this._page.waitForTimeout(100); // Allow time for rendering
100
+ for (const value of visibleValues.map((value: string) => value.trim()).filter(Boolean)) {
101
+ collected.add(value);
197
102
  }
103
+
104
+ return Array.from(collected);
198
105
  }
199
106
 
200
107
  /**
201
- * Retrieves all column header values from the grid, including those that require horizontal scrolling to load.
108
+ * Retrieves all column header values from the grid.
202
109
  *
203
- * This method scrolls through the grid horizontally to ensure all columns are rendered,
204
- * collects the text content of each header, and returns a unique list of trimmed, non-empty values.
110
+ * This method collects the text content of each header and returns a unique list of trimmed, non-empty values.
205
111
  *
206
112
  * @returns {Promise<string[]>} A promise that resolves to an array of unique column header values.
207
113
  */
208
114
  public async getColumnHeaderValues(): Promise<string[]> {
209
- const scrollbar = this._gridObjects.horizontalScrollbar();
210
115
  const headersLocator = this._gridObjects.columnHeaders();
211
116
  const collected = new Set<string>();
212
-
213
- await this.scrollGridHorizontallyToLoadAllColumns(scrollbar, async () => {
214
- const visibleHeaders = await headersLocator.allTextContents();
215
- for (const header of visibleHeaders.map((header) => header.trim()).filter(Boolean)) {
216
- collected.add(header);
217
- }
218
- });
117
+ const visibleHeaders = await headersLocator.allTextContents();
118
+ for (const header of visibleHeaders.map((header) => header.trim()).filter(Boolean)) {
119
+ collected.add(header);
120
+ }
219
121
 
220
122
  return Array.from(collected);
221
123
  }
@@ -231,34 +133,47 @@ export class Grid {
231
133
  * await grid.filterByColumnValueExcelStyle('Status', 'Active');
232
134
  * await grid.filterByColumnValueExcelStyle('Status', 'Pending', false);
233
135
  */
136
+
234
137
  public async filterByColumnValueExcelStyle(
235
138
  columnName: string,
236
139
  valueToSelect: string,
140
+ deselectAll?: boolean
141
+ ): Promise<void>;
142
+ public async filterByColumnValueExcelStyle(
143
+ columnHeader: Locator,
144
+ valueToSelect: string,
145
+ deselectAll?: boolean
146
+ ): Promise<void>;
147
+ public async filterByColumnValueExcelStyle(
148
+ columnNameOrHeader: string | Locator,
149
+ valueToSelect: string,
237
150
  deselectAll: boolean = true
238
151
  ): Promise<void> {
239
- await this.openExcelStyleFilterPopup(columnName);
152
+ await this.openExcelStyleFilterPopup(columnNameOrHeader);
240
153
 
241
154
  // Get column ID from header and normalize it (snake_case -> kebab-case)
242
- const header = this._gridObjects.columnHeaderByName(columnName);
155
+ const header =
156
+ typeof columnNameOrHeader === 'string'
157
+ ? this._gridObjects.columnHeaderByName(columnNameOrHeader)
158
+ : columnNameOrHeader;
243
159
  const rawColumnId = await header.getAttribute('col-id');
244
160
  if (!rawColumnId) {
245
- throw new Error(`Could not find col-id for column "${columnName}"`);
161
+ throw new Error(
162
+ `Could not find col-id for column${typeof columnNameOrHeader === 'string' ? ` "${columnNameOrHeader}"` : ''}`
163
+ );
246
164
  }
247
165
  const columnId = rawColumnId.toLowerCase().replace(/_/g, '-');
248
166
 
249
- const popup = this._gridObjects.excelStyleFilterPopup(columnId);
250
- await popup.waitFor({ state: 'visible' });
167
+ //const popup = this._gridObjects.excelStyleFilterPopup(columnId);
168
+ await this._excelStyleFilterPopup.waitForOpen();
251
169
 
252
170
  if (deselectAll) {
253
- await this._gridObjects.excelStyleFilterSelectAllCheckbox(columnId).uncheck();
171
+ await this._excelStyleFilterPopup.clickSelectAll(columnId);
254
172
  }
255
173
 
256
- const valueRegex = new RegExp(`^${escapeRegex(valueToSelect)}$`, 'i');
257
- const optionButton = this._gridObjects.excelStyleFilterPopupOptionByText(columnId, valueRegex);
258
- await optionButton.locator('input[type="checkbox"]').check();
259
-
260
- await this._gridObjects.mainHeader.click(); // Click outside to close the popup
261
- await popup.waitFor({ state: 'detached' });
174
+ await this._excelStyleFilterPopup.clickCheckboxItem(columnId, valueToSelect);
175
+ await this._gridObjects.mainHeader.click();
176
+ await this._excelStyleFilterPopup.waitForClose();
262
177
  }
263
178
 
264
179
  /**
@@ -2,11 +2,8 @@ import type { Locator, Page } from '@playwright/test';
2
2
  import { BaseComponentObjects } from '../BaseComponentObjects.js';
3
3
 
4
4
  export class GridObjects extends BaseComponentObjects {
5
- private _page: Page;
6
-
7
5
  constructor(page: Page, context: Locator | null = null) {
8
6
  super(page, context);
9
- this._page = page;
10
7
  }
11
8
 
12
9
  public columnHeaderByText = (text: string) => this.context.locator('[role="columnheader"]', { hasText: text });
@@ -29,26 +26,10 @@ export class GridObjects extends BaseComponentObjects {
29
26
 
30
27
  public rows = () => this.context.locator('[role="row"]');
31
28
 
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
29
  public cellsByColumnId = (colId: string) => this.context.locator(`[col-id="${colId}"] .value-renderer`);
37
30
 
38
31
  public columnByRowLocator = (rowLocator: Locator) => rowLocator.locator('.ag-cell');
39
32
 
40
- public excelStyleFilterPopup = (columnId: string) => this._page.getByTestId(`lookup-excel-filter__${columnId}__list`);
41
-
42
- public excelStyleFilterSelectAllCheckbox = (columnId: string) =>
43
- this._page.locator(
44
- `[data-testid="lookup-excel-filter__${columnId}__list-item-select-all-checkbox"] input[type="checkbox"]`
45
- );
46
-
47
- public excelStyleFilterPopupOptionByText = (columnId: string, optionText: RegExp) =>
48
- this._page
49
- .locator(`[data-testid^="lookup-excel-filter__${columnId}__list-item-button"]`)
50
- .filter({ hasText: optionText });
51
-
52
33
  public gridCell = () => this.context.locator('[role="gridcell"]');
53
34
 
54
35
  public noRowsOverlay = () => this.context.locator('.ag-overlay-no-rows-center');
@@ -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';
@@ -1,11 +1,11 @@
1
- import type { Locator, Page } from '@playwright/test';
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(page: Page, context: Locator | null = null) {
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, Page } from '@playwright/test';
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(page: Page, context: Locator | null = null) {
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, Page } from '@playwright/test';
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(page: Page, context: Locator | null = null) {
8
- this.pivotGridFieldListObjects = new PivotGridFieldListObjects(page, context);
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, Page } from '@playwright/test';
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(page: Page, context: Locator | null = null) {
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, Page } from '@playwright/test';
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(page: Page, context: Locator | null = null) {
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, Page } from '@playwright/test';
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(page: Page, context: Locator | null = null) {
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, Page } from '@playwright/test';
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(page: Page, context: Locator | null = null) {
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 {