@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.
- package/Testwise.ts +2 -0
- package/artifact-builder/SelectorBuilder.ts +2 -2
- package/artifact-builder/SubjectComponentGenerator.ts +21 -12
- package/artifact-builder/SubjectGenerator.ts +20 -6
- 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 +69 -0
- package/components/filter/ExcelStyleFilterPopupObjects.ts +46 -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 +48 -133
- package/components/grid/GridObjects.ts +0 -19
- 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 +13 -14
- package/controls/DateControlObjects.ts +15 -0
- package/controls/FormComboBox.ts +17 -30
- package/controls/FormComboBoxObjects.ts +27 -0
- package/controls/GridColumnControl.ts +68 -0
- package/controls/GridColumnControlObjects.ts +20 -0
- package/controls/InputFieldControl.ts +17 -20
- package/controls/InputFieldControlObjects.ts +19 -0
- package/controls/LookupDropdown.ts +65 -24
- package/controls/LookupDropdownObjects.ts +19 -0
- 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 +16 -6
- 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 +19 -0
- package/dist/components/filter/ExcelStyleFilterPopup.js +64 -0
- package/dist/components/filter/ExcelStyleFilterPopup.js.map +1 -0
- package/dist/components/filter/ExcelStyleFilterPopupObjects.d.ts +16 -0
- package/dist/components/filter/ExcelStyleFilterPopupObjects.js +26 -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 +7 -37
- package/dist/components/grid/Grid.js +32 -127
- package/dist/components/grid/Grid.js.map +1 -1
- package/dist/components/grid/GridObjects.d.ts +0 -6
- package/dist/components/grid/GridObjects.js +0 -8
- 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 +4 -5
- package/dist/controls/DateControl.js +11 -11
- package/dist/controls/DateControl.js.map +1 -1
- package/dist/controls/DateControlObjects.d.ts +8 -0
- package/dist/controls/DateControlObjects.js +9 -0
- package/dist/controls/DateControlObjects.js.map +1 -0
- package/dist/controls/FormComboBox.d.ts +2 -2
- package/dist/controls/FormComboBox.js +15 -20
- package/dist/controls/FormComboBox.js.map +1 -1
- package/dist/controls/FormComboBoxObjects.d.ts +12 -0
- package/dist/controls/FormComboBoxObjects.js +16 -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 +4 -6
- package/dist/controls/InputFieldControl.js +14 -15
- package/dist/controls/InputFieldControl.js.map +1 -1
- package/dist/controls/InputFieldControlObjects.d.ts +10 -0
- package/dist/controls/InputFieldControlObjects.js +11 -0
- package/dist/controls/InputFieldControlObjects.js.map +1 -0
- package/dist/controls/LookupDropdown.d.ts +6 -1
- package/dist/controls/LookupDropdown.js +51 -19
- package/dist/controls/LookupDropdown.js.map +1 -1
- package/dist/controls/LookupDropdownObjects.d.ts +10 -0
- package/dist/controls/LookupDropdownObjects.js +11 -0
- package/dist/controls/LookupDropdownObjects.js.map +1 -0
- 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
|
@@ -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 {
|
package/controls/DateControl.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
2
|
/* biome-ignore-all lint/suspicious/noExplicitAny: reason42 */
|
|
3
|
-
import type { Locator
|
|
3
|
+
import type { Locator } from '@playwright/test';
|
|
4
|
+
import { DateControlObjects } from './DateControlObjects.js';
|
|
4
5
|
|
|
5
6
|
export type IDateControl = Locator & IDateControlCore;
|
|
6
7
|
|
|
@@ -12,12 +13,10 @@ export type IDateControlCore = {
|
|
|
12
13
|
};
|
|
13
14
|
|
|
14
15
|
export class DateControl implements IDateControlCore {
|
|
15
|
-
private
|
|
16
|
-
private _inputLocator: Locator;
|
|
16
|
+
private _objects: DateControlObjects;
|
|
17
17
|
|
|
18
|
-
constructor(
|
|
19
|
-
this.
|
|
20
|
-
this._inputLocator = this._dateFieldLocator.locator('input');
|
|
18
|
+
constructor(context: Locator, id: string) {
|
|
19
|
+
this._objects = new DateControlObjects(context, id);
|
|
21
20
|
}
|
|
22
21
|
|
|
23
22
|
/**
|
|
@@ -30,26 +29,26 @@ export class DateControl implements IDateControlCore {
|
|
|
30
29
|
public async fill(value: string): Promise<void> {
|
|
31
30
|
const numbersOnlyValue = value.replace(/\D/g, '');
|
|
32
31
|
|
|
33
|
-
await this.
|
|
34
|
-
await this.
|
|
32
|
+
await this._objects.fieldInput().focus();
|
|
33
|
+
await this._objects.fieldInput().pressSequentially(numbersOnlyValue);
|
|
35
34
|
}
|
|
36
35
|
|
|
37
36
|
public async clear(): Promise<void> {
|
|
38
|
-
await this.
|
|
37
|
+
await this._objects.fieldInput().fill('');
|
|
39
38
|
}
|
|
40
39
|
|
|
41
40
|
public async inputValue(): Promise<string> {
|
|
42
|
-
return await this.
|
|
41
|
+
return await this._objects.fieldInput().inputValue();
|
|
43
42
|
}
|
|
44
43
|
|
|
45
44
|
public inputElement(): Locator {
|
|
46
|
-
return this.
|
|
45
|
+
return this._objects.fieldInput();
|
|
47
46
|
}
|
|
48
47
|
}
|
|
49
48
|
|
|
50
|
-
export function createDateControl(
|
|
51
|
-
const inputFieldControl = new DateControl(
|
|
52
|
-
const locator =
|
|
49
|
+
export function createDateControl(context: Locator, id: string): IDateControl {
|
|
50
|
+
const inputFieldControl = new DateControl(context, id);
|
|
51
|
+
const locator = context.getByTestId(`form-field__${id}`);
|
|
53
52
|
|
|
54
53
|
return new Proxy(inputFieldControl, {
|
|
55
54
|
get(target, prop, receiver) {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Locator } from '@playwright/test';
|
|
2
|
+
|
|
3
|
+
export class DateControlObjects {
|
|
4
|
+
private _context: Locator;
|
|
5
|
+
private _id: string;
|
|
6
|
+
|
|
7
|
+
constructor(context: Locator, id: string) {
|
|
8
|
+
this._context = context;
|
|
9
|
+
this._id = id;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
public fieldInput = (): Locator => this._context;
|
|
13
|
+
|
|
14
|
+
public dateField = (): Locator => this._context.getByTestId(`form-field__${this._id}`);
|
|
15
|
+
}
|
package/controls/FormComboBox.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
2
|
/* biome-ignore-all lint/suspicious/noExplicitAny: Reason42 */
|
|
3
|
-
import type { Locator
|
|
3
|
+
import type { Locator } from '@playwright/test';
|
|
4
|
+
import { FormComboBoxObjects } from './FormComboBoxObjects.js';
|
|
4
5
|
|
|
5
6
|
export type IFormComboBox = Locator & IFormComboBoxCore;
|
|
6
7
|
|
|
@@ -12,50 +13,36 @@ export type IFormComboBoxCore = {
|
|
|
12
13
|
};
|
|
13
14
|
|
|
14
15
|
class FormComboBox implements IFormComboBoxCore {
|
|
15
|
-
private
|
|
16
|
-
private _autoCompleteMenu: Locator;
|
|
17
|
-
private _id: string;
|
|
16
|
+
private _objects: FormComboBoxObjects;
|
|
18
17
|
|
|
19
|
-
constructor(
|
|
20
|
-
this.
|
|
21
|
-
this._formFieldLocator = page.getByTestId(`form-field__${id}`);
|
|
22
|
-
this._autoCompleteMenu = page.getByTestId(`form-field__${id}__select__options-list`);
|
|
18
|
+
constructor(context: Locator, id: string) {
|
|
19
|
+
this._objects = new FormComboBoxObjects(context, id);
|
|
23
20
|
}
|
|
24
21
|
|
|
25
22
|
async selectOption(optionText: string): Promise<void> {
|
|
26
|
-
await this.
|
|
27
|
-
|
|
28
|
-
await this.
|
|
29
|
-
|
|
30
|
-
const optionTextLowercase = optionText.toLowerCase();
|
|
31
|
-
|
|
32
|
-
await this._autoCompleteMenu.getByTestId(`form-field__${this._id}__select__${optionTextLowercase}__text`).click();
|
|
23
|
+
await this._objects.fieldInput().click();
|
|
24
|
+
await this._objects.autoCompleteMenu().waitFor({ state: 'visible' });
|
|
25
|
+
await this._objects.option(optionText).click();
|
|
33
26
|
}
|
|
34
27
|
|
|
35
28
|
async getValidationMessage(): Promise<string> {
|
|
36
|
-
await this.
|
|
37
|
-
return await this.
|
|
29
|
+
await this._objects.validationMessage().waitFor({ state: 'visible' });
|
|
30
|
+
return await this._objects.validationMessage().innerText();
|
|
38
31
|
}
|
|
39
32
|
async clearByClick(): Promise<void> {
|
|
40
|
-
await this.
|
|
33
|
+
await this._objects.clearButton().click();
|
|
41
34
|
}
|
|
42
35
|
|
|
43
36
|
async lookupSelect(optionToSelect: string): Promise<void> {
|
|
44
|
-
await this.
|
|
45
|
-
|
|
46
|
-
await this.
|
|
47
|
-
|
|
48
|
-
const optionToSelectLowercase = optionToSelect.toLowerCase();
|
|
49
|
-
|
|
50
|
-
await this._autoCompleteMenu
|
|
51
|
-
.getByTestId(`form-field__${this._id}__select__${optionToSelectLowercase}__text`)
|
|
52
|
-
.click();
|
|
37
|
+
await this._objects.fieldInput().fill(optionToSelect);
|
|
38
|
+
await this._objects.autoCompleteMenu().waitFor({ state: 'visible' });
|
|
39
|
+
await this._objects.option(optionToSelect).click();
|
|
53
40
|
}
|
|
54
41
|
}
|
|
55
42
|
|
|
56
|
-
export function createFormComboBox(
|
|
57
|
-
const comboBox = new FormComboBox(
|
|
58
|
-
const locator =
|
|
43
|
+
export function createFormComboBox(context: Locator, id: string): IFormComboBox {
|
|
44
|
+
const comboBox = new FormComboBox(context, id);
|
|
45
|
+
const locator = context.getByTestId(`form-field__${id}`);
|
|
59
46
|
|
|
60
47
|
return new Proxy(comboBox, {
|
|
61
48
|
get(target, prop, receiver) {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Locator } from '@playwright/test';
|
|
2
|
+
|
|
3
|
+
export class FormComboBoxObjects {
|
|
4
|
+
private _context: Locator;
|
|
5
|
+
private _id: string;
|
|
6
|
+
|
|
7
|
+
constructor(context: Locator, id: string) {
|
|
8
|
+
this._context = context;
|
|
9
|
+
this._id = id;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
public field = (): Locator => this._context.getByTestId(`form-field__${this._id}`);
|
|
13
|
+
|
|
14
|
+
public autoCompleteMenu = (): Locator =>
|
|
15
|
+
this._context.page().getByTestId(`form-field__${this._id}__select__options-list`);
|
|
16
|
+
|
|
17
|
+
public option = (optionText: string): Locator => {
|
|
18
|
+
const optionTextLowercase = optionText.toLowerCase();
|
|
19
|
+
return this.autoCompleteMenu().getByTestId(`form-field__${this._id}__select__${optionTextLowercase}__text`);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
public clearButton = (): Locator => this.field().locator('Button[aria-label="Clear"]');
|
|
23
|
+
|
|
24
|
+
public validationMessage = (): Locator => this.field().locator('.TooltipContainer p');
|
|
25
|
+
|
|
26
|
+
public fieldInput = (): Locator => this.field().locator('input');
|
|
27
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
/* biome-ignore-all lint/suspicious/noExplicitAny: Reason42 */
|
|
3
|
+
import type { Locator } from '@playwright/test';
|
|
4
|
+
import { Grid } from '../components/grid/Grid.js';
|
|
5
|
+
import { escapeRegex } from '../index.js';
|
|
6
|
+
import { GridColumnControlObjects } from './GridColumnControlObjects.js';
|
|
7
|
+
|
|
8
|
+
export type IGridColumnControl = Locator & IGridColumnControlCore;
|
|
9
|
+
|
|
10
|
+
export type IGridColumnControlCore = {
|
|
11
|
+
getColumnHeader(): Promise<Locator>;
|
|
12
|
+
getCellByExactValue(value: string): Locator;
|
|
13
|
+
getCellValues(): Promise<string[]>;
|
|
14
|
+
filterByColumnValueExcelStyle(value: string, deselectAll?: boolean): Promise<void>;
|
|
15
|
+
openExcelStyleFilterPopup(): Promise<void>;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
class GridColumnControl implements IGridColumnControlCore {
|
|
19
|
+
private _grid: Grid;
|
|
20
|
+
private _id: string;
|
|
21
|
+
private _objects: GridColumnControlObjects;
|
|
22
|
+
|
|
23
|
+
constructor(gridContext: Locator, id: string) {
|
|
24
|
+
this._id = id.replace(/-/g, '_');
|
|
25
|
+
this._objects = new GridColumnControlObjects(gridContext, this._id);
|
|
26
|
+
this._grid = new Grid(gridContext);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
public async openExcelStyleFilterPopup(): Promise<void> {
|
|
30
|
+
await this._grid.openExcelStyleFilterPopup(this._id);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public async getColumnHeader(): Promise<Locator> {
|
|
34
|
+
return await this._objects.columnHeader();
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public getCellByExactValue(value: string): Locator {
|
|
38
|
+
const valueToFindRegex = new RegExp(`^${escapeRegex(value)}$`);
|
|
39
|
+
return this._objects.cellByValue(valueToFindRegex);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
public async getCellValues(): Promise<string[]> {
|
|
43
|
+
return await this._grid.getCellValuesByColId(this._id);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
public async filterByColumnValueExcelStyle(value: string, deselectAll?: boolean): Promise<void> {
|
|
47
|
+
await this._grid.filterByColumnValueExcelStyle(this._objects.columnHeader(), value, deselectAll);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function createGridColumnControl(gridContext: Locator, id: string): IGridColumnControl {
|
|
52
|
+
const columnControl = new GridColumnControl(gridContext, id);
|
|
53
|
+
const locator = gridContext.locator(`[col-id="${id}"]`);
|
|
54
|
+
|
|
55
|
+
return new Proxy(columnControl, {
|
|
56
|
+
get(target, prop, receiver) {
|
|
57
|
+
if (prop in target) {
|
|
58
|
+
return Reflect.get(target, prop, receiver);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const value = (locator as any)[prop];
|
|
62
|
+
if (typeof value === 'function') {
|
|
63
|
+
return value.bind(locator);
|
|
64
|
+
}
|
|
65
|
+
return value;
|
|
66
|
+
}
|
|
67
|
+
}) as unknown as IGridColumnControl;
|
|
68
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Locator } from '@playwright/test';
|
|
2
|
+
import { BaseComponentObjects } from '../components/BaseComponentObjects.js';
|
|
3
|
+
|
|
4
|
+
export class GridColumnControlObjects extends BaseComponentObjects {
|
|
5
|
+
private _id: string;
|
|
6
|
+
|
|
7
|
+
constructor(gridContext: Locator, columnId: string) {
|
|
8
|
+
super(gridContext.page(), gridContext);
|
|
9
|
+
this._id = columnId;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
public column = () => this.context.locator(`[col-id="${this._id}"]`);
|
|
13
|
+
|
|
14
|
+
public columnHeader = () => this.context.locator(`[col-id="${this._id}"][role="columnheader"]`);
|
|
15
|
+
|
|
16
|
+
public cellByValue = (value: RegExp) =>
|
|
17
|
+
this.column().locator('[role="button"]', {
|
|
18
|
+
hasText: value
|
|
19
|
+
});
|
|
20
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
2
|
/** biome-ignore-all lint/suspicious/noExplicitAny: reason42 */
|
|
3
|
-
import type { Locator
|
|
3
|
+
import type { Locator } from '@playwright/test';
|
|
4
|
+
import { InputFieldControlObjects } from './InputFieldControlObjects.js';
|
|
4
5
|
|
|
5
6
|
export type IInputFieldControl = Locator & ICoreInputFieldControl;
|
|
6
7
|
|
|
@@ -15,43 +16,39 @@ export type ICoreInputFieldControl = {
|
|
|
15
16
|
};
|
|
16
17
|
|
|
17
18
|
export class InputFieldControl implements ICoreInputFieldControl {
|
|
18
|
-
private
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
constructor(page: Page, id: string) {
|
|
23
|
-
this._id = id;
|
|
24
|
-
this._formFieldLocator = page.getByTestId(`form-field__${id}`);
|
|
25
|
-
this._inputLocator = this._formFieldLocator.locator('input');
|
|
19
|
+
private _objects: InputFieldControlObjects;
|
|
20
|
+
|
|
21
|
+
constructor(context: Locator, id: string) {
|
|
22
|
+
this._objects = new InputFieldControlObjects(context, id);
|
|
26
23
|
}
|
|
27
24
|
|
|
28
25
|
public async getValidationMessage(): Promise<string> {
|
|
29
|
-
await this.
|
|
30
|
-
return await this.
|
|
26
|
+
await this._objects.validationMessage().waitFor({ state: 'visible' });
|
|
27
|
+
return await this._objects.validationMessage().innerText();
|
|
31
28
|
}
|
|
32
29
|
|
|
33
30
|
public async fill(value: string): Promise<void> {
|
|
34
|
-
await this.
|
|
31
|
+
await this._objects.fieldInput().fill(value);
|
|
35
32
|
}
|
|
36
33
|
|
|
37
34
|
public async click(): Promise<void> {
|
|
38
|
-
await this.
|
|
35
|
+
await this._objects.fieldInput().click();
|
|
39
36
|
}
|
|
40
37
|
|
|
41
38
|
public async clear(): Promise<void> {
|
|
42
|
-
await this.
|
|
39
|
+
await this._objects.fieldInput().fill('');
|
|
43
40
|
}
|
|
44
41
|
|
|
45
42
|
public async inputValue(): Promise<string> {
|
|
46
|
-
return await this.
|
|
43
|
+
return await this._objects.fieldInput().inputValue();
|
|
47
44
|
}
|
|
48
45
|
|
|
49
46
|
public inputElement(): Locator {
|
|
50
|
-
return this.
|
|
47
|
+
return this._objects.fieldInput();
|
|
51
48
|
}
|
|
52
49
|
|
|
53
50
|
public async getLabelText(): Promise<string> {
|
|
54
|
-
let returnText = (await this.
|
|
51
|
+
let returnText = (await this._objects.fieldLabel().textContent()) || '';
|
|
55
52
|
|
|
56
53
|
returnText = returnText.replace(/\s+/g, ' ').trim();
|
|
57
54
|
|
|
@@ -59,9 +56,9 @@ export class InputFieldControl implements ICoreInputFieldControl {
|
|
|
59
56
|
}
|
|
60
57
|
}
|
|
61
58
|
|
|
62
|
-
export function createInputFieldControl(
|
|
63
|
-
const inputFieldControl = new InputFieldControl(
|
|
64
|
-
const locator =
|
|
59
|
+
export function createInputFieldControl(context: Locator, id: string): IInputFieldControl {
|
|
60
|
+
const inputFieldControl = new InputFieldControl(context, id);
|
|
61
|
+
const locator = context.getByTestId(`form-field__${id}`);
|
|
65
62
|
|
|
66
63
|
return new Proxy(inputFieldControl, {
|
|
67
64
|
get(target, prop, receiver) {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Locator } from '@playwright/test';
|
|
2
|
+
|
|
3
|
+
export class InputFieldControlObjects {
|
|
4
|
+
private _context: Locator;
|
|
5
|
+
private _id: string;
|
|
6
|
+
|
|
7
|
+
constructor(context: Locator, id: string) {
|
|
8
|
+
this._context = context;
|
|
9
|
+
this._id = id;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
public formField = (): Locator => this._context.getByTestId(`form-field__${this._id}`);
|
|
13
|
+
|
|
14
|
+
public fieldInput = (): Locator => this.formField().locator('input');
|
|
15
|
+
|
|
16
|
+
public fieldLabel = (): Locator => this.formField().getByTestId(`form-field__${this._id}__label`);
|
|
17
|
+
|
|
18
|
+
public validationMessage = (): Locator => this.formField().locator('.TooltipContainer p');
|
|
19
|
+
}
|
|
@@ -2,60 +2,101 @@
|
|
|
2
2
|
/** biome-ignore-all lint/suspicious/noExplicitAny: needed flexibility */
|
|
3
3
|
import type { Locator } from '@playwright/test';
|
|
4
4
|
import { escapeRegex } from '../helpers/RegexHelper.js';
|
|
5
|
+
import { LookupDropdownObjects } from './LookupDropdownObjects.js';
|
|
5
6
|
|
|
6
7
|
export type ILookupDropdown = Locator & ILookupDropdownCore;
|
|
7
8
|
|
|
8
9
|
export type ILookupDropdownCore = {
|
|
9
10
|
lookupSelect(optionToSelect: string): Promise<void>;
|
|
10
11
|
selectOption(optionText: string): Promise<void>;
|
|
12
|
+
fill(value: string): Promise<void>;
|
|
13
|
+
getValidationMessage(): Promise<string>;
|
|
14
|
+
getLabelText(): Promise<string>;
|
|
15
|
+
inputValue(): Promise<string>;
|
|
16
|
+
clear(): Promise<void>;
|
|
11
17
|
};
|
|
12
18
|
|
|
13
19
|
class LookupDropdown implements ILookupDropdownCore {
|
|
14
|
-
private
|
|
20
|
+
private _objects: LookupDropdownObjects;
|
|
15
21
|
|
|
16
|
-
constructor(
|
|
17
|
-
this.
|
|
22
|
+
constructor(context: Locator, id: string) {
|
|
23
|
+
this._objects = new LookupDropdownObjects(context, id);
|
|
18
24
|
}
|
|
19
25
|
|
|
20
|
-
async
|
|
21
|
-
await
|
|
26
|
+
public async getLabelText(): Promise<string> {
|
|
27
|
+
let returnText = (await this._objects.label().textContent()) || '';
|
|
22
28
|
|
|
23
|
-
|
|
24
|
-
await this._locator.page().waitEventHandler.setCanContinue(true);
|
|
29
|
+
returnText = returnText.replace(/\s+/g, ' ').trim();
|
|
25
30
|
|
|
31
|
+
return returnText;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
public async lookupSelect(optionToSelect: string): Promise<void> {
|
|
35
|
+
await this._objects.input().fill(optionToSelect);
|
|
26
36
|
await this.select(optionToSelect);
|
|
27
37
|
}
|
|
28
38
|
|
|
29
|
-
async
|
|
30
|
-
await this.
|
|
39
|
+
public async inputValue(): Promise<string> {
|
|
40
|
+
return await this._objects.input().inputValue();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
public async clear(): Promise<void> {
|
|
44
|
+
await this._objects.input().fill('');
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
public async selectOption(optionText: string): Promise<void> {
|
|
48
|
+
await this._objects.input().click();
|
|
31
49
|
await this.select(optionText);
|
|
32
50
|
}
|
|
33
51
|
|
|
52
|
+
public async getValidationMessage(): Promise<string> {
|
|
53
|
+
await this._objects.validationMessage().waitFor({ state: 'visible' });
|
|
54
|
+
return await this._objects.validationMessage().innerText();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
public async fill(value: string): Promise<void> {
|
|
58
|
+
await Promise.all([
|
|
59
|
+
this._objects
|
|
60
|
+
.input()
|
|
61
|
+
.page()
|
|
62
|
+
.waitForResponse((response) => response.url().includes('/list_') && response.request().method() === 'GET'),
|
|
63
|
+
this._objects.input().click()
|
|
64
|
+
]);
|
|
65
|
+
|
|
66
|
+
await Promise.all([
|
|
67
|
+
this._objects
|
|
68
|
+
.input()
|
|
69
|
+
.page()
|
|
70
|
+
.waitForResponse((response) => response.url().includes('/list_') && response.request().method() === 'GET'),
|
|
71
|
+
this._objects.input().fill(value)
|
|
72
|
+
]);
|
|
73
|
+
}
|
|
74
|
+
|
|
34
75
|
private async select(optionToSelect: string) {
|
|
35
76
|
const optionsToSelectRegex = new RegExp(`^${escapeRegex(optionToSelect)}$`, 'i');
|
|
36
77
|
|
|
37
|
-
await this.
|
|
38
|
-
await this.
|
|
78
|
+
await this._objects.input().page().getByTestId('autocomplete__menu').getByText(optionsToSelectRegex).click();
|
|
79
|
+
await this._objects
|
|
80
|
+
.input()
|
|
39
81
|
.page()
|
|
40
|
-
.waitForFunction((el) => document.activeElement === el, await this.
|
|
82
|
+
.waitForFunction((el) => document.activeElement === el, await this._objects.input().elementHandle());
|
|
41
83
|
}
|
|
42
84
|
}
|
|
43
85
|
|
|
44
|
-
export function createLookupDropdown(
|
|
45
|
-
const dropdown = new LookupDropdown(
|
|
86
|
+
export function createLookupDropdown(context: Locator, id: string): ILookupDropdown {
|
|
87
|
+
const dropdown = new LookupDropdown(context, id);
|
|
88
|
+
const customProps = new Set(Object.getOwnPropertyNames(LookupDropdown.prototype).filter((p) => p !== 'constructor'));
|
|
46
89
|
|
|
47
|
-
return new Proxy(
|
|
90
|
+
return new Proxy(context, {
|
|
48
91
|
get(target, prop, receiver) {
|
|
49
|
-
if (prop
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
if (typeof value === 'function') {
|
|
56
|
-
return value.bind(locator);
|
|
92
|
+
if (customProps.has(prop as string)) {
|
|
93
|
+
const value = (dropdown as any)[prop];
|
|
94
|
+
if (typeof value === 'function') {
|
|
95
|
+
return value.bind(dropdown);
|
|
96
|
+
}
|
|
97
|
+
return value;
|
|
57
98
|
}
|
|
58
|
-
return
|
|
99
|
+
return Reflect.get(target, prop, receiver);
|
|
59
100
|
}
|
|
60
101
|
}) as unknown as ILookupDropdown;
|
|
61
102
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Locator } from '@playwright/test';
|
|
2
|
+
|
|
3
|
+
export class LookupDropdownObjects {
|
|
4
|
+
private _id: string;
|
|
5
|
+
private _context: Locator;
|
|
6
|
+
|
|
7
|
+
constructor(context: Locator, id: string) {
|
|
8
|
+
this._context = context;
|
|
9
|
+
this._id = id;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
public formField = (): Locator => this._context.getByTestId(`form-field__${this._id}`);
|
|
13
|
+
|
|
14
|
+
public label = (): Locator => this.formField().getByTestId(`form-field__${this._id}__label`);
|
|
15
|
+
|
|
16
|
+
public input = (): Locator => this.formField().locator('input');
|
|
17
|
+
|
|
18
|
+
public validationMessage = (): Locator => this.formField().locator('.TooltipContainer p');
|
|
19
|
+
}
|