@axinom/mosaic-e2e-page-model 0.1.0-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.
Files changed (66) hide show
  1. package/README.md +22 -0
  2. package/dist/index.d.ts +6 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +18 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/managed-services/image-selection-explorer.d.ts +16 -0
  7. package/dist/managed-services/image-selection-explorer.d.ts.map +1 -0
  8. package/dist/managed-services/image-selection-explorer.js +39 -0
  9. package/dist/managed-services/image-selection-explorer.js.map +1 -0
  10. package/dist/managed-services/image-service.d.ts +65 -0
  11. package/dist/managed-services/image-service.d.ts.map +1 -0
  12. package/dist/managed-services/image-service.js +120 -0
  13. package/dist/managed-services/image-service.js.map +1 -0
  14. package/dist/managed-services/index.d.ts +4 -0
  15. package/dist/managed-services/index.d.ts.map +1 -0
  16. package/dist/managed-services/index.js +16 -0
  17. package/dist/managed-services/index.js.map +1 -0
  18. package/dist/managed-services/managed-service-model.d.ts +46 -0
  19. package/dist/managed-services/managed-service-model.d.ts.map +1 -0
  20. package/dist/managed-services/managed-service-model.js +33 -0
  21. package/dist/managed-services/managed-service-model.js.map +1 -0
  22. package/dist/managed-services/monetization-service.d.ts +208 -0
  23. package/dist/managed-services/monetization-service.d.ts.map +1 -0
  24. package/dist/managed-services/monetization-service.js +459 -0
  25. package/dist/managed-services/monetization-service.js.map +1 -0
  26. package/dist/managed-services/payment-provider-settings-field.d.ts +7 -0
  27. package/dist/managed-services/payment-provider-settings-field.d.ts.map +1 -0
  28. package/dist/managed-services/payment-provider-settings-field.js +37 -0
  29. package/dist/managed-services/payment-provider-settings-field.js.map +1 -0
  30. package/dist/page-model.d.ts +44 -0
  31. package/dist/page-model.d.ts.map +1 -0
  32. package/dist/page-model.js +56 -0
  33. package/dist/page-model.js.map +1 -0
  34. package/dist/service-model.d.ts +43 -0
  35. package/dist/service-model.d.ts.map +1 -0
  36. package/dist/service-model.js +32 -0
  37. package/dist/service-model.js.map +1 -0
  38. package/dist/sign-in/index.d.ts +5 -0
  39. package/dist/sign-in/index.d.ts.map +1 -0
  40. package/dist/sign-in/index.js +17 -0
  41. package/dist/sign-in/index.js.map +1 -0
  42. package/dist/sign-in/sign-in-page.d.ts +27 -0
  43. package/dist/sign-in/sign-in-page.d.ts.map +1 -0
  44. package/dist/sign-in/sign-in-page.js +38 -0
  45. package/dist/sign-in/sign-in-page.js.map +1 -0
  46. package/dist/sign-in/sign-in-with-ax-auth-form.d.ts +24 -0
  47. package/dist/sign-in/sign-in-with-ax-auth-form.d.ts.map +1 -0
  48. package/dist/sign-in/sign-in-with-ax-auth-form.js +48 -0
  49. package/dist/sign-in/sign-in-with-ax-auth-form.js.map +1 -0
  50. package/dist/sign-in/sign-in-with-google-form.d.ts +23 -0
  51. package/dist/sign-in/sign-in-with-google-form.d.ts.map +1 -0
  52. package/dist/sign-in/sign-in-with-google-form.js +51 -0
  53. package/dist/sign-in/sign-in-with-google-form.js.map +1 -0
  54. package/dist/sign-in/sign-in-with-microsoft-form.d.ts +24 -0
  55. package/dist/sign-in/sign-in-with-microsoft-form.d.ts.map +1 -0
  56. package/dist/sign-in/sign-in-with-microsoft-form.js +58 -0
  57. package/dist/sign-in/sign-in-with-microsoft-form.js.map +1 -0
  58. package/dist/ui-selectors/index.d.ts +2 -0
  59. package/dist/ui-selectors/index.d.ts.map +1 -0
  60. package/dist/ui-selectors/index.js +14 -0
  61. package/dist/ui-selectors/index.js.map +1 -0
  62. package/dist/ui-selectors/ui-shell-model.d.ts +80 -0
  63. package/dist/ui-selectors/ui-shell-model.d.ts.map +1 -0
  64. package/dist/ui-selectors/ui-shell-model.js +134 -0
  65. package/dist/ui-selectors/ui-shell-model.js.map +1 -0
  66. package/package.json +37 -0
@@ -0,0 +1,43 @@
1
+ import { Page } from 'playwright-core';
2
+ import { UiShellModel } from './ui-selectors';
3
+ /**
4
+ * An abstract model representing a custom Mosaic service.
5
+ */
6
+ export declare abstract class ServiceModel<TUiWorkflowsModel> {
7
+ /** The playwright page object. */
8
+ protected readonly page: Page;
9
+ /**
10
+ * A model representing the Mosaic UI shell including methods for navigation.
11
+ *
12
+ * Use this model to interact with:
13
+ * - The breadcrumbs bar (on any page)
14
+ * - The landing page
15
+ * - The settings hub page
16
+ */
17
+ protected readonly uiShell: UiShellModel;
18
+ /**
19
+ * A model representing Mosaic UI workflows.
20
+ *
21
+ * Use this model to interact with workflows or mod*a*ls of any custom service.
22
+ */
23
+ protected readonly uiWorkflows: TUiWorkflowsModel;
24
+ constructor(
25
+ /** The playwright page object. */
26
+ page: Page,
27
+ /**
28
+ * A model representing the Mosaic UI shell including methods for navigation.
29
+ *
30
+ * Use this model to interact with:
31
+ * - The breadcrumbs bar (on any page)
32
+ * - The landing page
33
+ * - The settings hub page
34
+ */
35
+ uiShell: UiShellModel,
36
+ /**
37
+ * A model representing Mosaic UI workflows.
38
+ *
39
+ * Use this model to interact with workflows or mod*a*ls of any custom service.
40
+ */
41
+ uiWorkflows: TUiWorkflowsModel);
42
+ }
43
+ //# sourceMappingURL=service-model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service-model.d.ts","sourceRoot":"","sources":["../src/service-model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;GAEG;AACH,8BAAsB,YAAY,CAAC,iBAAiB;IAEhD,kCAAkC;IAClC,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI;IAE7B;;;;;;;OAOG;IACH,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,YAAY;IAExC;;;;OAIG;IACH,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,iBAAiB;;IAlBjD,kCAAkC;IACf,IAAI,EAAE,IAAI;IAE7B;;;;;;;OAOG;IACgB,OAAO,EAAE,YAAY;IAExC;;;;OAIG;IACgB,WAAW,EAAE,iBAAiB;CAEpD"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ServiceModel = void 0;
4
+ /**
5
+ * An abstract model representing a custom Mosaic service.
6
+ */
7
+ class ServiceModel {
8
+ constructor(
9
+ /** The playwright page object. */
10
+ page,
11
+ /**
12
+ * A model representing the Mosaic UI shell including methods for navigation.
13
+ *
14
+ * Use this model to interact with:
15
+ * - The breadcrumbs bar (on any page)
16
+ * - The landing page
17
+ * - The settings hub page
18
+ */
19
+ uiShell,
20
+ /**
21
+ * A model representing Mosaic UI workflows.
22
+ *
23
+ * Use this model to interact with workflows or mod*a*ls of any custom service.
24
+ */
25
+ uiWorkflows) {
26
+ this.page = page;
27
+ this.uiShell = uiShell;
28
+ this.uiWorkflows = uiWorkflows;
29
+ }
30
+ }
31
+ exports.ServiceModel = ServiceModel;
32
+ //# sourceMappingURL=service-model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service-model.js","sourceRoot":"","sources":["../src/service-model.ts"],"names":[],"mappings":";;;AAGA;;GAEG;AACH,MAAsB,YAAY;IAChC;IACE,kCAAkC;IACf,IAAU;IAE7B;;;;;;;OAOG;IACgB,OAAqB;IAExC;;;;OAIG;IACgB,WAA8B;QAjB9B,SAAI,GAAJ,IAAI,CAAM;QAUV,YAAO,GAAP,OAAO,CAAc;QAOrB,gBAAW,GAAX,WAAW,CAAmB;IAChD,CAAC;CACL;AAtBD,oCAsBC"}
@@ -0,0 +1,5 @@
1
+ export * from './sign-in-page';
2
+ export * from './sign-in-with-ax-auth-form';
3
+ export * from './sign-in-with-google-form';
4
+ export * from './sign-in-with-microsoft-form';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sign-in/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./sign-in-page"), exports);
14
+ __exportStar(require("./sign-in-with-ax-auth-form"), exports);
15
+ __exportStar(require("./sign-in-with-google-form"), exports);
16
+ __exportStar(require("./sign-in-with-microsoft-form"), exports);
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sign-in/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iDAA+B;AAC/B,8DAA4C;AAC5C,6DAA2C;AAC3C,gEAA8C"}
@@ -0,0 +1,27 @@
1
+ import { Page } from 'playwright-core';
2
+ import { SignInWithAxAuthForm } from './sign-in-with-ax-auth-form';
3
+ import { SignInWithGoogleForm } from './sign-in-with-google-form';
4
+ import { SignInWithMicrosoftForm } from './sign-in-with-microsoft-form';
5
+ /** A model for management system sign-in */
6
+ export declare class SignInPage {
7
+ /** The playwright page object. */
8
+ private page;
9
+ constructor(
10
+ /** The playwright page object. */
11
+ page: Page);
12
+ /** A locator to a message which is displayed when the environment is disabled. */
13
+ readonly inactiveEnvironmentMessage: import("playwright-core").Locator;
14
+ /** A locator to the "Sign in with AxAuth" button. */
15
+ readonly axAuthButton: import("playwright-core").Locator;
16
+ /** A locator to the "Sign in with Google" button. */
17
+ readonly googleButton: import("playwright-core").Locator;
18
+ /** A locator to the "Sign in with Microsoft" button. */
19
+ readonly microsoftButton: import("playwright-core").Locator;
20
+ /** A model for the AxAuth sign-in form */
21
+ readonly axAuthForm: SignInWithAxAuthForm;
22
+ /** A model for the Google sign-in form */
23
+ readonly googleForm: SignInWithGoogleForm;
24
+ /** A model for the Microsoft sign-in form */
25
+ readonly microsoftForm: SignInWithMicrosoftForm;
26
+ }
27
+ //# sourceMappingURL=sign-in-page.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sign-in-page.d.ts","sourceRoot":"","sources":["../../src/sign-in/sign-in-page.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAExE,4CAA4C;AAC5C,qBAAa,UAAU;IAEnB,kCAAkC;IAClC,OAAO,CAAC,IAAI;;IADZ,kCAAkC;IAC1B,IAAI,EAAE,IAAI;IAGpB,kFAAkF;IAClF,QAAQ,CAAC,0BAA0B,oCAGjC;IAEF,qDAAqD;IACrD,QAAQ,CAAC,YAAY,oCAGnB;IAEF,qDAAqD;IACrD,QAAQ,CAAC,YAAY,oCAGnB;IAEF,wDAAwD;IACxD,QAAQ,CAAC,eAAe,oCAGtB;IAEF,0CAA0C;IAC1C,QAAQ,CAAC,UAAU,uBAAuC;IAE1D,0CAA0C;IAC1C,QAAQ,CAAC,UAAU,uBAAuC;IAE1D,6CAA6C;IAC7C,QAAQ,CAAC,aAAa,0BAA0C;CACjE"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SignInPage = void 0;
4
+ const sign_in_with_ax_auth_form_1 = require("./sign-in-with-ax-auth-form");
5
+ const sign_in_with_google_form_1 = require("./sign-in-with-google-form");
6
+ const sign_in_with_microsoft_form_1 = require("./sign-in-with-microsoft-form");
7
+ /** A model for management system sign-in */
8
+ class SignInPage {
9
+ constructor(
10
+ /** The playwright page object. */
11
+ page) {
12
+ this.page = page;
13
+ /** A locator to a message which is displayed when the environment is disabled. */
14
+ this.inactiveEnvironmentMessage = this.page.locator(
15
+ //TODO: improve selector
16
+ '//p[contains(@class, "EnvironmentInactiveError")]');
17
+ /** A locator to the "Sign in with AxAuth" button. */
18
+ this.axAuthButton = this.page.locator(
19
+ // TODO: improve selector
20
+ '//div[contains(@class, "Login-module_ax")][contains(@class, "Login-module_tile")]');
21
+ /** A locator to the "Sign in with Google" button. */
22
+ this.googleButton = this.page.locator(
23
+ // TODO: improve selector
24
+ '//div[contains(@class, "Login-module_google")][contains(@class, "Login-module_tile")]');
25
+ /** A locator to the "Sign in with Microsoft" button. */
26
+ this.microsoftButton = this.page.locator(
27
+ // TODO: improve selector
28
+ '//div[contains(@class, "Login-module_azure")][contains(@class, "Login-module_tile")]');
29
+ /** A model for the AxAuth sign-in form */
30
+ this.axAuthForm = new sign_in_with_ax_auth_form_1.SignInWithAxAuthForm(this.page);
31
+ /** A model for the Google sign-in form */
32
+ this.googleForm = new sign_in_with_google_form_1.SignInWithGoogleForm(this.page);
33
+ /** A model for the Microsoft sign-in form */
34
+ this.microsoftForm = new sign_in_with_microsoft_form_1.SignInWithMicrosoftForm(this.page);
35
+ }
36
+ }
37
+ exports.SignInPage = SignInPage;
38
+ //# sourceMappingURL=sign-in-page.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sign-in-page.js","sourceRoot":"","sources":["../../src/sign-in/sign-in-page.ts"],"names":[],"mappings":";;;AACA,2EAAmE;AACnE,yEAAkE;AAClE,+EAAwE;AAExE,4CAA4C;AAC5C,MAAa,UAAU;IACrB;IACE,kCAAkC;IAC1B,IAAU;QAAV,SAAI,GAAJ,IAAI,CAAM;QAGpB,kFAAkF;QACzE,+BAA0B,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO;QACrD,wBAAwB;QACxB,mDAAmD,CACpD,CAAC;QAEF,qDAAqD;QAC5C,iBAAY,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO;QACvC,yBAAyB;QACzB,mFAAmF,CACpF,CAAC;QAEF,qDAAqD;QAC5C,iBAAY,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO;QACvC,yBAAyB;QACzB,uFAAuF,CACxF,CAAC;QAEF,wDAAwD;QAC/C,oBAAe,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO;QAC1C,yBAAyB;QACzB,sFAAsF,CACvF,CAAC;QAEF,0CAA0C;QACjC,eAAU,GAAG,IAAI,gDAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAE1D,0CAA0C;QACjC,eAAU,GAAG,IAAI,+CAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAE1D,6CAA6C;QACpC,kBAAa,GAAG,IAAI,qDAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAjC7D,CAAC;CAkCL;AAtCD,gCAsCC"}
@@ -0,0 +1,24 @@
1
+ import { ComponentModel } from '@axinom/mosaic-e2e-ui-selectors';
2
+ import { Page } from 'playwright-core';
3
+ /** A model for the AxAuth sign-in form */
4
+ export declare class SignInWithAxAuthForm extends ComponentModel {
5
+ constructor(page: Page);
6
+ /** A locator to a message displayed on authentication failure. */
7
+ readonly errorMessage: import("playwright-core").Locator;
8
+ /**
9
+ * This method signs in with axauth credentials.
10
+ * The AxAuth sign-in form must be displayed before using this method.
11
+ * Authentication failure due to bad credentials will result in an exception.
12
+ *
13
+ * The following steps will be taken:
14
+ * - Enter email and password
15
+ * - Click 'Sign-in'
16
+ * - Click 'Agree and Continue'
17
+ * - Wait for the form to be detached
18
+ */
19
+ authenticate(credentials: {
20
+ email: string;
21
+ password: string;
22
+ }): Promise<void>;
23
+ }
24
+ //# sourceMappingURL=sign-in-with-ax-auth-form.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sign-in-with-ax-auth-form.d.ts","sourceRoot":"","sources":["../../src/sign-in/sign-in-with-ax-auth-form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,0CAA0C;AAE1C,qBAAa,oBAAqB,SAAQ,cAAc;gBAC1C,IAAI,EAAE,IAAI;IAKtB,kEAAkE;IAClE,QAAQ,CAAC,YAAY,oCAA0B;IAE/C;;;;;;;;;;OAUG;IACG,YAAY,CAAC,WAAW,EAAE;QAC9B,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;KAClB,GAAG,OAAO,CAAC,IAAI,CAAC;CA2BlB"}
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SignInWithAxAuthForm = void 0;
4
+ const mosaic_e2e_ui_selectors_1 = require("@axinom/mosaic-e2e-ui-selectors");
5
+ /** A model for the AxAuth sign-in form */
6
+ // TODO: improve selectors
7
+ class SignInWithAxAuthForm extends mosaic_e2e_ui_selectors_1.ComponentModel {
8
+ constructor(page) {
9
+ // Base xpath for all selectors on this page.
10
+ super(page, '//*[@class="login-card"]');
11
+ /** A locator to a message displayed on authentication failure. */
12
+ this.errorMessage = this.getLocator('//p');
13
+ }
14
+ /**
15
+ * This method signs in with axauth credentials.
16
+ * The AxAuth sign-in form must be displayed before using this method.
17
+ * Authentication failure due to bad credentials will result in an exception.
18
+ *
19
+ * The following steps will be taken:
20
+ * - Enter email and password
21
+ * - Click 'Sign-in'
22
+ * - Click 'Agree and Continue'
23
+ * - Wait for the form to be detached
24
+ */
25
+ async authenticate(credentials) {
26
+ const emailField = this.getLocator('//*[@placeholder="Enter email address"]');
27
+ const passwordField = this.getLocator('//*[@placeholder="and password"]');
28
+ const signInButton = this.getLocator('//button[text()="Sign-in"]');
29
+ const agreeAndContinueButton = this.getLocator('//*[text()="Agree and Continue"]');
30
+ // enter email and password
31
+ await emailField.waitFor({ state: 'visible' });
32
+ await emailField.fill(credentials.email);
33
+ await passwordField.fill(credentials.password);
34
+ await signInButton.click();
35
+ try {
36
+ await agreeAndContinueButton.waitFor({ state: 'visible' });
37
+ }
38
+ catch (e) {
39
+ throw new Error('Bad username or password.');
40
+ }
41
+ // agree with terms
42
+ await agreeAndContinueButton.click();
43
+ // wait for login to complete
44
+ await agreeAndContinueButton.waitFor({ state: 'detached' });
45
+ }
46
+ }
47
+ exports.SignInWithAxAuthForm = SignInWithAxAuthForm;
48
+ //# sourceMappingURL=sign-in-with-ax-auth-form.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sign-in-with-ax-auth-form.js","sourceRoot":"","sources":["../../src/sign-in/sign-in-with-ax-auth-form.ts"],"names":[],"mappings":";;;AAAA,6EAAiE;AAGjE,0CAA0C;AAC1C,0BAA0B;AAC1B,MAAa,oBAAqB,SAAQ,wCAAc;IACtD,YAAY,IAAU;QACpB,6CAA6C;QAC7C,KAAK,CAAC,IAAI,EAAE,0BAA0B,CAAC,CAAC;QAG1C,kEAAkE;QACzD,iBAAY,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IAH/C,CAAC;IAKD;;;;;;;;;;OAUG;IACH,KAAK,CAAC,YAAY,CAAC,WAGlB;QACC,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAChC,yCAAyC,CAC1C,CAAC;QACF,MAAM,aAAa,GAAG,IAAI,CAAC,UAAU,CAAC,kCAAkC,CAAC,CAAC;QAC1E,MAAM,YAAY,GAAG,IAAI,CAAC,UAAU,CAAC,4BAA4B,CAAC,CAAC;QACnE,MAAM,sBAAsB,GAAG,IAAI,CAAC,UAAU,CAC5C,kCAAkC,CACnC,CAAC;QAEF,2BAA2B;QAC3B,MAAM,UAAU,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QAC/C,MAAM,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QACzC,MAAM,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAC/C,MAAM,YAAY,CAAC,KAAK,EAAE,CAAC;QAC3B,IAAI;YACF,MAAM,sBAAsB,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;SAC5D;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;SAC9C;QAED,mBAAmB;QACnB,MAAM,sBAAsB,CAAC,KAAK,EAAE,CAAC;QAErC,6BAA6B;QAC7B,MAAM,sBAAsB,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;IAC9D,CAAC;CACF;AAlDD,oDAkDC"}
@@ -0,0 +1,23 @@
1
+ import { ComponentModel } from '@axinom/mosaic-e2e-ui-selectors';
2
+ import { Page } from 'playwright-core';
3
+ /** A model for the Google sign-in form */
4
+ export declare class SignInWithGoogleForm extends ComponentModel {
5
+ constructor(page: Page);
6
+ /** A locator to a message displayed on authentication failure. */
7
+ readonly errorMessage: import("playwright-core").Locator;
8
+ /**
9
+ * This method signs in with google.
10
+ * The Google sign-in form must be displayed before using this method.
11
+ * Authentication failure due to bad credentials will result in an exception.
12
+ *
13
+ * The following steps will be taken:
14
+ * - Enter email and click 'Next'
15
+ * - Enter the password and click 'Next'
16
+ * - Wait for the form to be detached
17
+ */
18
+ authenticate(credentials: {
19
+ email: string;
20
+ password: string;
21
+ }): Promise<void>;
22
+ }
23
+ //# sourceMappingURL=sign-in-with-google-form.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sign-in-with-google-form.d.ts","sourceRoot":"","sources":["../../src/sign-in/sign-in-with-google-form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,0CAA0C;AAC1C,qBAAa,oBAAqB,SAAQ,cAAc;gBAC1C,IAAI,EAAE,IAAI;IAMtB,kEAAkE;IAClE,QAAQ,CAAC,YAAY,oCAEnB;IAEF;;;;;;;;;OASG;IACG,YAAY,CAAC,WAAW,EAAE;QAC9B,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;KAClB,GAAG,OAAO,CAAC,IAAI,CAAC;CAyBlB"}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SignInWithGoogleForm = void 0;
4
+ const mosaic_e2e_ui_selectors_1 = require("@axinom/mosaic-e2e-ui-selectors");
5
+ /** A model for the Google sign-in form */
6
+ class SignInWithGoogleForm extends mosaic_e2e_ui_selectors_1.ComponentModel {
7
+ constructor(page) {
8
+ // Base xpath for all selectors on this page.
9
+ // We check that the 'head/base' element has href: 'accounts.google.com'
10
+ super(page, '//html[./head/base[contains(@href, "accounts.google.com")]]');
11
+ /** A locator to a message displayed on authentication failure. */
12
+ this.errorMessage = this.getLocator('//form//*[@aria-live="assertive"]//span');
13
+ }
14
+ /**
15
+ * This method signs in with google.
16
+ * The Google sign-in form must be displayed before using this method.
17
+ * Authentication failure due to bad credentials will result in an exception.
18
+ *
19
+ * The following steps will be taken:
20
+ * - Enter email and click 'Next'
21
+ * - Enter the password and click 'Next'
22
+ * - Wait for the form to be detached
23
+ */
24
+ async authenticate(credentials) {
25
+ const emailField = this.getLocator('//input[@type="email"]');
26
+ const nextBtn = this.getLocator('//*[@id="identifierNext"]/div/button');
27
+ const passwordField = this.getLocator('//input[@name="password"]');
28
+ const signInButton = this.getLocator('//*[@id="passwordNext"]//button');
29
+ // enter email
30
+ await emailField.waitFor({ state: 'visible' });
31
+ await emailField.fill(credentials.email);
32
+ await nextBtn.click();
33
+ try {
34
+ await passwordField.waitFor({ state: 'visible' });
35
+ }
36
+ catch (e) {
37
+ throw new Error('Bad email.');
38
+ }
39
+ // enter password
40
+ await passwordField.fill(credentials.password);
41
+ await signInButton.click();
42
+ try {
43
+ await signInButton.waitFor({ state: 'hidden' });
44
+ }
45
+ catch (e) {
46
+ throw new Error('Bad password.');
47
+ }
48
+ }
49
+ }
50
+ exports.SignInWithGoogleForm = SignInWithGoogleForm;
51
+ //# sourceMappingURL=sign-in-with-google-form.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sign-in-with-google-form.js","sourceRoot":"","sources":["../../src/sign-in/sign-in-with-google-form.ts"],"names":[],"mappings":";;;AAAA,6EAAiE;AAGjE,0CAA0C;AAC1C,MAAa,oBAAqB,SAAQ,wCAAc;IACtD,YAAY,IAAU;QACpB,6CAA6C;QAC7C,wEAAwE;QACxE,KAAK,CAAC,IAAI,EAAE,6DAA6D,CAAC,CAAC;QAG7E,kEAAkE;QACzD,iBAAY,GAAG,IAAI,CAAC,UAAU,CACrC,yCAAyC,CAC1C,CAAC;IALF,CAAC;IAOD;;;;;;;;;OASG;IACH,KAAK,CAAC,YAAY,CAAC,WAGlB;QACC,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,wBAAwB,CAAC,CAAC;QAC7D,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,sCAAsC,CAAC,CAAC;QACxE,MAAM,aAAa,GAAG,IAAI,CAAC,UAAU,CAAC,2BAA2B,CAAC,CAAC;QACnE,MAAM,YAAY,GAAG,IAAI,CAAC,UAAU,CAAC,iCAAiC,CAAC,CAAC;QAExE,cAAc;QACd,MAAM,UAAU,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QAC/C,MAAM,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QACzC,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;QACtB,IAAI;YACF,MAAM,aAAa,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;SACnD;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC;SAC/B;QAED,iBAAiB;QACjB,MAAM,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAC/C,MAAM,YAAY,CAAC,KAAK,EAAE,CAAC;QAC3B,IAAI;YACF,MAAM,YAAY,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;SACjD;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;SAClC;IACH,CAAC;CACF;AAlDD,oDAkDC"}
@@ -0,0 +1,24 @@
1
+ import { ComponentModel } from '@axinom/mosaic-e2e-ui-selectors';
2
+ import { Page } from 'playwright-core';
3
+ /** A model for the Microsoft sign-in form */
4
+ export declare class SignInWithMicrosoftForm extends ComponentModel {
5
+ constructor(page: Page);
6
+ /** A locator to a message displayed on authentication failure. */
7
+ readonly errorMessage: import("playwright-core").Locator;
8
+ /**
9
+ * This method signs in with microsoft.
10
+ * The Microsoft sign-in form must be displayed before using this method.
11
+ * Authentication failure due to bad credentials will result in an exception.
12
+ *
13
+ * The following steps will be taken:
14
+ * - Enter email and click 'Next'
15
+ * - Enter the password and click 'Sign in'
16
+ * - Click 'Accept'
17
+ * - Wait for the form to be detached
18
+ */
19
+ authenticate(credentials: {
20
+ username: string;
21
+ password: string;
22
+ }): Promise<void>;
23
+ }
24
+ //# sourceMappingURL=sign-in-with-microsoft-form.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sign-in-with-microsoft-form.d.ts","sourceRoot":"","sources":["../../src/sign-in/sign-in-with-microsoft-form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,6CAA6C;AAC7C,qBAAa,uBAAwB,SAAQ,cAAc;gBAC7C,IAAI,EAAE,IAAI;IAMtB,kEAAkE;IAClE,QAAQ,CAAC,YAAY,oCAEnB;IAEF;;;;;;;;;;OAUG;IACG,YAAY,CAAC,WAAW,EAAE;QAC9B,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;KAClB,GAAG,OAAO,CAAC,IAAI,CAAC;CAiClB"}
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SignInWithMicrosoftForm = void 0;
4
+ const mosaic_e2e_ui_selectors_1 = require("@axinom/mosaic-e2e-ui-selectors");
5
+ /** A model for the Microsoft sign-in form */
6
+ class SignInWithMicrosoftForm extends mosaic_e2e_ui_selectors_1.ComponentModel {
7
+ constructor(page) {
8
+ // Base xpath for all selectors on this page.
9
+ // We look for a form which has an image with alt=Microsoft
10
+ super(page, '//form[.//img[@alt="Microsoft"]]');
11
+ /** A locator to a message displayed on authentication failure. */
12
+ this.errorMessage = this.getLocator('//*[@id="usernameError" or @id="passwordError"]');
13
+ }
14
+ /**
15
+ * This method signs in with microsoft.
16
+ * The Microsoft sign-in form must be displayed before using this method.
17
+ * Authentication failure due to bad credentials will result in an exception.
18
+ *
19
+ * The following steps will be taken:
20
+ * - Enter email and click 'Next'
21
+ * - Enter the password and click 'Sign in'
22
+ * - Click 'Accept'
23
+ * - Wait for the form to be detached
24
+ */
25
+ async authenticate(credentials) {
26
+ const usernameField = this.getLocator('//input[@name="loginfmt"]');
27
+ const nextBtn = this.getLocator('//input[@value="Next"]');
28
+ const passwordField = this.getLocator('//input[@name="passwd"]');
29
+ const signInButton = this.getLocator('//input[@value="Sign in"]');
30
+ // The accept button is not in the same form element so we use an absolute selector
31
+ const acceptButton = this.getLocator('//input[@value="Accept"]');
32
+ // enter username
33
+ await usernameField.waitFor({ state: 'visible' });
34
+ await usernameField.fill(credentials.username);
35
+ await nextBtn.click();
36
+ try {
37
+ await signInButton.waitFor({ state: 'visible' });
38
+ }
39
+ catch (e) {
40
+ throw new Error('Bad username.');
41
+ }
42
+ // enter password
43
+ await passwordField.fill(credentials.password);
44
+ await signInButton.click();
45
+ try {
46
+ await acceptButton.waitFor({ state: 'visible' });
47
+ }
48
+ catch (e) {
49
+ throw new Error('Bad password.');
50
+ }
51
+ // accept permissions
52
+ await acceptButton.click();
53
+ // wait for login to complete
54
+ await acceptButton.waitFor({ state: 'detached' });
55
+ }
56
+ }
57
+ exports.SignInWithMicrosoftForm = SignInWithMicrosoftForm;
58
+ //# sourceMappingURL=sign-in-with-microsoft-form.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sign-in-with-microsoft-form.js","sourceRoot":"","sources":["../../src/sign-in/sign-in-with-microsoft-form.ts"],"names":[],"mappings":";;;AAAA,6EAAiE;AAGjE,6CAA6C;AAC7C,MAAa,uBAAwB,SAAQ,wCAAc;IACzD,YAAY,IAAU;QACpB,6CAA6C;QAC7C,2DAA2D;QAC3D,KAAK,CAAC,IAAI,EAAE,kCAAkC,CAAC,CAAC;QAGlD,kEAAkE;QACzD,iBAAY,GAAG,IAAI,CAAC,UAAU,CACrC,iDAAiD,CAClD,CAAC;IALF,CAAC;IAOD;;;;;;;;;;OAUG;IACH,KAAK,CAAC,YAAY,CAAC,WAGlB;QACC,MAAM,aAAa,GAAG,IAAI,CAAC,UAAU,CAAC,2BAA2B,CAAC,CAAC;QACnE,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,wBAAwB,CAAC,CAAC;QAC1D,MAAM,aAAa,GAAG,IAAI,CAAC,UAAU,CAAC,yBAAyB,CAAC,CAAC;QACjE,MAAM,YAAY,GAAG,IAAI,CAAC,UAAU,CAAC,2BAA2B,CAAC,CAAC;QAClE,mFAAmF;QACnF,MAAM,YAAY,GAAG,IAAI,CAAC,UAAU,CAAC,0BAA0B,CAAC,CAAC;QAEjE,iBAAiB;QACjB,MAAM,aAAa,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QAClD,MAAM,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAC/C,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;QACtB,IAAI;YACF,MAAM,YAAY,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;SAClD;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;SAClC;QAED,iBAAiB;QACjB,MAAM,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAC/C,MAAM,YAAY,CAAC,KAAK,EAAE,CAAC;QAC3B,IAAI;YACF,MAAM,YAAY,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;SAClD;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;SAClC;QAED,qBAAqB;QACrB,MAAM,YAAY,CAAC,KAAK,EAAE,CAAC;QAE3B,6BAA6B;QAC7B,MAAM,YAAY,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;IACpD,CAAC;CACF;AA3DD,0DA2DC"}
@@ -0,0 +1,2 @@
1
+ export * from './ui-shell-model';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui-selectors/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./ui-shell-model"), exports);
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ui-selectors/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mDAAiC"}
@@ -0,0 +1,80 @@
1
+ import { Breadcrumbs, Hub, LandingPageHeader, LandingPageTiles, PageHeader } from '@axinom/mosaic-e2e-ui-selectors';
2
+ import { Page } from 'playwright-core';
3
+ /**
4
+ * A model representing the Mosaic UI including methods for navigation.
5
+ * This model should be used for page and UI components which are provided by Mosaic as a service.
6
+ *
7
+ * Use this model to interact with:
8
+ * - The breadcrumbs bar (on any page)
9
+ * - The landing page
10
+ * - The settings hub page
11
+ * - Pages, settings or mod*a*ls of any managed service (Image, Video, Monetization, etc)
12
+ */
13
+ export declare class UiShellModel {
14
+ /** The playwright page object. */
15
+ protected readonly page: Page;
16
+ constructor(
17
+ /** The playwright page object. */
18
+ page: Page);
19
+ /** A model for the breadcrumbs bar. */
20
+ readonly breadcrumbs: Breadcrumbs;
21
+ /** A model for the header on the landing page. */
22
+ readonly landingPageHeader: LandingPageHeader;
23
+ /** A model for the landing page tiles. */
24
+ readonly landingPageTiles: LandingPageTiles;
25
+ /** A model for the settings page header. */
26
+ readonly settingsPageHeader: PageHeader;
27
+ /** A model for the settings pages navigation hub. */
28
+ readonly settingsPageHub: Hub;
29
+ /**
30
+ * This method navigates to the landing page breadcrumb.
31
+ * The management system must be loaded & signed in before using this method.
32
+ *
33
+ * The following steps will be taken:
34
+ * - Click the first (home) breadcrumb
35
+ * - Wait for a page transition to complete
36
+ */
37
+ navigateToBreadcrumbHome(): Promise<void>;
38
+ /**
39
+ * This method navigates to the 'previous' breadcrumb.
40
+ * The management system must be loaded & signed in before using this method.
41
+ *
42
+ * The following steps will be taken:
43
+ * - Click the last-but-one breadcrumb
44
+ * - Wait for a page transition to complete
45
+ */
46
+ navigateToBreadcrumbPrevious(): Promise<void>;
47
+ /**
48
+ * This method navigates to the 'refresh' breadcrumb.
49
+ * The management system must be loaded & signed in before using this method.
50
+ *
51
+ * The following steps will be taken:
52
+ * - Click the last breadcrumb
53
+ * - Wait for a page transition to complete
54
+ */
55
+ navigateToBreadcrumbRefresh(): Promise<void>;
56
+ /**
57
+ * This method navigates to a landing page tile by label.
58
+ * The management system must be loaded & signed in before using this method.
59
+ *
60
+ * The following steps will be taken:
61
+ * - Navigate to the home breadcrumb
62
+ * - Navigate to a tile by label
63
+ * - Wait for a page transition to complete
64
+ */
65
+ navigateToLandingPageTile(label: string): Promise<void>;
66
+ /**
67
+ * This method navigates to a settings page tile by label.
68
+ * The management system must be loaded & signed in before using this method.
69
+ *
70
+ * The following steps will be taken:
71
+ * - Navigate to the home breadcrumb
72
+ * - Navigate to the 'Settings' tile
73
+ * - Navigate to a tile by group label and tile label
74
+ * - Wait for a page transition to complete
75
+ */
76
+ navigateToSettingsTile(groupLabel: string, tileLabel: string): Promise<void>;
77
+ /** This method waits for a page transition to complete after navigation or page refresh. */
78
+ waitForPageTransition(): Promise<void>;
79
+ }
80
+ //# 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":"AAAA,OAAO,EACL,WAAW,EACX,GAAG,EACH,iBAAiB,EACjB,gBAAgB,EAChB,UAAU,EAEX,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC;;;;;;;;;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;IAE5D,4CAA4C;IAC5C,QAAQ,CAAC,kBAAkB,aAA6B;IAExD,qDAAqD;IACrD,QAAQ,CAAC,eAAe,MAAsB;IAE9C;;;;;;;OAOG;IACG,wBAAwB,IAAI,OAAO,CAAC,IAAI,CAAC;IAY/C;;;;;;;OAOG;IACG,4BAA4B,IAAI,OAAO,CAAC,IAAI,CAAC;IAYnD;;;;;;;OAOG;IACG,2BAA2B,IAAI,OAAO,CAAC,IAAI,CAAC;IAYlD;;;;;;;;OAQG;IACG,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAa7D;;;;;;;;;OASG;IACG,sBAAsB,CAC1B,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC;IAehB,4FAA4F;IACtF,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC;CAG7C"}