@axinom/mosaic-e2e-page-model 0.17.12 → 0.17.13-rc.3
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/cjs/index.d.ts +6 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/{index.js → cjs/index.js} +5 -5
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/managed-services/image-service/image-selection-explorer.d.ts.map +1 -0
- package/dist/cjs/managed-services/image-service/image-selection-explorer.js.map +1 -0
- package/dist/{managed-services → cjs/managed-services}/image-service/image-service.d.ts +17 -2
- package/dist/cjs/managed-services/image-service/image-service.d.ts.map +1 -0
- package/dist/{managed-services → cjs/managed-services}/image-service/image-service.js +30 -5
- package/dist/cjs/managed-services/image-service/image-service.js.map +1 -0
- package/dist/cjs/managed-services/image-service/index.d.ts +3 -0
- package/dist/cjs/managed-services/image-service/index.d.ts.map +1 -0
- package/dist/{ui-selectors → cjs/managed-services/image-service}/index.js +2 -2
- package/dist/cjs/managed-services/image-service/index.js.map +1 -0
- package/dist/cjs/managed-services/index.d.ts +3 -0
- package/dist/cjs/managed-services/index.d.ts.map +1 -0
- package/dist/{managed-services/image-service → cjs/managed-services}/index.js +2 -2
- package/dist/cjs/managed-services/index.js.map +1 -0
- package/dist/{managed-services → cjs/managed-services}/managed-service-model.d.ts +2 -2
- package/dist/cjs/managed-services/managed-service-model.d.ts.map +1 -0
- package/dist/cjs/managed-services/managed-service-model.js.map +1 -0
- package/dist/{managed-services → cjs/managed-services}/video-service.d.ts +1 -1
- package/dist/cjs/managed-services/video-service.d.ts.map +1 -0
- package/dist/{managed-services → cjs/managed-services}/video-service.js +8 -9
- package/dist/cjs/managed-services/video-service.js.map +1 -0
- package/dist/cjs/package.json +1 -0
- package/dist/{page-model.d.ts → cjs/page-model.d.ts} +4 -4
- package/dist/cjs/page-model.d.ts.map +1 -0
- package/dist/{page-model.js → cjs/page-model.js} +8 -8
- package/dist/cjs/page-model.js.map +1 -0
- package/dist/{service-model.d.ts → cjs/service-model.d.ts} +2 -2
- package/dist/cjs/service-model.d.ts.map +1 -0
- package/dist/cjs/service-model.js.map +1 -0
- package/dist/cjs/sign-in/index.d.ts +5 -0
- package/dist/cjs/sign-in/index.d.ts.map +1 -0
- package/dist/{sign-in → cjs/sign-in}/index.js +4 -4
- package/dist/cjs/sign-in/index.js.map +1 -0
- package/dist/{sign-in → cjs/sign-in}/sign-in-page.d.ts +4 -4
- package/dist/cjs/sign-in/sign-in-page.d.ts.map +1 -0
- package/dist/{sign-in → cjs/sign-in}/sign-in-page.js +6 -6
- package/dist/cjs/sign-in/sign-in-page.js.map +1 -0
- package/dist/{sign-in → cjs/sign-in}/sign-in-with-ax-auth-form.d.ts +1 -1
- package/dist/cjs/sign-in/sign-in-with-ax-auth-form.d.ts.map +1 -0
- package/dist/cjs/sign-in/sign-in-with-ax-auth-form.js.map +1 -0
- package/dist/{sign-in → cjs/sign-in}/sign-in-with-google-form.d.ts +1 -1
- package/dist/cjs/sign-in/sign-in-with-google-form.d.ts.map +1 -0
- package/dist/cjs/sign-in/sign-in-with-google-form.js.map +1 -0
- package/dist/{sign-in → cjs/sign-in}/sign-in-with-microsoft-form.d.ts +1 -1
- package/dist/cjs/sign-in/sign-in-with-microsoft-form.d.ts.map +1 -0
- package/dist/cjs/sign-in/sign-in-with-microsoft-form.js.map +1 -0
- package/dist/{ui-selectors → cjs/ui-selectors}/breadcrumbs.d.ts +1 -1
- package/dist/cjs/ui-selectors/breadcrumbs.d.ts.map +1 -0
- package/dist/cjs/ui-selectors/breadcrumbs.js.map +1 -0
- package/dist/cjs/ui-selectors/index.d.ts +3 -0
- package/dist/cjs/ui-selectors/index.d.ts.map +1 -0
- package/dist/{managed-services → cjs/ui-selectors}/index.js +2 -2
- package/dist/cjs/ui-selectors/index.js.map +1 -0
- package/dist/{ui-selectors → cjs/ui-selectors}/navigation-panel.d.ts +1 -1
- package/dist/cjs/ui-selectors/navigation-panel.d.ts.map +1 -0
- package/dist/cjs/ui-selectors/navigation-panel.js.map +1 -0
- package/dist/{ui-selectors → cjs/ui-selectors}/toast-notifications.d.ts +1 -1
- package/dist/cjs/ui-selectors/toast-notifications.d.ts.map +1 -0
- package/dist/cjs/ui-selectors/toast-notifications.js.map +1 -0
- package/dist/{ui-selectors → cjs/ui-selectors}/ui-shell-model.d.ts +4 -4
- package/dist/cjs/ui-selectors/ui-shell-model.d.ts.map +1 -0
- package/dist/{ui-selectors → cjs/ui-selectors}/ui-shell-model.js +10 -10
- package/dist/cjs/ui-selectors/ui-shell-model.js.map +1 -0
- package/dist/esm/index.d.ts +6 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +6 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/managed-services/image-service/image-selection-explorer.d.ts +16 -0
- package/dist/esm/managed-services/image-service/image-selection-explorer.d.ts.map +1 -0
- package/dist/esm/managed-services/image-service/image-selection-explorer.js +38 -0
- package/dist/esm/managed-services/image-service/image-selection-explorer.js.map +1 -0
- package/dist/esm/managed-services/image-service/image-service.d.ts +80 -0
- package/dist/esm/managed-services/image-service/image-service.d.ts.map +1 -0
- package/dist/esm/managed-services/image-service/image-service.js +138 -0
- package/dist/esm/managed-services/image-service/image-service.js.map +1 -0
- package/dist/esm/managed-services/image-service/index.d.ts +3 -0
- package/dist/esm/managed-services/image-service/index.d.ts.map +1 -0
- package/dist/esm/managed-services/image-service/index.js +3 -0
- package/dist/esm/managed-services/image-service/index.js.map +1 -0
- package/dist/esm/managed-services/index.d.ts +3 -0
- package/dist/esm/managed-services/index.d.ts.map +1 -0
- package/dist/esm/managed-services/index.js +3 -0
- package/dist/esm/managed-services/index.js.map +1 -0
- package/dist/esm/managed-services/managed-service-model.d.ts +46 -0
- package/dist/esm/managed-services/managed-service-model.d.ts.map +1 -0
- package/dist/esm/managed-services/managed-service-model.js +32 -0
- package/dist/esm/managed-services/managed-service-model.js.map +1 -0
- package/dist/esm/managed-services/video-service.d.ts +107 -0
- package/dist/esm/managed-services/video-service.d.ts.map +1 -0
- package/dist/esm/managed-services/video-service.js +215 -0
- package/dist/esm/managed-services/video-service.js.map +1 -0
- package/dist/esm/package.json +1 -0
- package/dist/esm/page-model.d.ts +65 -0
- package/dist/esm/page-model.d.ts.map +1 -0
- package/dist/esm/page-model.js +100 -0
- package/dist/esm/page-model.js.map +1 -0
- package/dist/esm/service-model.d.ts +43 -0
- package/dist/esm/service-model.d.ts.map +1 -0
- package/dist/esm/service-model.js +30 -0
- package/dist/esm/service-model.js.map +1 -0
- package/dist/esm/sign-in/index.d.ts +5 -0
- package/dist/esm/sign-in/index.d.ts.map +1 -0
- package/dist/esm/sign-in/index.js +5 -0
- package/dist/esm/sign-in/index.js.map +1 -0
- package/dist/esm/sign-in/sign-in-page.d.ts +32 -0
- package/dist/esm/sign-in/sign-in-page.d.ts.map +1 -0
- package/dist/esm/sign-in/sign-in-page.js +32 -0
- package/dist/esm/sign-in/sign-in-page.js.map +1 -0
- package/dist/esm/sign-in/sign-in-with-ax-auth-form.d.ts +24 -0
- package/dist/esm/sign-in/sign-in-with-ax-auth-form.d.ts.map +1 -0
- package/dist/esm/sign-in/sign-in-with-ax-auth-form.js +58 -0
- package/dist/esm/sign-in/sign-in-with-ax-auth-form.js.map +1 -0
- package/dist/esm/sign-in/sign-in-with-google-form.d.ts +23 -0
- package/dist/esm/sign-in/sign-in-with-google-form.d.ts.map +1 -0
- package/dist/esm/sign-in/sign-in-with-google-form.js +48 -0
- package/dist/esm/sign-in/sign-in-with-google-form.js.map +1 -0
- package/dist/esm/sign-in/sign-in-with-microsoft-form.d.ts +24 -0
- package/dist/esm/sign-in/sign-in-with-microsoft-form.d.ts.map +1 -0
- package/dist/esm/sign-in/sign-in-with-microsoft-form.js +55 -0
- package/dist/esm/sign-in/sign-in-with-microsoft-form.js.map +1 -0
- package/dist/esm/ui-selectors/breadcrumbs.d.ts +24 -0
- package/dist/esm/ui-selectors/breadcrumbs.d.ts.map +1 -0
- package/dist/esm/ui-selectors/breadcrumbs.js +37 -0
- package/dist/esm/ui-selectors/breadcrumbs.js.map +1 -0
- package/dist/esm/ui-selectors/index.d.ts +3 -0
- package/dist/esm/ui-selectors/index.d.ts.map +1 -0
- package/dist/esm/ui-selectors/index.js +3 -0
- package/dist/esm/ui-selectors/index.js.map +1 -0
- package/dist/esm/ui-selectors/navigation-panel.d.ts +91 -0
- package/dist/esm/ui-selectors/navigation-panel.d.ts.map +1 -0
- package/dist/esm/ui-selectors/navigation-panel.js +132 -0
- package/dist/esm/ui-selectors/navigation-panel.js.map +1 -0
- package/dist/esm/ui-selectors/toast-notifications.d.ts +48 -0
- package/dist/esm/ui-selectors/toast-notifications.d.ts.map +1 -0
- package/dist/esm/ui-selectors/toast-notifications.js +64 -0
- package/dist/esm/ui-selectors/toast-notifications.js.map +1 -0
- package/dist/esm/ui-selectors/ui-shell-model.d.ts +158 -0
- package/dist/esm/ui-selectors/ui-shell-model.d.ts.map +1 -0
- package/dist/esm/ui-selectors/ui-shell-model.js +265 -0
- package/dist/esm/ui-selectors/ui-shell-model.js.map +1 -0
- package/package.json +19 -8
- package/src/index.ts +5 -5
- package/src/managed-services/image-service/image-service.ts +32 -2
- package/src/managed-services/image-service/index.ts +2 -2
- package/src/managed-services/index.ts +2 -2
- package/src/managed-services/managed-service-model.ts +2 -2
- package/src/managed-services/video-service.ts +1 -1
- package/src/page-model.ts +4 -4
- package/src/service-model.ts +2 -2
- package/src/sign-in/index.ts +4 -4
- package/src/sign-in/sign-in-page.ts +4 -4
- package/src/sign-in/sign-in-with-ax-auth-form.ts +1 -1
- package/src/sign-in/sign-in-with-google-form.ts +1 -1
- package/src/sign-in/sign-in-with-microsoft-form.ts +1 -1
- package/src/ui-selectors/breadcrumbs.ts +1 -1
- package/src/ui-selectors/index.ts +2 -2
- package/src/ui-selectors/navigation-panel.ts +1 -1
- package/src/ui-selectors/toast-notifications.ts +1 -1
- package/src/ui-selectors/ui-shell-model.ts +4 -4
- package/dist/index.d.ts +0 -6
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/managed-services/image-service/image-selection-explorer.d.ts.map +0 -1
- package/dist/managed-services/image-service/image-selection-explorer.js.map +0 -1
- package/dist/managed-services/image-service/image-service.d.ts.map +0 -1
- package/dist/managed-services/image-service/image-service.js.map +0 -1
- package/dist/managed-services/image-service/index.d.ts +0 -3
- package/dist/managed-services/image-service/index.d.ts.map +0 -1
- package/dist/managed-services/image-service/index.js.map +0 -1
- package/dist/managed-services/index.d.ts +0 -3
- package/dist/managed-services/index.d.ts.map +0 -1
- package/dist/managed-services/index.js.map +0 -1
- package/dist/managed-services/managed-service-model.d.ts.map +0 -1
- package/dist/managed-services/managed-service-model.js.map +0 -1
- package/dist/managed-services/video-service.d.ts.map +0 -1
- package/dist/managed-services/video-service.js.map +0 -1
- package/dist/page-model.d.ts.map +0 -1
- package/dist/page-model.js.map +0 -1
- package/dist/service-model.d.ts.map +0 -1
- package/dist/service-model.js.map +0 -1
- package/dist/sign-in/index.d.ts +0 -5
- package/dist/sign-in/index.d.ts.map +0 -1
- package/dist/sign-in/index.js.map +0 -1
- package/dist/sign-in/sign-in-page.d.ts.map +0 -1
- package/dist/sign-in/sign-in-page.js.map +0 -1
- package/dist/sign-in/sign-in-with-ax-auth-form.d.ts.map +0 -1
- package/dist/sign-in/sign-in-with-ax-auth-form.js.map +0 -1
- package/dist/sign-in/sign-in-with-google-form.d.ts.map +0 -1
- package/dist/sign-in/sign-in-with-google-form.js.map +0 -1
- package/dist/sign-in/sign-in-with-microsoft-form.d.ts.map +0 -1
- package/dist/sign-in/sign-in-with-microsoft-form.js.map +0 -1
- package/dist/ui-selectors/breadcrumbs.d.ts.map +0 -1
- package/dist/ui-selectors/breadcrumbs.js.map +0 -1
- package/dist/ui-selectors/index.d.ts +0 -3
- package/dist/ui-selectors/index.d.ts.map +0 -1
- package/dist/ui-selectors/index.js.map +0 -1
- package/dist/ui-selectors/navigation-panel.d.ts.map +0 -1
- package/dist/ui-selectors/navigation-panel.js.map +0 -1
- package/dist/ui-selectors/toast-notifications.d.ts.map +0 -1
- package/dist/ui-selectors/toast-notifications.js.map +0 -1
- package/dist/ui-selectors/ui-shell-model.d.ts.map +0 -1
- package/dist/ui-selectors/ui-shell-model.js.map +0 -1
- /package/dist/{managed-services → cjs/managed-services}/image-service/image-selection-explorer.d.ts +0 -0
- /package/dist/{managed-services → cjs/managed-services}/image-service/image-selection-explorer.js +0 -0
- /package/dist/{managed-services → cjs/managed-services}/managed-service-model.js +0 -0
- /package/dist/{service-model.js → cjs/service-model.js} +0 -0
- /package/dist/{sign-in → cjs/sign-in}/sign-in-with-ax-auth-form.js +0 -0
- /package/dist/{sign-in → cjs/sign-in}/sign-in-with-google-form.js +0 -0
- /package/dist/{sign-in → cjs/sign-in}/sign-in-with-microsoft-form.js +0 -0
- /package/dist/{ui-selectors → cjs/ui-selectors}/breadcrumbs.js +0 -0
- /package/dist/{ui-selectors → cjs/ui-selectors}/navigation-panel.js +0 -0
- /package/dist/{ui-selectors → cjs/ui-selectors}/toast-notifications.js +0 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ComponentModel } from '@axinom/mosaic-e2e-ui-selectors';
|
|
2
|
+
import { type FrameLocator, type Locator, type Page } from '@playwright/test';
|
|
3
|
+
/**
|
|
4
|
+
* A model for a toast notifications
|
|
5
|
+
* with methods to get individual toast messages.
|
|
6
|
+
*/
|
|
7
|
+
export declare class Notifications extends ComponentModel {
|
|
8
|
+
/**
|
|
9
|
+
* A model for the toast notifications.
|
|
10
|
+
* @param parent The parent playwright page, frame or component model.
|
|
11
|
+
* @param xpath A relative xpath selector to this element from the parent.
|
|
12
|
+
*/
|
|
13
|
+
constructor(parent: Page | FrameLocator, xpath?: string);
|
|
14
|
+
/**
|
|
15
|
+
* This method gets a visible notification by position.
|
|
16
|
+
* Position 1 is the first notification.
|
|
17
|
+
* Negative numbers count from the end.
|
|
18
|
+
* @param position The position of the notification.
|
|
19
|
+
* @returns A model for the notification.
|
|
20
|
+
*/
|
|
21
|
+
getNotification(position?: number): Notification;
|
|
22
|
+
/**
|
|
23
|
+
* This method gets a visible notification by title.
|
|
24
|
+
* @param title A title of the notification.
|
|
25
|
+
* @returns A model for the notification.
|
|
26
|
+
*/
|
|
27
|
+
getNotificationByTitle(title: string): Notification;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A model for individual toast notification message
|
|
31
|
+
*/
|
|
32
|
+
export declare class Notification extends ComponentModel {
|
|
33
|
+
message: Locator;
|
|
34
|
+
/**
|
|
35
|
+
* @returns A locator to the notification message title.
|
|
36
|
+
*/
|
|
37
|
+
getNotificationTitle(): Locator;
|
|
38
|
+
/**
|
|
39
|
+
* @returns A locator to the notification message body.
|
|
40
|
+
*/
|
|
41
|
+
getNotificationBody(): Locator;
|
|
42
|
+
/**
|
|
43
|
+
* This method closes the notification.
|
|
44
|
+
* @returns a promise that resolves when the notification is removed from the DOM.
|
|
45
|
+
*/
|
|
46
|
+
closeToast(): Promise<void>;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=toast-notifications.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast-notifications.d.ts","sourceRoot":"","sources":["../../../src/ui-selectors/toast-notifications.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE9E;;;GAGG;AACH,qBAAa,aAAc,SAAQ,cAAc;IAC/C;;;;OAIG;gBAED,MAAM,EAAE,IAAI,GAAG,YAAY,EAC3B,KAAK,SAA4C;IAKnD;;;;;;OAMG;IACH,eAAe,CAAC,QAAQ,SAAI,GAAG,YAAY;IAI3C;;;;OAIG;IACH,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY;CAMpD;AAED;;GAEG;AACH,qBAAa,YAAa,SAAQ,cAAc;IAC9C,OAAO,EAAE,OAAO,CAAuB;IAEvC;;OAEG;IACH,oBAAoB,IAAI,OAAO;IAI/B;;OAEG;IACH,mBAAmB,IAAI,OAAO;IAI9B;;;OAGG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CAIlC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { ComponentModel } from '@axinom/mosaic-e2e-ui-selectors';
|
|
2
|
+
import {} from '@playwright/test';
|
|
3
|
+
/**
|
|
4
|
+
* A model for a toast notifications
|
|
5
|
+
* with methods to get individual toast messages.
|
|
6
|
+
*/
|
|
7
|
+
export class Notifications extends ComponentModel {
|
|
8
|
+
/**
|
|
9
|
+
* A model for the toast notifications.
|
|
10
|
+
* @param parent The parent playwright page, frame or component model.
|
|
11
|
+
* @param xpath A relative xpath selector to this element from the parent.
|
|
12
|
+
*/
|
|
13
|
+
constructor(parent, xpath = '//*[@data-test-id="toast-notification"]') {
|
|
14
|
+
super(parent, xpath);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* This method gets a visible notification by position.
|
|
18
|
+
* Position 1 is the first notification.
|
|
19
|
+
* Negative numbers count from the end.
|
|
20
|
+
* @param position The position of the notification.
|
|
21
|
+
* @returns A model for the notification.
|
|
22
|
+
*/
|
|
23
|
+
getNotification(position = 1) {
|
|
24
|
+
return new Notification(this, ``, position);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* This method gets a visible notification by title.
|
|
28
|
+
* @param title A title of the notification.
|
|
29
|
+
* @returns A model for the notification.
|
|
30
|
+
*/
|
|
31
|
+
getNotificationByTitle(title) {
|
|
32
|
+
return new Notification(this, `[.//*[@data-test-id="toast-title" and text()="${title}"]]`);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* A model for individual toast notification message
|
|
37
|
+
*/
|
|
38
|
+
export class Notification extends ComponentModel {
|
|
39
|
+
constructor() {
|
|
40
|
+
super(...arguments);
|
|
41
|
+
this.message = this.getLocator(``);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* @returns A locator to the notification message title.
|
|
45
|
+
*/
|
|
46
|
+
getNotificationTitle() {
|
|
47
|
+
return this.getLocator(`//*[@data-test-id="toast-title"]`);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* @returns A locator to the notification message body.
|
|
51
|
+
*/
|
|
52
|
+
getNotificationBody() {
|
|
53
|
+
return this.getLocator(`//*[@data-test-id="toast-body"]`);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* This method closes the notification.
|
|
57
|
+
* @returns a promise that resolves when the notification is removed from the DOM.
|
|
58
|
+
*/
|
|
59
|
+
async closeToast() {
|
|
60
|
+
await this.getLocator(`//*[@data-test-id="toast-close"]`).click();
|
|
61
|
+
return this.message.waitFor({ state: 'detached' });
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=toast-notifications.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast-notifications.js","sourceRoot":"","sources":["../../../src/ui-selectors/toast-notifications.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAA8C,MAAM,kBAAkB,CAAC;AAE9E;;;GAGG;AACH,MAAM,OAAO,aAAc,SAAQ,cAAc;IAC/C;;;;OAIG;IACH,YACE,MAA2B,EAC3B,KAAK,GAAG,yCAAyC;QAEjD,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACvB,CAAC;IAED;;;;;;OAMG;IACH,eAAe,CAAC,QAAQ,GAAG,CAAC;QAC1B,OAAO,IAAI,YAAY,CAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,CAAC,CAAC;IAC9C,CAAC;IAED;;;;OAIG;IACH,sBAAsB,CAAC,KAAa;QAClC,OAAO,IAAI,YAAY,CACrB,IAAI,EACJ,iDAAiD,KAAK,KAAK,CAC5D,CAAC;IACJ,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,cAAc;IAAhD;;QACE,YAAO,GAAY,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IAwBzC,CAAC;IAtBC;;OAEG;IACH,oBAAoB;QAClB,OAAO,IAAI,CAAC,UAAU,CAAC,kCAAkC,CAAC,CAAC;IAC7D,CAAC;IAED;;OAEG;IACH,mBAAmB;QACjB,OAAO,IAAI,CAAC,UAAU,CAAC,iCAAiC,CAAC,CAAC;IAC5D,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,UAAU;QACd,MAAM,IAAI,CAAC,UAAU,CAAC,kCAAkC,CAAC,CAAC,KAAK,EAAE,CAAC;QAClE,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;IACrD,CAAC;CACF"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { Hub, LandingPageHeader, LandingPageTiles, PageHeader } from '@axinom/mosaic-e2e-ui-selectors';
|
|
2
|
+
import { type Page } from '@playwright/test';
|
|
3
|
+
import { Breadcrumbs } from './breadcrumbs.js';
|
|
4
|
+
import { NavigationPanel } from './navigation-panel.js';
|
|
5
|
+
import { Notifications } from './toast-notifications.js';
|
|
6
|
+
/**
|
|
7
|
+
* A model representing the Mosaic UI including methods for navigation.
|
|
8
|
+
* This model should be used for page and UI components which are provided by Mosaic as a service.
|
|
9
|
+
*
|
|
10
|
+
* Use this model to interact with:
|
|
11
|
+
* - The breadcrumbs bar (on any page)
|
|
12
|
+
* - The landing page
|
|
13
|
+
* - The settings hub page
|
|
14
|
+
* - Pages, settings or mod*a*ls of any managed service (Image, Video, etc)
|
|
15
|
+
*/
|
|
16
|
+
export declare class UiShellModel {
|
|
17
|
+
/** The playwright page object. */
|
|
18
|
+
protected readonly page: Page;
|
|
19
|
+
constructor(
|
|
20
|
+
/** The playwright page object. */
|
|
21
|
+
page: Page);
|
|
22
|
+
/** A model for the breadcrumbs bar. */
|
|
23
|
+
readonly breadcrumbs: Breadcrumbs;
|
|
24
|
+
/** A model for the header on the landing page. */
|
|
25
|
+
readonly landingPageHeader: LandingPageHeader;
|
|
26
|
+
/** A model for the landing page tiles. */
|
|
27
|
+
readonly landingPageTiles: LandingPageTiles;
|
|
28
|
+
/** A model for the settings page header. */
|
|
29
|
+
readonly settingsPageHeader: PageHeader;
|
|
30
|
+
/** A model for the settings pages navigation hub. */
|
|
31
|
+
readonly settingsPageHub: Hub;
|
|
32
|
+
/** A model for navigation panel */
|
|
33
|
+
readonly navigationPanel: NavigationPanel;
|
|
34
|
+
/** A model for toast notifications */
|
|
35
|
+
readonly notifications: Notifications;
|
|
36
|
+
/**
|
|
37
|
+
* This method navigates to the landing page breadcrumb.
|
|
38
|
+
* The management system must be loaded & signed in before using this method.
|
|
39
|
+
*
|
|
40
|
+
* The following steps will be taken:
|
|
41
|
+
* - Click the first (home) breadcrumb
|
|
42
|
+
* - Wait for a page transition to complete
|
|
43
|
+
*/
|
|
44
|
+
navigateToBreadcrumbHome(): Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* This method navigates to the 'previous' breadcrumb.
|
|
47
|
+
* The management system must be loaded & signed in before using this method.
|
|
48
|
+
*
|
|
49
|
+
* The following steps will be taken:
|
|
50
|
+
* - Click the last-but-one breadcrumb
|
|
51
|
+
* - Wait for a page transition to complete
|
|
52
|
+
*/
|
|
53
|
+
navigateToBreadcrumbPrevious(): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* This method navigates to the 'refresh' breadcrumb.
|
|
56
|
+
* The management system must be loaded & signed in before using this method.
|
|
57
|
+
*
|
|
58
|
+
* The following steps will be taken:
|
|
59
|
+
* - Click the last breadcrumb
|
|
60
|
+
* - Wait for a page transition to complete
|
|
61
|
+
*/
|
|
62
|
+
navigateToBreadcrumbRefresh(): Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* This method navigates to a landing page tile by label.
|
|
65
|
+
* The management system must be loaded & signed in before using this method.
|
|
66
|
+
*
|
|
67
|
+
* The following steps will be taken:
|
|
68
|
+
* - Navigate to the home breadcrumb (if not already on the landing page)
|
|
69
|
+
* - Navigate to a tile by label
|
|
70
|
+
* - Wait for a page transition to complete
|
|
71
|
+
*/
|
|
72
|
+
navigateToLandingPageTile(label: string): Promise<void>;
|
|
73
|
+
/**
|
|
74
|
+
* This method navigates to a settings page tile by label.
|
|
75
|
+
* The management system must be loaded & signed in before using this method.
|
|
76
|
+
*
|
|
77
|
+
* @deprecated Please use `goToNavigationPanelSettingsItem` instead
|
|
78
|
+
*
|
|
79
|
+
* The following steps will be taken:
|
|
80
|
+
* - Navigate to the home breadcrumb (if not already on the landing page)
|
|
81
|
+
* - Navigate to the 'Settings' tile
|
|
82
|
+
* - Navigate to a tile by group label and tile label
|
|
83
|
+
* - Wait for a page transition to complete
|
|
84
|
+
*/
|
|
85
|
+
navigateToSettingsTile(groupLabel: string, tileLabel: string): Promise<void>;
|
|
86
|
+
/**
|
|
87
|
+
* Navigates to specified Settings page item using navigation panel
|
|
88
|
+
* The management system must be loaded & signed in before using this method.
|
|
89
|
+
*
|
|
90
|
+
* The following steps will be taken:
|
|
91
|
+
* - Navigate to the home breadcrumb (if not already on the landing page)
|
|
92
|
+
* - Navigate to the Settings category
|
|
93
|
+
* - In case `groupLabel` is provided navigate to the navigation item group by group label and expand the it
|
|
94
|
+
* - Navigate to the navigation item by item label
|
|
95
|
+
* - Wait for a page transition to complete
|
|
96
|
+
* @param itemLabel Navigation item label
|
|
97
|
+
* @param groupLabel Label of navigation item group in Settings category, that needs to be expanded
|
|
98
|
+
*/
|
|
99
|
+
goToNavigationPanelSettingsItem(itemLabel: string, groupLabel?: string): Promise<void>;
|
|
100
|
+
/**
|
|
101
|
+
* Navigates to the specified navigation panel page using Navigation Panel item text
|
|
102
|
+
* The management system must be loaded & signed in before using this method.
|
|
103
|
+
*
|
|
104
|
+
* The following steps will be taken:
|
|
105
|
+
* - Expand the menu (if not on a home view where the navigation panel is already visible)
|
|
106
|
+
* - Navigate to the navigation category by category label
|
|
107
|
+
* - In case `groupLabel` is provided Navigate to the navigation item group by group label and expand the group
|
|
108
|
+
* - Navigate to the navigation item by item label
|
|
109
|
+
* - Wait for a page transition to complete
|
|
110
|
+
* @param categoryLabel Navigation category label
|
|
111
|
+
* @param itemLabel Label of navigation item
|
|
112
|
+
* @param groupLabel Label of navigation item group in category, that needs to be expanded
|
|
113
|
+
*/
|
|
114
|
+
goToNavigationPanelItem(categoryLabel: string, itemLabel: string, groupLabel?: string): Promise<void>;
|
|
115
|
+
/**
|
|
116
|
+
* Navigates to the specified navigation panel page using HTML element attribute `data-test-id`
|
|
117
|
+
* The management system must be loaded & signed in before using this method.
|
|
118
|
+
*
|
|
119
|
+
* The following steps will be taken:
|
|
120
|
+
* - Expand the menu (if not on a home view where the navigation panel is already visible)
|
|
121
|
+
* - Navigate to the navigation category by category label
|
|
122
|
+
* - In case `groupLabel` is provided Navigate to the navigation item group by group label and expand the group
|
|
123
|
+
* - Navigate to the navigation item by item label
|
|
124
|
+
* - Wait for a page transition to complete
|
|
125
|
+
* @param itemTestId data-test-id attribute of navigation item
|
|
126
|
+
* @param groupTestId data-test-id attribute of navigation item group
|
|
127
|
+
*/
|
|
128
|
+
goToNavigationPanelItemByTestIds(itemTestId: string, groupTestId?: string): Promise<void>;
|
|
129
|
+
/**
|
|
130
|
+
* Click a Page Header action by its visible label.
|
|
131
|
+
*
|
|
132
|
+
* Behavior:
|
|
133
|
+
* - If the target action is directly visible in the header, click it.
|
|
134
|
+
* - Otherwise, click the "More" overflow button and then click the target action in the menu.
|
|
135
|
+
*
|
|
136
|
+
* This helper does not wait for any subsequent navigation; callers should
|
|
137
|
+
* await navigation or network idle states as needed.
|
|
138
|
+
* @param actionToSelect data-test-id attribute of navigation item
|
|
139
|
+
*/
|
|
140
|
+
clickPageHeaderAction(actionToSelect: string): Promise<void>;
|
|
141
|
+
/**
|
|
142
|
+
* This method waits for a page transition to complete while another promise is being resolved.
|
|
143
|
+
* The two async processes run in parallel inside a `Promise.all` which prevents
|
|
144
|
+
* problems with race conditions. See: https://playwright.dev/docs/events.
|
|
145
|
+
*
|
|
146
|
+
* By convention, mosaic library methods which begin with "navigate" already use this method so it does not need to be used explicitly.
|
|
147
|
+
*
|
|
148
|
+
* Example usage:
|
|
149
|
+
* ```
|
|
150
|
+
* await uiShell.waitForPageTransition(
|
|
151
|
+
* uiWorkflows.list.getRow(1).actionButton.click(),
|
|
152
|
+
* );
|
|
153
|
+
* ```
|
|
154
|
+
*/
|
|
155
|
+
get waitForPageTransition(): (promise: Promise<any>) => Promise<void>;
|
|
156
|
+
private expandNavigationPanel;
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=ui-shell-model.d.ts.map
|
|
@@ -0,0 +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,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD;;;;;;;;;GASG;AACH,qBAAa,YAAY;IAErB,kCAAkC;IAClC,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI;;IAD7B,kCAAkC;IACf,IAAI,EAAE,IAAI;IAG/B,uCAAuC;IACvC,QAAQ,CAAC,WAAW,cAA8B;IAElD,kDAAkD;IAClD,QAAQ,CAAC,iBAAiB,oBAAoC;IAE9D,0CAA0C;IAC1C,QAAQ,CAAC,gBAAgB,mBAAmC;IAE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B;CAWpC"}
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import { Hub, LandingPageHeader, LandingPageTiles, PageHeader, } from '@axinom/mosaic-e2e-ui-selectors';
|
|
3
|
+
import {} from '@playwright/test';
|
|
4
|
+
import { Breadcrumbs } from './breadcrumbs.js';
|
|
5
|
+
import { NavigationPanel } from './navigation-panel.js';
|
|
6
|
+
import { Notifications } from './toast-notifications.js';
|
|
7
|
+
/**
|
|
8
|
+
* A model representing the Mosaic UI including methods for navigation.
|
|
9
|
+
* This model should be used for page and UI components which are provided by Mosaic as a service.
|
|
10
|
+
*
|
|
11
|
+
* Use this model to interact with:
|
|
12
|
+
* - The breadcrumbs bar (on any page)
|
|
13
|
+
* - The landing page
|
|
14
|
+
* - The settings hub page
|
|
15
|
+
* - Pages, settings or mod*a*ls of any managed service (Image, Video, etc)
|
|
16
|
+
*/
|
|
17
|
+
export class UiShellModel {
|
|
18
|
+
constructor(
|
|
19
|
+
/** The playwright page object. */
|
|
20
|
+
page) {
|
|
21
|
+
this.page = page;
|
|
22
|
+
/** A model for the breadcrumbs bar. */
|
|
23
|
+
this.breadcrumbs = new Breadcrumbs(this.page);
|
|
24
|
+
/** A model for the header on the landing page. */
|
|
25
|
+
this.landingPageHeader = new LandingPageHeader(this.page);
|
|
26
|
+
/** A model for the landing page tiles. */
|
|
27
|
+
this.landingPageTiles = new LandingPageTiles(this.page);
|
|
28
|
+
/** A model for the settings page header. */
|
|
29
|
+
this.settingsPageHeader = new PageHeader(this.page);
|
|
30
|
+
/** A model for the settings pages navigation hub. */
|
|
31
|
+
this.settingsPageHub = new Hub(this.page);
|
|
32
|
+
/** A model for navigation panel */
|
|
33
|
+
this.navigationPanel = new NavigationPanel(this.page);
|
|
34
|
+
/** A model for toast notifications */
|
|
35
|
+
this.notifications = new Notifications(this.page);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* This method navigates to the landing page breadcrumb.
|
|
39
|
+
* The management system must be loaded & signed in before using this method.
|
|
40
|
+
*
|
|
41
|
+
* The following steps will be taken:
|
|
42
|
+
* - Click the first (home) breadcrumb
|
|
43
|
+
* - Wait for a page transition to complete
|
|
44
|
+
*/
|
|
45
|
+
async navigateToBreadcrumbHome() {
|
|
46
|
+
const breadcrumb = this.breadcrumbs.getBreadcrumb(1);
|
|
47
|
+
try {
|
|
48
|
+
await breadcrumb.waitFor({ state: 'visible' });
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
throw new Error(`The breadcrumbs home button is not visible. Is the management system loaded and signed in?`);
|
|
52
|
+
}
|
|
53
|
+
await this.waitForPageTransition(breadcrumb.click());
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* This method navigates to the 'previous' breadcrumb.
|
|
57
|
+
* The management system must be loaded & signed in before using this method.
|
|
58
|
+
*
|
|
59
|
+
* The following steps will be taken:
|
|
60
|
+
* - Click the last-but-one breadcrumb
|
|
61
|
+
* - Wait for a page transition to complete
|
|
62
|
+
*/
|
|
63
|
+
async navigateToBreadcrumbPrevious() {
|
|
64
|
+
const breadcrumb = this.breadcrumbs.getBreadcrumb(-2);
|
|
65
|
+
await breadcrumb.waitFor({ state: 'visible' });
|
|
66
|
+
await this.waitForPageTransition(breadcrumb.click());
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* This method navigates to the 'refresh' breadcrumb.
|
|
70
|
+
* The management system must be loaded & signed in before using this method.
|
|
71
|
+
*
|
|
72
|
+
* The following steps will be taken:
|
|
73
|
+
* - Click the last breadcrumb
|
|
74
|
+
* - Wait for a page transition to complete
|
|
75
|
+
*/
|
|
76
|
+
async navigateToBreadcrumbRefresh() {
|
|
77
|
+
const breadcrumb = this.breadcrumbs.getBreadcrumb(-1);
|
|
78
|
+
await breadcrumb.waitFor({ state: 'visible' });
|
|
79
|
+
await this.waitForPageTransition(breadcrumb.click());
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* This method navigates to a landing page tile by label.
|
|
83
|
+
* The management system must be loaded & signed in before using this method.
|
|
84
|
+
*
|
|
85
|
+
* The following steps will be taken:
|
|
86
|
+
* - Navigate to the home breadcrumb (if not already on the landing page)
|
|
87
|
+
* - Navigate to a tile by label
|
|
88
|
+
* - Wait for a page transition to complete
|
|
89
|
+
*/
|
|
90
|
+
async navigateToLandingPageTile(label) {
|
|
91
|
+
const tile = this.landingPageTiles.getTileByLabel(label);
|
|
92
|
+
// If there is more than 1 breadcrumb visible then navigate to home
|
|
93
|
+
if (await this.breadcrumbs.getBreadcrumb(2).isVisible()) {
|
|
94
|
+
await this.navigateToBreadcrumbHome();
|
|
95
|
+
}
|
|
96
|
+
try {
|
|
97
|
+
await tile.waitFor({ state: 'visible' });
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
throw new Error(`Landing page tile with label '${label}' is not visible. Is the label correct? Is the service enabled for this environment?`);
|
|
101
|
+
}
|
|
102
|
+
await this.waitForPageTransition(tile.click());
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* This method navigates to a settings page tile by label.
|
|
106
|
+
* The management system must be loaded & signed in before using this method.
|
|
107
|
+
*
|
|
108
|
+
* @deprecated Please use `goToNavigationPanelSettingsItem` instead
|
|
109
|
+
*
|
|
110
|
+
* The following steps will be taken:
|
|
111
|
+
* - Navigate to the home breadcrumb (if not already on the landing page)
|
|
112
|
+
* - Navigate to the 'Settings' tile
|
|
113
|
+
* - Navigate to a tile by group label and tile label
|
|
114
|
+
* - Wait for a page transition to complete
|
|
115
|
+
*/
|
|
116
|
+
async navigateToSettingsTile(groupLabel, tileLabel) {
|
|
117
|
+
this.goToNavigationPanelSettingsItem(tileLabel, groupLabel);
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Navigates to specified Settings page item using navigation panel
|
|
121
|
+
* The management system must be loaded & signed in before using this method.
|
|
122
|
+
*
|
|
123
|
+
* The following steps will be taken:
|
|
124
|
+
* - Navigate to the home breadcrumb (if not already on the landing page)
|
|
125
|
+
* - Navigate to the Settings category
|
|
126
|
+
* - In case `groupLabel` is provided navigate to the navigation item group by group label and expand the it
|
|
127
|
+
* - Navigate to the navigation item by item label
|
|
128
|
+
* - Wait for a page transition to complete
|
|
129
|
+
* @param itemLabel Navigation item label
|
|
130
|
+
* @param groupLabel Label of navigation item group in Settings category, that needs to be expanded
|
|
131
|
+
*/
|
|
132
|
+
async goToNavigationPanelSettingsItem(itemLabel, groupLabel) {
|
|
133
|
+
await this.goToNavigationPanelItem('Settings', itemLabel, groupLabel);
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Navigates to the specified navigation panel page using Navigation Panel item text
|
|
137
|
+
* The management system must be loaded & signed in before using this method.
|
|
138
|
+
*
|
|
139
|
+
* The following steps will be taken:
|
|
140
|
+
* - Expand the menu (if not on a home view where the navigation panel is already visible)
|
|
141
|
+
* - Navigate to the navigation category by category label
|
|
142
|
+
* - In case `groupLabel` is provided Navigate to the navigation item group by group label and expand the group
|
|
143
|
+
* - Navigate to the navigation item by item label
|
|
144
|
+
* - Wait for a page transition to complete
|
|
145
|
+
* @param categoryLabel Navigation category label
|
|
146
|
+
* @param itemLabel Label of navigation item
|
|
147
|
+
* @param groupLabel Label of navigation item group in category, that needs to be expanded
|
|
148
|
+
*/
|
|
149
|
+
async goToNavigationPanelItem(categoryLabel, itemLabel, groupLabel) {
|
|
150
|
+
const category = this.navigationPanel.getCategoryByLabel(categoryLabel);
|
|
151
|
+
let item;
|
|
152
|
+
await this.expandNavigationPanel();
|
|
153
|
+
if (groupLabel) {
|
|
154
|
+
const group = category.getNavigationItemGroupByLabel(groupLabel);
|
|
155
|
+
try {
|
|
156
|
+
await group.expand();
|
|
157
|
+
}
|
|
158
|
+
catch {
|
|
159
|
+
throw new Error(`Navigation panel item '${categoryLabel}>${groupLabel}>${itemLabel}' is not visible. Is the label(s) correct? Is the service enabled for this environment?`);
|
|
160
|
+
}
|
|
161
|
+
item = group.getNavItemByLabel(itemLabel);
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
item = category.getNavigationItemByLabel(itemLabel);
|
|
165
|
+
}
|
|
166
|
+
await this.waitForPageTransition(item.click());
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Navigates to the specified navigation panel page using HTML element attribute `data-test-id`
|
|
170
|
+
* The management system must be loaded & signed in before using this method.
|
|
171
|
+
*
|
|
172
|
+
* The following steps will be taken:
|
|
173
|
+
* - Expand the menu (if not on a home view where the navigation panel is already visible)
|
|
174
|
+
* - Navigate to the navigation category by category label
|
|
175
|
+
* - In case `groupLabel` is provided Navigate to the navigation item group by group label and expand the group
|
|
176
|
+
* - Navigate to the navigation item by item label
|
|
177
|
+
* - Wait for a page transition to complete
|
|
178
|
+
* @param itemTestId data-test-id attribute of navigation item
|
|
179
|
+
* @param groupTestId data-test-id attribute of navigation item group
|
|
180
|
+
*/
|
|
181
|
+
async goToNavigationPanelItemByTestIds(itemTestId, groupTestId) {
|
|
182
|
+
let item;
|
|
183
|
+
await this.expandNavigationPanel();
|
|
184
|
+
if (groupTestId) {
|
|
185
|
+
const group = this.navigationPanel.getNavigationItemGroupById(groupTestId);
|
|
186
|
+
try {
|
|
187
|
+
await group.expand();
|
|
188
|
+
}
|
|
189
|
+
catch {
|
|
190
|
+
throw new Error(`Navigation panel item '${groupTestId}>${itemTestId}' is not visible. Is the label(s) correct? Is the service enabled for this environment?`);
|
|
191
|
+
}
|
|
192
|
+
item = group.getNavItemById(itemTestId);
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
item = this.navigationPanel.getNavigationItemById(itemTestId);
|
|
196
|
+
}
|
|
197
|
+
await this.waitForPageTransition(item.click());
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Click a Page Header action by its visible label.
|
|
201
|
+
*
|
|
202
|
+
* Behavior:
|
|
203
|
+
* - If the target action is directly visible in the header, click it.
|
|
204
|
+
* - Otherwise, click the "More" overflow button and then click the target action in the menu.
|
|
205
|
+
*
|
|
206
|
+
* This helper does not wait for any subsequent navigation; callers should
|
|
207
|
+
* await navigation or network idle states as needed.
|
|
208
|
+
* @param actionToSelect data-test-id attribute of navigation item
|
|
209
|
+
*/
|
|
210
|
+
async clickPageHeaderAction(actionToSelect) {
|
|
211
|
+
if (await this.page
|
|
212
|
+
.locator(`//div[contains(@class, 'PageHeaderAction_label')]/span[@data-test-id='label' and normalize-space(.)='${actionToSelect}']`)
|
|
213
|
+
.isVisible()) {
|
|
214
|
+
await this.page
|
|
215
|
+
.locator(`//div[contains(@class, 'PageHeaderAction_label')]/span[@data-test-id='label' and normalize-space(.)='${actionToSelect}']`)
|
|
216
|
+
.dblclick();
|
|
217
|
+
}
|
|
218
|
+
else {
|
|
219
|
+
await this.page
|
|
220
|
+
.locator("//button[@data-test-id='action']//span[@data-test-id='label' and normalize-space(.)='More']")
|
|
221
|
+
.nth(1)
|
|
222
|
+
.dblclick();
|
|
223
|
+
await this.page
|
|
224
|
+
.locator(`//div[contains(@class, 'PageHeaderAction_label')]/span[@data-test-id='label' and normalize-space(.)='${actionToSelect}']`)
|
|
225
|
+
.dblclick();
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* This method waits for a page transition to complete while another promise is being resolved.
|
|
230
|
+
* The two async processes run in parallel inside a `Promise.all` which prevents
|
|
231
|
+
* problems with race conditions. See: https://playwright.dev/docs/events.
|
|
232
|
+
*
|
|
233
|
+
* By convention, mosaic library methods which begin with "navigate" already use this method so it does not need to be used explicitly.
|
|
234
|
+
*
|
|
235
|
+
* Example usage:
|
|
236
|
+
* ```
|
|
237
|
+
* await uiShell.waitForPageTransition(
|
|
238
|
+
* uiWorkflows.list.getRow(1).actionButton.click(),
|
|
239
|
+
* );
|
|
240
|
+
* ```
|
|
241
|
+
*/
|
|
242
|
+
get waitForPageTransition() {
|
|
243
|
+
const animationActive = this.page.locator('//*[contains(@class, "animate-forward-enter-active") or contains(@class, "animate-backward-enter-active") or contains(@class, "animate-none-enter-active")]');
|
|
244
|
+
const animationDone = this.page.locator('//*[contains(@class, "animate-forward-enter-done") or contains(@class, "animate-backward-enter-done") or contains(@class, "animate-none-enter-done")]');
|
|
245
|
+
// The method is a getter, because we need to make sure this promise is started first (see https://playwright.dev/docs/events):
|
|
246
|
+
// Wait for the animation-active marker then the animation-done marker
|
|
247
|
+
const firstPromise = animationActive
|
|
248
|
+
.waitFor({ state: 'attached' })
|
|
249
|
+
.then(() => animationDone.waitFor({ state: 'attached' }));
|
|
250
|
+
// After starting that promise, we return a function which will accept the second promise as an argument
|
|
251
|
+
return async (promise) => {
|
|
252
|
+
// await both promises in `Promise.all`
|
|
253
|
+
await Promise.all([firstPromise, promise]);
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
async expandNavigationPanel() {
|
|
257
|
+
const expandMenuButton = this.page.locator(`//*[@data-test-id="hamburger-menu-button"]`);
|
|
258
|
+
// If expand menu button visible (not on a home view), expand the menu
|
|
259
|
+
if (await expandMenuButton.isEnabled()) {
|
|
260
|
+
expandMenuButton.click();
|
|
261
|
+
await this.navigationPanel.panel.waitFor({ state: 'visible' });
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
//# sourceMappingURL=ui-shell-model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui-shell-model.js","sourceRoot":"","sources":["../../../src/ui-selectors/ui-shell-model.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,EACL,GAAG,EACH,iBAAiB,EACjB,gBAAgB,EAChB,UAAU,GACX,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD;;;;;;;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,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,CAAC;YACvC,gBAAgB,CAAC,KAAK,EAAE,CAAC;YACzB,MAAM,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QACjE,CAAC;IACH,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axinom/mosaic-e2e-page-model",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.13-rc.3",
|
|
4
4
|
"description": "A page model for testing an Axinom Mosaic Management System with Playwright.",
|
|
5
5
|
"author": "Axinom",
|
|
6
6
|
"license": "PROPRIETARY",
|
|
@@ -13,17 +13,28 @@
|
|
|
13
13
|
"dist",
|
|
14
14
|
"src"
|
|
15
15
|
],
|
|
16
|
-
"main": "dist/index.js",
|
|
17
|
-
"
|
|
16
|
+
"main": "dist/cjs/index.js",
|
|
17
|
+
"module": "dist/esm/index.js",
|
|
18
|
+
"types": "dist/cjs/index.d.ts",
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"types": "./dist/cjs/index.d.ts",
|
|
22
|
+
"import": "./dist/esm/index.js",
|
|
23
|
+
"require": "./dist/cjs/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./package.json": "./package.json"
|
|
26
|
+
},
|
|
18
27
|
"scripts": {
|
|
19
28
|
"clean": "rimraf dist",
|
|
20
|
-
"build": "yarn clean && tsc",
|
|
29
|
+
"build": "yarn clean && tsc --project tsconfig.build.json && tsc --project tsconfig.build.esm.json && node ../../scripts/write-esm-markers.js",
|
|
21
30
|
"build:ci": "yarn workspaces focus && yarn build",
|
|
22
|
-
"
|
|
23
|
-
"
|
|
31
|
+
"ts:validate": "tsc && yarn build && yarn check:esm-interop",
|
|
32
|
+
"check:esm-interop": "node ./scripts/check-esm-interop.mjs",
|
|
33
|
+
"dev": "tsc -w --project tsconfig.build.json",
|
|
34
|
+
"lint": "eslint . --ext .ts,.tsx,.js --color --cache"
|
|
24
35
|
},
|
|
25
36
|
"dependencies": {
|
|
26
|
-
"@axinom/mosaic-e2e-ui-selectors": "^0.16.
|
|
37
|
+
"@axinom/mosaic-e2e-ui-selectors": "^0.16.10-rc.3"
|
|
27
38
|
},
|
|
28
39
|
"devDependencies": {
|
|
29
40
|
"@playwright/test": "1.58.0",
|
|
@@ -36,5 +47,5 @@
|
|
|
36
47
|
"publishConfig": {
|
|
37
48
|
"access": "public"
|
|
38
49
|
},
|
|
39
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "9c7831acd6fcced9a09f97ffd4c9d67ee1b3b640"
|
|
40
51
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './managed-services';
|
|
2
|
-
export * from './page-model';
|
|
3
|
-
export * from './service-model';
|
|
4
|
-
export * from './sign-in';
|
|
5
|
-
export * from './ui-selectors';
|
|
1
|
+
export * from './managed-services/index.js';
|
|
2
|
+
export * from './page-model.js';
|
|
3
|
+
export * from './service-model.js';
|
|
4
|
+
export * from './sign-in/index.js';
|
|
5
|
+
export * from './ui-selectors/index.js';
|