@axinom/mosaic-e2e-page-model 0.3.0-rc.5 → 0.3.0-rc.6
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/dist/managed-services/video-service.d.ts.map +1 -1
- package/dist/managed-services/video-service.js +2 -2
- package/dist/managed-services/video-service.js.map +1 -1
- package/dist/ui-selectors/navigation-panel.d.ts +91 -0
- package/dist/ui-selectors/navigation-panel.d.ts.map +1 -0
- package/dist/ui-selectors/navigation-panel.js +137 -0
- package/dist/ui-selectors/navigation-panel.js.map +1 -0
- package/dist/ui-selectors/ui-shell-model.d.ts +49 -0
- package/dist/ui-selectors/ui-shell-model.d.ts.map +1 -1
- package/dist/ui-selectors/ui-shell-model.js +92 -9
- package/dist/ui-selectors/ui-shell-model.js.map +1 -1
- package/package.json +3 -3
- package/src/managed-services/video-service.ts +8 -2
- package/src/ui-selectors/navigation-panel.ts +179 -0
- package/src/ui-selectors/ui-shell-model.ts +118 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video-service.d.ts","sourceRoot":"","sources":["../../src/managed-services/video-service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,6CAA6C;AAC7C,qBAAa,YAAa,SAAQ,mBAAmB;IACnD;;;;;;;;;;OAUG;IACG,sBAAsB,CAAC,IAAI,EAAE;QACjC,4BAA4B;QAC5B,KAAK,EAAE,MAAM,CAAC;KACf,GAAG,OAAO,CAAC,IAAI,CAAC;IA0BjB;;;;;;;;;;;OAWG;IACG,YAAY,CAAC,IAAI,EAAE;QACvB,4BAA4B;QAC5B,KAAK,EAAE,MAAM,CAAC;KACf,GAAG,OAAO,CAAC,IAAI,CAAC;IAmBjB;;;;;;;;;;;OAWG;IACG,YAAY,CAAC,IAAI,EAAE;QACvB,4BAA4B;QAC5B,KAAK,EAAE,MAAM,CAAC;KACf,GAAG,OAAO,CAAC,IAAI,CAAC;I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CAAC,IAAI,EAAE;QACvC,+CAA+C;QAC/C,KAAK,EAAE,MAAM,CAAC;KACf,GAAG,OAAO,CAAC,IAAI,CAAC;CAiClB"}
|
|
@@ -106,7 +106,7 @@ class VideoService extends managed_service_model_1.ManagedServiceModel {
|
|
|
106
106
|
*/
|
|
107
107
|
async createVideoProcessingProfile(properties) {
|
|
108
108
|
const { uiShell, uiManagedWorkflows } = this;
|
|
109
|
-
await uiShell.
|
|
109
|
+
await uiShell.goToNavigationPanelItemByTestIds('video-encoding-settings-processing', 'video-encoding-settings');
|
|
110
110
|
await uiManagedWorkflows.list.waitForData();
|
|
111
111
|
// new profile
|
|
112
112
|
await uiShell.waitForPageTransition(uiManagedWorkflows.pageHeader.actions.getActionByLabel('NEW').click());
|
|
@@ -145,7 +145,7 @@ class VideoService extends managed_service_model_1.ManagedServiceModel {
|
|
|
145
145
|
*/
|
|
146
146
|
async deleteVideoProcessingProfile(args) {
|
|
147
147
|
const { uiShell, uiManagedWorkflows } = this;
|
|
148
|
-
await uiShell.
|
|
148
|
+
await uiShell.goToNavigationPanelItemByTestIds('video-encoding-settings-processing', 'video-encoding-settings');
|
|
149
149
|
await uiManagedWorkflows.list.waitForData();
|
|
150
150
|
// filter to the item
|
|
151
151
|
await uiManagedWorkflows.filters
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video-service.js","sourceRoot":"","sources":["../../src/managed-services/video-service.ts"],"names":[],"mappings":";;;AAAA,6EAA8D;AAC9D,mEAA8D;AAE9D,6CAA6C;AAC7C,MAAa,YAAa,SAAQ,2CAAmB;IACnD;;;;;;;;;;OAUG;IACH,KAAK,CAAC,sBAAsB,CAAC,IAG5B;QACC,MAAM,EAAE,OAAO,EAAE,kBAAkB,EAAE,GAAG,IAAI,CAAC;QAC7C,MAAM,OAAO,CAAC,yBAAyB,CAAC,QAAQ,CAAC,CAAC;QAClD,MAAM,kBAAkB,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;QAE5C,qBAAqB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Ae,CAAC,OAAO,CAAC;aACxB,gBAAgB,EAAE;aAClB,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACxB,MAAM,kBAAkB,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;QAE5C,gDAAgD;QAChD,IAAI,CAAC,MAAM,kBAAkB,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,EAAE;YAChE,MAAM,IAAI,KAAK,CACb,6DAA6D,IAAI,CAAC,KAAK,IAAI,CAC5E,CAAC;SACH;QAED,kDAAkD;QAClD,MAAM,OAAO,CAAC,qBAAqB,CACjC,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,EAAE,CACvD,CAAC;QACF,MAAM,kBAAkB,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;QAC5C,MAAM,kBAAkB,CAAC,OAAO,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,CAAC;QACpE,MAAM,OAAO,CAAC,qBAAqB,CACjC,kBAAkB,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,EAAE,CACjD,CAAC;QACF,MAAM,kBAAkB,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;IAC9C,CAAC;CACF;AApND,oCAoNC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { ComponentModel } from '@axinom/mosaic-e2e-ui-selectors';
|
|
2
|
+
import { FrameLocator, Locator, Page } from 'playwright-core';
|
|
3
|
+
/**
|
|
4
|
+
* A model for Shell apps Navigation Panel
|
|
5
|
+
*/
|
|
6
|
+
export declare class NavigationPanel extends ComponentModel {
|
|
7
|
+
/** A locator for navigation panel */
|
|
8
|
+
readonly panel: Locator;
|
|
9
|
+
constructor(parent: Page | FrameLocator, xpath?: string);
|
|
10
|
+
/**
|
|
11
|
+
* Gets navigation category by position
|
|
12
|
+
* @param position 1-based index. Negative numbers count from the end.
|
|
13
|
+
*/
|
|
14
|
+
getCategory(position: number): NavigationCategory;
|
|
15
|
+
/**
|
|
16
|
+
* Gets navigation category by matching category label text
|
|
17
|
+
* @param label Text of the category item label
|
|
18
|
+
* @param nth 1-based index. Negative numbers count from the end.
|
|
19
|
+
*/
|
|
20
|
+
getCategoryByLabel(label: string, nth?: number): NavigationCategory;
|
|
21
|
+
/**
|
|
22
|
+
* Gets navigation item group by matching data-test-id attribute
|
|
23
|
+
* @param id Value of item groups `data-test-id` attribute
|
|
24
|
+
* @param nth 1-based index. Negative numbers count from the end.
|
|
25
|
+
*/
|
|
26
|
+
getNavigationItemGroupById(id: string, nth?: number): NavigationItemGroup;
|
|
27
|
+
/**
|
|
28
|
+
* Gets navigation item by matching data-test-id attribute
|
|
29
|
+
* @param id Value of items `data-test-id` attribute
|
|
30
|
+
* @param nth 1-based index. Negative numbers count from the end.
|
|
31
|
+
*/
|
|
32
|
+
getNavigationItemById(id: string, nth?: number): Locator;
|
|
33
|
+
}
|
|
34
|
+
export declare class NavigationCategory extends ComponentModel {
|
|
35
|
+
/** Label of navigation category */
|
|
36
|
+
readonly label: Locator;
|
|
37
|
+
/**
|
|
38
|
+
* Gets navigation item group by position
|
|
39
|
+
* @param position 1-based index. Negative numbers count from the end.
|
|
40
|
+
*/
|
|
41
|
+
getNavigationItemGroup(position: number): NavigationItemGroup;
|
|
42
|
+
/**
|
|
43
|
+
* Gets navigation item group by matching groups label text in category
|
|
44
|
+
* @param label Navigation item label text to use for matches
|
|
45
|
+
* @param nth 1-based index. Specifies which match to return in case multiple items match `label`, defaults to 1
|
|
46
|
+
*/
|
|
47
|
+
getNavigationItemGroupByLabel(label: string, nth?: number): NavigationItemGroup;
|
|
48
|
+
/**
|
|
49
|
+
* Gets navigation item by matching label text in the navigation category
|
|
50
|
+
* @param label Text of the navigation item label
|
|
51
|
+
* @param nth 1-based index. Specifies which match to return in case multiple items match `label`, defaults to 1
|
|
52
|
+
*/
|
|
53
|
+
getNavigationItemByLabel(label: string, nth?: number): Locator;
|
|
54
|
+
}
|
|
55
|
+
export declare class NavigationItemGroup extends ComponentModel {
|
|
56
|
+
readonly label: Locator;
|
|
57
|
+
/** A locator to the navigation items root container */
|
|
58
|
+
readonly navItemRoot: Locator;
|
|
59
|
+
/** A locator to the expand/collapse button */
|
|
60
|
+
readonly expandButton: Locator;
|
|
61
|
+
/** A locator to the child item container */
|
|
62
|
+
readonly childItemContainer: Locator;
|
|
63
|
+
/**
|
|
64
|
+
* Expands child items in navigation group
|
|
65
|
+
* Does nothing in case group already expanded
|
|
66
|
+
*/
|
|
67
|
+
expand(): Promise<void>;
|
|
68
|
+
/**
|
|
69
|
+
* Collapses child item container in navigation group
|
|
70
|
+
* Does nothing in case group already collapsed
|
|
71
|
+
*/
|
|
72
|
+
collapse(): Promise<void>;
|
|
73
|
+
/**
|
|
74
|
+
* Gets navigation item by position in navigation group.
|
|
75
|
+
* @param position 1-based index. Negative numbers count from the end.
|
|
76
|
+
*/
|
|
77
|
+
getNavItem(position: number): Locator;
|
|
78
|
+
/**
|
|
79
|
+
* Gets navigation item by matching data-test-id attribute
|
|
80
|
+
* @param id Value of navigation items data-test-id attribute
|
|
81
|
+
* @param nth 1-based index. Specifies which match to return in case multiple items match `data-test-id`, defaults to 1
|
|
82
|
+
*/
|
|
83
|
+
getNavItemById(id: string, nth?: number): Locator;
|
|
84
|
+
/**
|
|
85
|
+
* Gets navigation item by matching label text in the navigation group
|
|
86
|
+
* @param label Navigation item label text
|
|
87
|
+
* @param nth 1-based index. Specifies which match to return in case multiple items match `label`, defaults to 1
|
|
88
|
+
*/
|
|
89
|
+
getNavItemByLabel(label: string, nth?: number): Locator;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=navigation-panel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-panel.d.ts","sourceRoot":"","sources":["../../src/ui-selectors/navigation-panel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,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/B;;;OAGG;IACH,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAIrC;;;;OAIG;IACH,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,SAAI,GAAG,OAAO;IAI5C;;;;OAIG;IACH,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,SAAI,GAAG,OAAO;CAMnD"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NavigationItemGroup = exports.NavigationCategory = exports.NavigationPanel = void 0;
|
|
4
|
+
const mosaic_e2e_ui_selectors_1 = require("@axinom/mosaic-e2e-ui-selectors");
|
|
5
|
+
const navItemXPath = (id) => `//*[@data-test-id="root-item-container"]//a[.//*[@data-test-id="${id}"]]`;
|
|
6
|
+
/**
|
|
7
|
+
* A model for Shell apps Navigation Panel
|
|
8
|
+
*/
|
|
9
|
+
class NavigationPanel extends mosaic_e2e_ui_selectors_1.ComponentModel {
|
|
10
|
+
constructor(parent, xpath = '//*[@data-test-id="navigation-panel"]') {
|
|
11
|
+
super(parent, xpath);
|
|
12
|
+
/** A locator for navigation panel */
|
|
13
|
+
this.panel = this.getLocator();
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Gets navigation category by position
|
|
17
|
+
* @param position 1-based index. Negative numbers count from the end.
|
|
18
|
+
*/
|
|
19
|
+
getCategory(position) {
|
|
20
|
+
return new NavigationCategory(this, '//*[@data-test-id="category"]', position);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Gets navigation category by matching category label text
|
|
24
|
+
* @param label Text of the category item label
|
|
25
|
+
* @param nth 1-based index. Negative numbers count from the end.
|
|
26
|
+
*/
|
|
27
|
+
getCategoryByLabel(label, nth = 1) {
|
|
28
|
+
return new NavigationCategory(this, `//*[@data-test-id="category"][.//*[@data-test-id="category-label" and text()="${label}"]]`, nth);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Gets navigation item group by matching data-test-id attribute
|
|
32
|
+
* @param id Value of item groups `data-test-id` attribute
|
|
33
|
+
* @param nth 1-based index. Negative numbers count from the end.
|
|
34
|
+
*/
|
|
35
|
+
getNavigationItemGroupById(id, nth = 1) {
|
|
36
|
+
return new NavigationItemGroup(this, `//*[@data-test-id="root-item-container"][.//*[@data-test-id="${id}"]]`, nth);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Gets navigation item by matching data-test-id attribute
|
|
40
|
+
* @param id Value of items `data-test-id` attribute
|
|
41
|
+
* @param nth 1-based index. Negative numbers count from the end.
|
|
42
|
+
*/
|
|
43
|
+
getNavigationItemById(id, nth = 1) {
|
|
44
|
+
return this.getLocator(navItemXPath(id), nth);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.NavigationPanel = NavigationPanel;
|
|
48
|
+
class NavigationCategory extends mosaic_e2e_ui_selectors_1.ComponentModel {
|
|
49
|
+
constructor() {
|
|
50
|
+
super(...arguments);
|
|
51
|
+
/** Label of navigation category */
|
|
52
|
+
this.label = this.getLocator(`//*[@data-test-id="category-label"]`);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Gets navigation item group by position
|
|
56
|
+
* @param position 1-based index. Negative numbers count from the end.
|
|
57
|
+
*/
|
|
58
|
+
getNavigationItemGroup(position) {
|
|
59
|
+
return new NavigationItemGroup(this, '//*[@data-test-id="root-item-container"]', position);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Gets navigation item group by matching groups label text in category
|
|
63
|
+
* @param label Navigation item label text to use for matches
|
|
64
|
+
* @param nth 1-based index. Specifies which match to return in case multiple items match `label`, defaults to 1
|
|
65
|
+
*/
|
|
66
|
+
getNavigationItemGroupByLabel(label, nth = 1) {
|
|
67
|
+
return new NavigationItemGroup(this, `//*[@data-test-id="root-item-container"][.//*[@data-test-id="nav-item-label" and text()="${label}"]]`, nth);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Gets navigation item by matching label text in the navigation category
|
|
71
|
+
* @param label Text of the navigation item label
|
|
72
|
+
* @param nth 1-based index. Specifies which match to return in case multiple items match `label`, defaults to 1
|
|
73
|
+
*/
|
|
74
|
+
getNavigationItemByLabel(label, nth = 1) {
|
|
75
|
+
return this.getLocator(`//*[@data-test-id="root-item-container"][.//*[@data-test-id="nav-item-label" and text()="${label}"]]`, nth);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
exports.NavigationCategory = NavigationCategory;
|
|
79
|
+
class NavigationItemGroup extends mosaic_e2e_ui_selectors_1.ComponentModel {
|
|
80
|
+
constructor() {
|
|
81
|
+
super(...arguments);
|
|
82
|
+
this.label = this.getLocator(`//*[@data-test-id="category-label"]`);
|
|
83
|
+
/** A locator to the navigation items root container */
|
|
84
|
+
this.navItemRoot = this.getLocator('//*[@data-test-id="root-item-container"]');
|
|
85
|
+
/** A locator to the expand/collapse button */
|
|
86
|
+
this.expandButton = this.getLocator('//*[@data-test-id="button"]');
|
|
87
|
+
/** A locator to the child item container */
|
|
88
|
+
this.childItemContainer = this.getLocator('//*[@data-test-id="child-item-container"]');
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Expands child items in navigation group
|
|
92
|
+
* Does nothing in case group already expanded
|
|
93
|
+
*/
|
|
94
|
+
async expand() {
|
|
95
|
+
if (await this.childItemContainer.isVisible()) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
await this.expandButton.click();
|
|
99
|
+
await this.childItemContainer.waitFor({ state: 'visible' });
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Collapses child item container in navigation group
|
|
103
|
+
* Does nothing in case group already collapsed
|
|
104
|
+
*/
|
|
105
|
+
async collapse() {
|
|
106
|
+
if (!(await this.childItemContainer.isVisible())) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
await this.expandButton.click();
|
|
110
|
+
await this.childItemContainer.waitFor({ state: 'hidden' });
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Gets navigation item by position in navigation group.
|
|
114
|
+
* @param position 1-based index. Negative numbers count from the end.
|
|
115
|
+
*/
|
|
116
|
+
getNavItem(position) {
|
|
117
|
+
return this.getLocator('//*[@data-test-id="nav-item-label"]', position);
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Gets navigation item by matching data-test-id attribute
|
|
121
|
+
* @param id Value of navigation items data-test-id attribute
|
|
122
|
+
* @param nth 1-based index. Specifies which match to return in case multiple items match `data-test-id`, defaults to 1
|
|
123
|
+
*/
|
|
124
|
+
getNavItemById(id, nth = 1) {
|
|
125
|
+
return this.getLocator(`//a[.//*[@data-test-id="${id}"]]`, nth);
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Gets navigation item by matching label text in the navigation group
|
|
129
|
+
* @param label Navigation item label text
|
|
130
|
+
* @param nth 1-based index. Specifies which match to return in case multiple items match `label`, defaults to 1
|
|
131
|
+
*/
|
|
132
|
+
getNavItemByLabel(label, nth = 1) {
|
|
133
|
+
return this.getLocator(`//a[.//*[@data-test-id="nav-item-label" and text()="${label}"]]`, nth);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
exports.NavigationItemGroup = NavigationItemGroup;
|
|
137
|
+
//# sourceMappingURL=navigation-panel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-panel.js","sourceRoot":"","sources":["../../src/ui-selectors/navigation-panel.ts"],"names":[],"mappings":";;;AAAA,6EAAiE;AAGjE,MAAM,YAAY,GAAG,CAAC,EAAU,EAAU,EAAE,CAC1C,mEAAmE,EAAE,KAAK,CAAC;AAE7E;;GAEG;AACH,MAAa,eAAgB,SAAQ,wCAAc;IAIjD,YACE,MAA2B,EAC3B,KAAK,GAAG,uCAAuC;QAE/C,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QAPvB,qCAAqC;QAC5B,UA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EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;IAClE,CAAC;IAED;;;;OAIG;IACH,iBAAiB,CAAC,KAAa,EAAE,GAAG,GAAG,CAAC;QACtC,OAAO,IAAI,CAAC,UAAU,CACpB,uDAAuD,KAAK,KAAK,EACjE,GAAG,CACJ,CAAC;IACJ,CAAC;CACF;AApED,kDAoEC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Hub, LandingPageHeader, LandingPageTiles, PageHeader } from '@axinom/mosaic-e2e-ui-selectors';
|
|
2
2
|
import { Page } from 'playwright-core';
|
|
3
3
|
import { Breadcrumbs } from './breadcrumbs';
|
|
4
|
+
import { NavigationPanel } from './navigation-panel';
|
|
4
5
|
/**
|
|
5
6
|
* A model representing the Mosaic UI including methods for navigation.
|
|
6
7
|
* This model should be used for page and UI components which are provided by Mosaic as a service.
|
|
@@ -27,6 +28,8 @@ export declare class UiShellModel {
|
|
|
27
28
|
readonly settingsPageHeader: PageHeader;
|
|
28
29
|
/** A model for the settings pages navigation hub. */
|
|
29
30
|
readonly settingsPageHub: Hub;
|
|
31
|
+
/** A model for navigation panel */
|
|
32
|
+
readonly navigationPanel: NavigationPanel;
|
|
30
33
|
/**
|
|
31
34
|
* This method navigates to the landing page breadcrumb.
|
|
32
35
|
* The management system must be loaded & signed in before using this method.
|
|
@@ -68,6 +71,8 @@ export declare class UiShellModel {
|
|
|
68
71
|
* This method navigates to a settings page tile by label.
|
|
69
72
|
* The management system must be loaded & signed in before using this method.
|
|
70
73
|
*
|
|
74
|
+
* @deprecated Please use `goToNavigationPanelSettingsItem` instead
|
|
75
|
+
*
|
|
71
76
|
* The following steps will be taken:
|
|
72
77
|
* - Navigate to the home breadcrumb (if not already on the landing page)
|
|
73
78
|
* - Navigate to the 'Settings' tile
|
|
@@ -75,6 +80,49 @@ export declare class UiShellModel {
|
|
|
75
80
|
* - Wait for a page transition to complete
|
|
76
81
|
*/
|
|
77
82
|
navigateToSettingsTile(groupLabel: string, tileLabel: string): Promise<void>;
|
|
83
|
+
/**
|
|
84
|
+
* Navigates to specified Settings page item using navigation panel
|
|
85
|
+
* The management system must be loaded & signed in before using this method.
|
|
86
|
+
*
|
|
87
|
+
* The following steps will be taken:
|
|
88
|
+
* - Navigate to the home breadcrumb (if not already on the landing page)
|
|
89
|
+
* - Navigate to the Settings category
|
|
90
|
+
* - In case `groupLabel` is provided navigate to the navigation item group by group label and expand the it
|
|
91
|
+
* - Navigate to the navigation item by item label
|
|
92
|
+
* - Wait for a page transition to complete
|
|
93
|
+
* @param itemLabel Navigation item label
|
|
94
|
+
* @param groupLabel Label of navigation item group in Settings category, that needs to be expanded
|
|
95
|
+
*/
|
|
96
|
+
goToNavigationPanelSettingsItem(itemLabel: string, groupLabel?: string): Promise<void>;
|
|
97
|
+
/**
|
|
98
|
+
* Navigates to the specified navigation panel page using Navigation Panel item text
|
|
99
|
+
* The management system must be loaded & signed in before using this method.
|
|
100
|
+
*
|
|
101
|
+
* The following steps will be taken:
|
|
102
|
+
* - Expand the menu (if not on a home view where the navigation panel is already visible)
|
|
103
|
+
* - Navigate to the navigation category by category label
|
|
104
|
+
* - In case `groupLabel` is provided Navigate to the navigation item group by group label and expand the group
|
|
105
|
+
* - Navigate to the navigation item by item label
|
|
106
|
+
* - Wait for a page transition to complete
|
|
107
|
+
* @param categoryLabel Navigation category label
|
|
108
|
+
* @param itemLabel Label of navigation item
|
|
109
|
+
* @param groupLabel Label of navigation item group in category, that needs to be expanded
|
|
110
|
+
*/
|
|
111
|
+
goToNavigationPanelItem(categoryLabel: string, itemLabel: string, groupLabel?: string): Promise<void>;
|
|
112
|
+
/**
|
|
113
|
+
* Navigates to the specified navigation panel page using HTML element attribute `data-test-id`
|
|
114
|
+
* The management system must be loaded & signed in before using this method.
|
|
115
|
+
*
|
|
116
|
+
* The following steps will be taken:
|
|
117
|
+
* - Expand the menu (if not on a home view where the navigation panel is already visible)
|
|
118
|
+
* - Navigate to the navigation category by category label
|
|
119
|
+
* - In case `groupLabel` is provided Navigate to the navigation item group by group label and expand the group
|
|
120
|
+
* - Navigate to the navigation item by item label
|
|
121
|
+
* - Wait for a page transition to complete
|
|
122
|
+
* @param itemTestId data-test-id attribute of navigation item
|
|
123
|
+
* @param groupTestId data-test-id attribute of navigation item group
|
|
124
|
+
*/
|
|
125
|
+
goToNavigationPanelItemByTestIds(itemTestId: string, groupTestId?: string): Promise<void>;
|
|
78
126
|
/**
|
|
79
127
|
* This method waits for a page transition to complete while another promise is being resolved.
|
|
80
128
|
* The two async processes run in parallel inside a `Promise.all` which prevents
|
|
@@ -90,5 +138,6 @@ export declare class UiShellModel {
|
|
|
90
138
|
* ```
|
|
91
139
|
*/
|
|
92
140
|
get waitForPageTransition(): (promise: Promise<any>) => Promise<void>;
|
|
141
|
+
private expandNavigationPanel;
|
|
93
142
|
}
|
|
94
143
|
//# sourceMappingURL=ui-shell-model.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-shell-model.d.ts","sourceRoot":"","sources":["../../src/ui-selectors/ui-shell-model.ts"],"names":[],"mappings":"AACA,OAAO,EACL,GAAG,EACH,iBAAiB,EACjB,gBAAgB,EAChB,UAAU,EACX,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"ui-shell-model.d.ts","sourceRoot":"","sources":["../../src/ui-selectors/ui-shell-model.ts"],"names":[],"mappings":"AACA,OAAO,EACL,GAAG,EACH,iBAAiB,EACjB,gBAAgB,EAChB,UAAU,EACX,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD;;;;;;;;;GASG;AACH,qBAAa,YAAY;IA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,IAAI,qBAAqB,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAmBpE;YAEa,qBAAqB;CAWpC"}
|
|
@@ -4,6 +4,7 @@ exports.UiShellModel = void 0;
|
|
|
4
4
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
5
5
|
const mosaic_e2e_ui_selectors_1 = require("@axinom/mosaic-e2e-ui-selectors");
|
|
6
6
|
const breadcrumbs_1 = require("./breadcrumbs");
|
|
7
|
+
const navigation_panel_1 = require("./navigation-panel");
|
|
7
8
|
/**
|
|
8
9
|
* A model representing the Mosaic UI including methods for navigation.
|
|
9
10
|
* This model should be used for page and UI components which are provided by Mosaic as a service.
|
|
@@ -29,6 +30,8 @@ class UiShellModel {
|
|
|
29
30
|
this.settingsPageHeader = new mosaic_e2e_ui_selectors_1.PageHeader(this.page);
|
|
30
31
|
/** A model for the settings pages navigation hub. */
|
|
31
32
|
this.settingsPageHub = new mosaic_e2e_ui_selectors_1.Hub(this.page);
|
|
33
|
+
/** A model for navigation panel */
|
|
34
|
+
this.navigationPanel = new navigation_panel_1.NavigationPanel(this.page);
|
|
32
35
|
}
|
|
33
36
|
/**
|
|
34
37
|
* This method navigates to the landing page breadcrumb.
|
|
@@ -101,6 +104,8 @@ class UiShellModel {
|
|
|
101
104
|
* This method navigates to a settings page tile by label.
|
|
102
105
|
* The management system must be loaded & signed in before using this method.
|
|
103
106
|
*
|
|
107
|
+
* @deprecated Please use `goToNavigationPanelSettingsItem` instead
|
|
108
|
+
*
|
|
104
109
|
* The following steps will be taken:
|
|
105
110
|
* - Navigate to the home breadcrumb (if not already on the landing page)
|
|
106
111
|
* - Navigate to the 'Settings' tile
|
|
@@ -108,17 +113,87 @@ class UiShellModel {
|
|
|
108
113
|
* - Wait for a page transition to complete
|
|
109
114
|
*/
|
|
110
115
|
async navigateToSettingsTile(groupLabel, tileLabel) {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
116
|
+
this.goToNavigationPanelSettingsItem(tileLabel, groupLabel);
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Navigates to specified Settings page item using navigation panel
|
|
120
|
+
* The management system must be loaded & signed in before using this method.
|
|
121
|
+
*
|
|
122
|
+
* The following steps will be taken:
|
|
123
|
+
* - Navigate to the home breadcrumb (if not already on the landing page)
|
|
124
|
+
* - Navigate to the Settings category
|
|
125
|
+
* - In case `groupLabel` is provided navigate to the navigation item group by group label and expand the it
|
|
126
|
+
* - Navigate to the navigation item by item label
|
|
127
|
+
* - Wait for a page transition to complete
|
|
128
|
+
* @param itemLabel Navigation item label
|
|
129
|
+
* @param groupLabel Label of navigation item group in Settings category, that needs to be expanded
|
|
130
|
+
*/
|
|
131
|
+
async goToNavigationPanelSettingsItem(itemLabel, groupLabel) {
|
|
132
|
+
await this.goToNavigationPanelItem('Settings', itemLabel, groupLabel);
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Navigates to the specified navigation panel page using Navigation Panel item text
|
|
136
|
+
* The management system must be loaded & signed in before using this method.
|
|
137
|
+
*
|
|
138
|
+
* The following steps will be taken:
|
|
139
|
+
* - Expand the menu (if not on a home view where the navigation panel is already visible)
|
|
140
|
+
* - Navigate to the navigation category by category label
|
|
141
|
+
* - In case `groupLabel` is provided Navigate to the navigation item group by group label and expand the group
|
|
142
|
+
* - Navigate to the navigation item by item label
|
|
143
|
+
* - Wait for a page transition to complete
|
|
144
|
+
* @param categoryLabel Navigation category label
|
|
145
|
+
* @param itemLabel Label of navigation item
|
|
146
|
+
* @param groupLabel Label of navigation item group in category, that needs to be expanded
|
|
147
|
+
*/
|
|
148
|
+
async goToNavigationPanelItem(categoryLabel, itemLabel, groupLabel) {
|
|
149
|
+
const category = this.navigationPanel.getCategoryByLabel(categoryLabel);
|
|
150
|
+
let item;
|
|
151
|
+
await this.expandNavigationPanel();
|
|
152
|
+
if (groupLabel) {
|
|
153
|
+
const group = category.getNavigationItemGroupByLabel(groupLabel);
|
|
154
|
+
try {
|
|
155
|
+
await group.expand();
|
|
156
|
+
}
|
|
157
|
+
catch (_a) {
|
|
158
|
+
throw new Error(`Navigation panel item '${categoryLabel}>${groupLabel}>${itemLabel}' is not visible. Is the label(s) correct? Is the service enabled for this environment?`);
|
|
159
|
+
}
|
|
160
|
+
item = group.getNavItemByLabel(itemLabel);
|
|
117
161
|
}
|
|
118
|
-
|
|
119
|
-
|
|
162
|
+
else {
|
|
163
|
+
item = category.getNavigationItemByLabel(itemLabel);
|
|
120
164
|
}
|
|
121
|
-
await this.waitForPageTransition(
|
|
165
|
+
await this.waitForPageTransition(item.click());
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Navigates to the specified navigation panel page using HTML element attribute `data-test-id`
|
|
169
|
+
* The management system must be loaded & signed in before using this method.
|
|
170
|
+
*
|
|
171
|
+
* The following steps will be taken:
|
|
172
|
+
* - Expand the menu (if not on a home view where the navigation panel is already visible)
|
|
173
|
+
* - Navigate to the navigation category by category label
|
|
174
|
+
* - In case `groupLabel` is provided Navigate to the navigation item group by group label and expand the group
|
|
175
|
+
* - Navigate to the navigation item by item label
|
|
176
|
+
* - Wait for a page transition to complete
|
|
177
|
+
* @param itemTestId data-test-id attribute of navigation item
|
|
178
|
+
* @param groupTestId data-test-id attribute of navigation item group
|
|
179
|
+
*/
|
|
180
|
+
async goToNavigationPanelItemByTestIds(itemTestId, groupTestId) {
|
|
181
|
+
let item;
|
|
182
|
+
await this.expandNavigationPanel();
|
|
183
|
+
if (groupTestId) {
|
|
184
|
+
const group = this.navigationPanel.getNavigationItemGroupById(groupTestId);
|
|
185
|
+
try {
|
|
186
|
+
await group.expand();
|
|
187
|
+
}
|
|
188
|
+
catch (_a) {
|
|
189
|
+
throw new Error(`Navigation panel item '${groupTestId}>${itemTestId}' is not visible. Is the label(s) correct? Is the service enabled for this environment?`);
|
|
190
|
+
}
|
|
191
|
+
item = group.getNavItemById(itemTestId);
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
item = this.navigationPanel.getNavigationItemById(itemTestId);
|
|
195
|
+
}
|
|
196
|
+
await this.waitForPageTransition(item.click());
|
|
122
197
|
}
|
|
123
198
|
/**
|
|
124
199
|
* This method waits for a page transition to complete while another promise is being resolved.
|
|
@@ -148,6 +223,14 @@ class UiShellModel {
|
|
|
148
223
|
await Promise.all([firstPromise, promise]);
|
|
149
224
|
};
|
|
150
225
|
}
|
|
226
|
+
async expandNavigationPanel() {
|
|
227
|
+
const expandMenuButton = this.page.locator(`//*[@data-test-id="hamburger-menu-button"]`);
|
|
228
|
+
// If expand menu button visible (not on a home view), expand the menu
|
|
229
|
+
if (await expandMenuButton.isEnabled()) {
|
|
230
|
+
expandMenuButton.click();
|
|
231
|
+
await this.navigationPanel.panel.waitFor({ state: 'visible' });
|
|
232
|
+
}
|
|
233
|
+
}
|
|
151
234
|
}
|
|
152
235
|
exports.UiShellModel = UiShellModel;
|
|
153
236
|
//# sourceMappingURL=ui-shell-model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-shell-model.js","sourceRoot":"","sources":["../../src/ui-selectors/ui-shell-model.ts"],"names":[],"mappings":";;;AAAA,uDAAuD;AACvD,6EAKyC;AAEzC,+CAA4C;
|
|
1
|
+
{"version":3,"file":"ui-shell-model.js","sourceRoot":"","sources":["../../src/ui-selectors/ui-shell-model.ts"],"names":[],"mappings":";;;AAAA,uDAAuD;AACvD,6EAKyC;AAEzC,+CAA4C;AAC5C,yDAAqD;AAErD;;;;;;;;;GASG;AACH,MAAa,YAAY;IACvB;IACE,kCAAkC;IACf,IAAU;QAAV,SAAI,GAAJ,IAAI,CAAM;QAG/B,uCAAuC;QAC9B,gBAAW,GAAG,IAAI,yBAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAElD,kDAAkD;QACzC,sBAAiB,GAAG,IAAI,2CAAiB,CAAC,IAAI,CAAC,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CAC9J,CAAC;QACF,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CACrC,uJAAuJ,CACxJ,CAAC;QAEF,+HAA+H;QAC/H,sEAAsE;QACtE,MAAM,YAAY,GAAG,eAAe;aACjC,OAAO,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;aAC9B,IAAI,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC;QAE5D,wGAAwG;QACxG,OAAO,KAAK,EAAE,OAAqB,EAAiB,EAAE;YACpD,uCAAuC;YACvC,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC;QAC7C,CAAC,CAAC;IACJ,CAAC;IAEO,KAAK,CAAC,qBAAqB;QACjC,MAAM,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CACxC,4CAA4C,CAC7C,CAAC;QAEF,sEAAsE;QACtE,IAAI,MAAM,gBAAgB,CAAC,SAAS,EAAE,EAAE;YACtC,gBAAgB,CAAC,KAAK,EAAE,CAAC;YACzB,MAAM,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;SAChE;IACH,CAAC;CACF;AAtQD,oCAsQC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axinom/mosaic-e2e-page-model",
|
|
3
|
-
"version": "0.3.0-rc.
|
|
3
|
+
"version": "0.3.0-rc.6",
|
|
4
4
|
"description": "A page model for testing an Axinom Mosaic Management System with Playwright.",
|
|
5
5
|
"author": "Axinom",
|
|
6
6
|
"license": "PROPRIETARY",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"dev": "tsc -w"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@axinom/mosaic-e2e-ui-selectors": "^0.3.0-rc.
|
|
25
|
+
"@axinom/mosaic-e2e-ui-selectors": "^0.3.0-rc.6"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "^14.18.0",
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "dcb3a9f2a5c37c984192e1471fac9a9ec94a3010"
|
|
39
39
|
}
|
|
@@ -131,7 +131,10 @@ export class VideoService extends ManagedServiceModel {
|
|
|
131
131
|
drmProtection?: 'Single Key' | 'Multiple Keys';
|
|
132
132
|
}): Promise<void> {
|
|
133
133
|
const { uiShell, uiManagedWorkflows } = this;
|
|
134
|
-
await uiShell.
|
|
134
|
+
await uiShell.goToNavigationPanelItemByTestIds(
|
|
135
|
+
'video-encoding-settings-processing',
|
|
136
|
+
'video-encoding-settings',
|
|
137
|
+
);
|
|
135
138
|
await uiManagedWorkflows.list.waitForData();
|
|
136
139
|
|
|
137
140
|
// new profile
|
|
@@ -180,7 +183,10 @@ export class VideoService extends ManagedServiceModel {
|
|
|
180
183
|
title: string;
|
|
181
184
|
}): Promise<void> {
|
|
182
185
|
const { uiShell, uiManagedWorkflows } = this;
|
|
183
|
-
await uiShell.
|
|
186
|
+
await uiShell.goToNavigationPanelItemByTestIds(
|
|
187
|
+
'video-encoding-settings-processing',
|
|
188
|
+
'video-encoding-settings',
|
|
189
|
+
);
|
|
184
190
|
await uiManagedWorkflows.list.waitForData();
|
|
185
191
|
|
|
186
192
|
// filter to the item
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { ComponentModel } from '@axinom/mosaic-e2e-ui-selectors';
|
|
2
|
+
import { FrameLocator, Locator, Page } from 'playwright-core';
|
|
3
|
+
|
|
4
|
+
const navItemXPath = (id: string): string =>
|
|
5
|
+
`//*[@data-test-id="root-item-container"]//a[.//*[@data-test-id="${id}"]]`;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* A model for Shell apps Navigation Panel
|
|
9
|
+
*/
|
|
10
|
+
export class NavigationPanel extends ComponentModel {
|
|
11
|
+
/** A locator for navigation panel */
|
|
12
|
+
readonly panel = this.getLocator();
|
|
13
|
+
|
|
14
|
+
constructor(
|
|
15
|
+
parent: Page | FrameLocator,
|
|
16
|
+
xpath = '//*[@data-test-id="navigation-panel"]',
|
|
17
|
+
) {
|
|
18
|
+
super(parent, xpath);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Gets navigation category by position
|
|
23
|
+
* @param position 1-based index. Negative numbers count from the end.
|
|
24
|
+
*/
|
|
25
|
+
getCategory(position: number): NavigationCategory {
|
|
26
|
+
return new NavigationCategory(
|
|
27
|
+
this,
|
|
28
|
+
'//*[@data-test-id="category"]',
|
|
29
|
+
position,
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Gets navigation category by matching category label text
|
|
35
|
+
* @param label Text of the category item label
|
|
36
|
+
* @param nth 1-based index. Negative numbers count from the end.
|
|
37
|
+
*/
|
|
38
|
+
getCategoryByLabel(label: string, nth = 1): NavigationCategory {
|
|
39
|
+
return new NavigationCategory(
|
|
40
|
+
this,
|
|
41
|
+
`//*[@data-test-id="category"][.//*[@data-test-id="category-label" and text()="${label}"]]`,
|
|
42
|
+
nth,
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Gets navigation item group by matching data-test-id attribute
|
|
48
|
+
* @param id Value of item groups `data-test-id` attribute
|
|
49
|
+
* @param nth 1-based index. Negative numbers count from the end.
|
|
50
|
+
*/
|
|
51
|
+
getNavigationItemGroupById(id: string, nth = 1): NavigationItemGroup {
|
|
52
|
+
return new NavigationItemGroup(
|
|
53
|
+
this,
|
|
54
|
+
`//*[@data-test-id="root-item-container"][.//*[@data-test-id="${id}"]]`,
|
|
55
|
+
nth,
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Gets navigation item by matching data-test-id attribute
|
|
61
|
+
* @param id Value of items `data-test-id` attribute
|
|
62
|
+
* @param nth 1-based index. Negative numbers count from the end.
|
|
63
|
+
*/
|
|
64
|
+
getNavigationItemById(id: string, nth = 1): Locator {
|
|
65
|
+
return this.getLocator(navItemXPath(id), nth);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export class NavigationCategory extends ComponentModel {
|
|
70
|
+
/** Label of navigation category */
|
|
71
|
+
readonly label = this.getLocator(`//*[@data-test-id="category-label"]`);
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Gets navigation item group by position
|
|
75
|
+
* @param position 1-based index. Negative numbers count from the end.
|
|
76
|
+
*/
|
|
77
|
+
getNavigationItemGroup(position: number): NavigationItemGroup {
|
|
78
|
+
return new NavigationItemGroup(
|
|
79
|
+
this,
|
|
80
|
+
'//*[@data-test-id="root-item-container"]',
|
|
81
|
+
position,
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Gets navigation item group by matching groups label text in category
|
|
87
|
+
* @param label Navigation item label text to use for matches
|
|
88
|
+
* @param nth 1-based index. Specifies which match to return in case multiple items match `label`, defaults to 1
|
|
89
|
+
*/
|
|
90
|
+
getNavigationItemGroupByLabel(label: string, nth = 1): NavigationItemGroup {
|
|
91
|
+
return new NavigationItemGroup(
|
|
92
|
+
this,
|
|
93
|
+
`//*[@data-test-id="root-item-container"][.//*[@data-test-id="nav-item-label" and text()="${label}"]]`,
|
|
94
|
+
nth,
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Gets navigation item by matching label text in the navigation category
|
|
100
|
+
* @param label Text of the navigation item label
|
|
101
|
+
* @param nth 1-based index. Specifies which match to return in case multiple items match `label`, defaults to 1
|
|
102
|
+
*/
|
|
103
|
+
getNavigationItemByLabel(label: string, nth = 1): Locator {
|
|
104
|
+
return this.getLocator(
|
|
105
|
+
`//*[@data-test-id="root-item-container"][.//*[@data-test-id="nav-item-label" and text()="${label}"]]`,
|
|
106
|
+
nth,
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export class NavigationItemGroup extends ComponentModel {
|
|
112
|
+
readonly label = this.getLocator(`//*[@data-test-id="category-label"]`);
|
|
113
|
+
|
|
114
|
+
/** A locator to the navigation items root container */
|
|
115
|
+
readonly navItemRoot = this.getLocator(
|
|
116
|
+
'//*[@data-test-id="root-item-container"]',
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
/** A locator to the expand/collapse button */
|
|
120
|
+
readonly expandButton = this.getLocator('//*[@data-test-id="button"]');
|
|
121
|
+
|
|
122
|
+
/** A locator to the child item container */
|
|
123
|
+
readonly childItemContainer = this.getLocator(
|
|
124
|
+
'//*[@data-test-id="child-item-container"]',
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Expands child items in navigation group
|
|
129
|
+
* Does nothing in case group already expanded
|
|
130
|
+
*/
|
|
131
|
+
async expand(): Promise<void> {
|
|
132
|
+
if (await this.childItemContainer.isVisible()) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
await this.expandButton.click();
|
|
136
|
+
await this.childItemContainer.waitFor({ state: 'visible' });
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Collapses child item container in navigation group
|
|
141
|
+
* Does nothing in case group already collapsed
|
|
142
|
+
*/
|
|
143
|
+
async collapse(): Promise<void> {
|
|
144
|
+
if (!(await this.childItemContainer.isVisible())) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
await this.expandButton.click();
|
|
148
|
+
await this.childItemContainer.waitFor({ state: 'hidden' });
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Gets navigation item by position in navigation group.
|
|
153
|
+
* @param position 1-based index. Negative numbers count from the end.
|
|
154
|
+
*/
|
|
155
|
+
getNavItem(position: number): Locator {
|
|
156
|
+
return this.getLocator('//*[@data-test-id="nav-item-label"]', position);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Gets navigation item by matching data-test-id attribute
|
|
161
|
+
* @param id Value of navigation items data-test-id attribute
|
|
162
|
+
* @param nth 1-based index. Specifies which match to return in case multiple items match `data-test-id`, defaults to 1
|
|
163
|
+
*/
|
|
164
|
+
getNavItemById(id: string, nth = 1): Locator {
|
|
165
|
+
return this.getLocator(`//a[.//*[@data-test-id="${id}"]]`, nth);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Gets navigation item by matching label text in the navigation group
|
|
170
|
+
* @param label Navigation item label text
|
|
171
|
+
* @param nth 1-based index. Specifies which match to return in case multiple items match `label`, defaults to 1
|
|
172
|
+
*/
|
|
173
|
+
getNavItemByLabel(label: string, nth = 1): Locator {
|
|
174
|
+
return this.getLocator(
|
|
175
|
+
`//a[.//*[@data-test-id="nav-item-label" and text()="${label}"]]`,
|
|
176
|
+
nth,
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
} from '@axinom/mosaic-e2e-ui-selectors';
|
|
8
8
|
import { Page } from 'playwright-core';
|
|
9
9
|
import { Breadcrumbs } from './breadcrumbs';
|
|
10
|
+
import { NavigationPanel } from './navigation-panel';
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* A model representing the Mosaic UI including methods for navigation.
|
|
@@ -39,6 +40,9 @@ export class UiShellModel {
|
|
|
39
40
|
/** A model for the settings pages navigation hub. */
|
|
40
41
|
readonly settingsPageHub = new Hub(this.page);
|
|
41
42
|
|
|
43
|
+
/** A model for navigation panel */
|
|
44
|
+
readonly navigationPanel = new NavigationPanel(this.page);
|
|
45
|
+
|
|
42
46
|
/**
|
|
43
47
|
* This method navigates to the landing page breadcrumb.
|
|
44
48
|
* The management system must be loaded & signed in before using this method.
|
|
@@ -116,6 +120,8 @@ export class UiShellModel {
|
|
|
116
120
|
* This method navigates to a settings page tile by label.
|
|
117
121
|
* The management system must be loaded & signed in before using this method.
|
|
118
122
|
*
|
|
123
|
+
* @deprecated Please use `goToNavigationPanelSettingsItem` instead
|
|
124
|
+
*
|
|
119
125
|
* The following steps will be taken:
|
|
120
126
|
* - Navigate to the home breadcrumb (if not already on the landing page)
|
|
121
127
|
* - Navigate to the 'Settings' tile
|
|
@@ -126,18 +132,107 @@ export class UiShellModel {
|
|
|
126
132
|
groupLabel: string,
|
|
127
133
|
tileLabel: string,
|
|
128
134
|
): Promise<void> {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
135
|
+
this.goToNavigationPanelSettingsItem(tileLabel, groupLabel);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Navigates to specified Settings page item using navigation panel
|
|
140
|
+
* The management system must be loaded & signed in before using this method.
|
|
141
|
+
*
|
|
142
|
+
* The following steps will be taken:
|
|
143
|
+
* - Navigate to the home breadcrumb (if not already on the landing page)
|
|
144
|
+
* - Navigate to the Settings category
|
|
145
|
+
* - In case `groupLabel` is provided navigate to the navigation item group by group label and expand the it
|
|
146
|
+
* - Navigate to the navigation item by item label
|
|
147
|
+
* - Wait for a page transition to complete
|
|
148
|
+
* @param itemLabel Navigation item label
|
|
149
|
+
* @param groupLabel Label of navigation item group in Settings category, that needs to be expanded
|
|
150
|
+
*/
|
|
151
|
+
async goToNavigationPanelSettingsItem(
|
|
152
|
+
itemLabel: string,
|
|
153
|
+
groupLabel?: string,
|
|
154
|
+
): Promise<void> {
|
|
155
|
+
await this.goToNavigationPanelItem('Settings', itemLabel, groupLabel);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Navigates to the specified navigation panel page using Navigation Panel item text
|
|
160
|
+
* The management system must be loaded & signed in before using this method.
|
|
161
|
+
*
|
|
162
|
+
* The following steps will be taken:
|
|
163
|
+
* - Expand the menu (if not on a home view where the navigation panel is already visible)
|
|
164
|
+
* - Navigate to the navigation category by category label
|
|
165
|
+
* - In case `groupLabel` is provided Navigate to the navigation item group by group label and expand the group
|
|
166
|
+
* - Navigate to the navigation item by item label
|
|
167
|
+
* - Wait for a page transition to complete
|
|
168
|
+
* @param categoryLabel Navigation category label
|
|
169
|
+
* @param itemLabel Label of navigation item
|
|
170
|
+
* @param groupLabel Label of navigation item group in category, that needs to be expanded
|
|
171
|
+
*/
|
|
172
|
+
async goToNavigationPanelItem(
|
|
173
|
+
categoryLabel: string,
|
|
174
|
+
itemLabel: string,
|
|
175
|
+
groupLabel?: string,
|
|
176
|
+
): Promise<void> {
|
|
177
|
+
const category = this.navigationPanel.getCategoryByLabel(categoryLabel);
|
|
178
|
+
let item;
|
|
179
|
+
|
|
180
|
+
await this.expandNavigationPanel();
|
|
181
|
+
|
|
182
|
+
if (groupLabel) {
|
|
183
|
+
const group = category.getNavigationItemGroupByLabel(groupLabel);
|
|
184
|
+
try {
|
|
185
|
+
await group.expand();
|
|
186
|
+
} catch {
|
|
187
|
+
throw new Error(
|
|
188
|
+
`Navigation panel item '${categoryLabel}>${groupLabel}>${itemLabel}' is not visible. Is the label(s) correct? Is the service enabled for this environment?`,
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
item = group.getNavItemByLabel(itemLabel);
|
|
192
|
+
} else {
|
|
193
|
+
item = category.getNavigationItemByLabel(itemLabel);
|
|
139
194
|
}
|
|
140
|
-
|
|
195
|
+
|
|
196
|
+
await this.waitForPageTransition(item.click());
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Navigates to the specified navigation panel page using HTML element attribute `data-test-id`
|
|
201
|
+
* The management system must be loaded & signed in before using this method.
|
|
202
|
+
*
|
|
203
|
+
* The following steps will be taken:
|
|
204
|
+
* - Expand the menu (if not on a home view where the navigation panel is already visible)
|
|
205
|
+
* - Navigate to the navigation category by category label
|
|
206
|
+
* - In case `groupLabel` is provided Navigate to the navigation item group by group label and expand the group
|
|
207
|
+
* - Navigate to the navigation item by item label
|
|
208
|
+
* - Wait for a page transition to complete
|
|
209
|
+
* @param itemTestId data-test-id attribute of navigation item
|
|
210
|
+
* @param groupTestId data-test-id attribute of navigation item group
|
|
211
|
+
*/
|
|
212
|
+
async goToNavigationPanelItemByTestIds(
|
|
213
|
+
itemTestId: string,
|
|
214
|
+
groupTestId?: string,
|
|
215
|
+
): Promise<void> {
|
|
216
|
+
let item;
|
|
217
|
+
|
|
218
|
+
await this.expandNavigationPanel();
|
|
219
|
+
|
|
220
|
+
if (groupTestId) {
|
|
221
|
+
const group =
|
|
222
|
+
this.navigationPanel.getNavigationItemGroupById(groupTestId);
|
|
223
|
+
try {
|
|
224
|
+
await group.expand();
|
|
225
|
+
} catch {
|
|
226
|
+
throw new Error(
|
|
227
|
+
`Navigation panel item '${groupTestId}>${itemTestId}' is not visible. Is the label(s) correct? Is the service enabled for this environment?`,
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
item = group.getNavItemById(itemTestId);
|
|
231
|
+
} else {
|
|
232
|
+
item = this.navigationPanel.getNavigationItemById(itemTestId);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
await this.waitForPageTransition(item.click());
|
|
141
236
|
}
|
|
142
237
|
|
|
143
238
|
/**
|
|
@@ -174,4 +269,16 @@ export class UiShellModel {
|
|
|
174
269
|
await Promise.all([firstPromise, promise]);
|
|
175
270
|
};
|
|
176
271
|
}
|
|
272
|
+
|
|
273
|
+
private async expandNavigationPanel(): Promise<void> {
|
|
274
|
+
const expandMenuButton = this.page.locator(
|
|
275
|
+
`//*[@data-test-id="hamburger-menu-button"]`,
|
|
276
|
+
);
|
|
277
|
+
|
|
278
|
+
// If expand menu button visible (not on a home view), expand the menu
|
|
279
|
+
if (await expandMenuButton.isEnabled()) {
|
|
280
|
+
expandMenuButton.click();
|
|
281
|
+
await this.navigationPanel.panel.waitFor({ state: 'visible' });
|
|
282
|
+
}
|
|
283
|
+
}
|
|
177
284
|
}
|