@axinom/mosaic-e2e-page-model 0.17.0-rc.4 → 0.17.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.
@@ -1,4 +1,5 @@
1
1
  import { GenericField } from '@axinom/mosaic-e2e-ui-selectors';
2
+ import { Locator } from 'playwright-core';
2
3
  /**
3
4
  * A model for a "Recurrence Period" form field which can be used to configure
4
5
  * the "Recurrence Period" field on payment plans. This is a custom FormField component.
@@ -17,8 +18,9 @@ import { GenericField } from '@axinom/mosaic-e2e-ui-selectors';
17
18
  export declare class PaymentPlanRecurrencePeriodField extends GenericField {
18
19
  /** @inheritdoc */
19
20
  protected get fieldTypeValidator(): string;
20
- readonly quantityInput: import("playwright-core").Locator;
21
- readonly unitInput: import("playwright-core").Locator;
21
+ readonly quantityInput: Locator;
22
+ readonly unitInput: Locator;
23
+ readonly option: (value: string) => Locator;
22
24
  /**
23
25
  * Sets values for both inputs of the recurrence period field.
24
26
  *
@@ -1 +1 @@
1
- {"version":3,"file":"payment-plan-recurrence-period-field.d.ts","sourceRoot":"","sources":["../../../src/managed-services/monetization-service/payment-plan-recurrence-period-field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D;;;;;;;;;;;;;;GAcG;AACH,qBAAa,gCAAiC,SAAQ,YAAY;IAChE,kBAAkB;IAClB,cAAuB,kBAAkB,IAAI,MAAM,CAElD;IAED,QAAQ,CAAC,aAAa,oCAEpB;IACF,QAAQ,CAAC,SAAS,oCAAwD;IAE1E;;;;;OAKG;IACG,SAAS,CACb,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,GAClD,OAAO,CAAC,IAAI,CAAC;CAKjB"}
1
+ {"version":3,"file":"payment-plan-recurrence-period-field.d.ts","sourceRoot":"","sources":["../../../src/managed-services/monetization-service/payment-plan-recurrence-period-field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C;;;;;;;;;;;;;;GAcG;AACH,qBAAa,gCAAiC,SAAQ,YAAY;IAChE,kBAAkB;IAClB,cAAuB,kBAAkB,IAAI,MAAM,CAElD;IAED,QAAQ,CAAC,aAAa,UAEpB;IAEF,QAAQ,CAAC,SAAS,UAA4C;IAE9D,QAAQ,CAAC,MAAM,UAAW,MAAM,KAAG,OAAO,CAGtC;IAEJ;;;;;OAKG;IACG,SAAS,CACb,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,GAClD,OAAO,CAAC,IAAI,CAAC;CASjB"}
@@ -21,7 +21,8 @@ class PaymentPlanRecurrencePeriodField extends mosaic_e2e_ui_selectors_1.Generic
21
21
  constructor() {
22
22
  super(...arguments);
23
23
  this.quantityInput = this.content.locator('//input[@name="periodQuantity"]');
24
- this.unitInput = this.content.locator('//select[@name="periodUnit"]');
24
+ this.unitInput = this.getLocator('//*[@id="periodUnit"]');
25
+ this.option = (value) => this.getGlobalLocator(`//li[@role="option" and normalize-space(text())="${value}"]`);
25
26
  }
26
27
  /** @inheritdoc */
27
28
  get fieldTypeValidator() {
@@ -36,7 +37,11 @@ class PaymentPlanRecurrencePeriodField extends mosaic_e2e_ui_selectors_1.Generic
36
37
  async setValues(quantity, unit) {
37
38
  await this.verifyFieldType();
38
39
  await this.quantityInput.fill(quantity.toString());
39
- await this.unitInput.selectOption({ label: unit });
40
+ await this.unitInput.click();
41
+ await this.unitInput.fill(unit);
42
+ const optionElement = this.option(unit);
43
+ await optionElement.waitFor({ state: 'visible' });
44
+ await optionElement.click();
40
45
  }
41
46
  }
42
47
  exports.PaymentPlanRecurrencePeriodField = PaymentPlanRecurrencePeriodField;
@@ -1 +1 @@
1
- {"version":3,"file":"payment-plan-recurrence-period-field.js","sourceRoot":"","sources":["../../../src/managed-services/monetization-service/payment-plan-recurrence-period-field.ts"],"names":[],"mappings":";;;AAAA,6EAA+D;AAE/D;;;;;;;;;;;;;;GAcG;AACH,MAAa,gCAAiC,SAAQ,sCAAY;IAAlE;;QAMW,kBAAa,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAC3C,iCAAiC,CAClC,CAAC;QACO,cAAS,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,8BAA8B,CAAC,CAAC;IAgB5E,CAAC;IAxBC,kBAAkB;IAClB,IAAuB,kBAAkB;QACvC,OAAO,qDAAqD,CAAC;IAC/D,CAAC;IAOD;;;;;OAKG;IACH,KAAK,CAAC,SAAS,CACb,QAAgB,EAChB,IAAmD;QAEnD,MAAM,IAAI,CAAC,eAAe,EAAE,CAAC;QAC7B,MAAM,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;QACnD,MAAM,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACrD,CAAC;CACF;AAzBD,4EAyBC"}
1
+ {"version":3,"file":"payment-plan-recurrence-period-field.js","sourceRoot":"","sources":["../../../src/managed-services/monetization-service/payment-plan-recurrence-period-field.ts"],"names":[],"mappings":";;;AAAA,6EAA+D;AAG/D;;;;;;;;;;;;;;GAcG;AACH,MAAa,gCAAiC,SAAQ,sCAAY;IAAlE;;QAMW,kBAAa,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAC3C,iCAAiC,CAClC,CAAC;QAEO,cAAS,GAAG,IAAI,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAAC;QAErD,WAAM,GAAG,CAAC,KAAa,EAAW,EAAE,CAC3C,IAAI,CAAC,gBAAgB,CACnB,oDAAoD,KAAK,IAAI,CAC9D,CAAC;IAoBN,CAAC;IAlCC,kBAAkB;IAClB,IAAuB,kBAAkB;QACvC,OAAO,qDAAqD,CAAC;IAC/D,CAAC;IAaD;;;;;OAKG;IACH,KAAK,CAAC,SAAS,CACb,QAAgB,EAChB,IAAmD;QAEnD,MAAM,IAAI,CAAC,eAAe,EAAE,CAAC;QAC7B,MAAM,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;QACnD,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;QAC7B,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChC,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACxC,MAAM,aAAa,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QAClD,MAAM,aAAa,CAAC,KAAK,EAAE,CAAC;IAC9B,CAAC;CACF;AAnCD,4EAmCC"}
@@ -1 +1 @@
1
- {"version":3,"file":"payment-provider-settings-field.d.ts","sourceRoot":"","sources":["../../../src/managed-services/monetization-service/payment-provider-settings-field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,4BAA6B,SAAQ,YAAY;IAC5D,kBAAkB;IAClB,cAAuB,kBAAkB,IAAI,MAAM,CAElD;IAED;;;;OAIG;IACG,kBAAkB,CAAC,oBAAoB,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAsBrE;;;;;OAKG;IACG,aAAa,CACjB,oBAAoB,EAAE,MAAM,EAC5B,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC;CAejB"}
1
+ {"version":3,"file":"payment-provider-settings-field.d.ts","sourceRoot":"","sources":["../../../src/managed-services/monetization-service/payment-provider-settings-field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,4BAA6B,SAAQ,YAAY;IAC5D,kBAAkB;IAClB,cAAuB,kBAAkB,IAAI,MAAM,CAElD;IAED;;;;OAIG;IACG,kBAAkB,CAAC,oBAAoB,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBrE;;;;;OAKG;IACG,aAAa,CACjB,oBAAoB,EAAE,MAAM,EAC5B,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC;CAejB"}
@@ -29,18 +29,18 @@ class PaymentProviderSettingsField extends mosaic_e2e_ui_selectors_1.GenericFiel
29
29
  * @param paymentProviderTitle Label for the payment provider. e.g. 'PayPal'
30
30
  */
31
31
  async addPaymentProvider(paymentProviderTitle) {
32
- const providerSelect = this.getLocator('//*[@data-test-id="payment-provider-selection-row"]//select');
33
- const providerAddButton = this.getLocator('//*[@data-test-id="payment-provider-selection-row"]//button');
32
+ const providerSelect = this.getLocator('//input[@id="addPaymentProvider"]');
33
+ const providerOption = this.getGlobalLocator(`//li[normalize-space(text())='${paymentProviderTitle}']`);
34
+ const providerAddButton = this.getLocator('//button[@data-test-id="payment-provider-add-button"]');
34
35
  await this.verifyFieldType();
35
36
  try {
36
- await providerSelect
37
- .locator(`//option[text()="${paymentProviderTitle}"]`)
38
- .waitFor({ state: 'attached' });
37
+ await providerSelect.click();
38
+ await providerOption.waitFor({ state: 'attached' });
39
39
  }
40
40
  catch (_a) {
41
41
  throw new Error(`Could not add payment provider '${paymentProviderTitle}'. Is the payment provider enabled for this environment and not already added to this plan?`);
42
42
  }
43
- await providerSelect.selectOption({ label: paymentProviderTitle });
43
+ await providerOption.click();
44
44
  await providerAddButton.click();
45
45
  }
46
46
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"payment-provider-settings-field.js","sourceRoot":"","sources":["../../../src/managed-services/monetization-service/payment-provider-settings-field.ts"],"names":[],"mappings":";;;AAAA,6EAA+D;AAE/D;;;;;;;;;;;;;;;GAeG;AACH,MAAa,4BAA6B,SAAQ,sCAAY;IAC5D,kBAAkB;IAClB,IAAuB,kBAAkB;QACvC,OAAO,qGAAqG,CAAC;IAC/G,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,kBAAkB,CAAC,oBAA4B;QACnD,MAAM,cAAc,GAAG,IAAI,CAAC,UAAU,CACpC,6DAA6D,CAC9D,CAAC;QACF,MAAM,iBAAiB,GAAG,IAAI,CAAC,UAAU,CACvC,6DAA6D,CAC9D,CAAC;QAEF,MAAM,IAAI,CAAC,eAAe,EAAE,CAAC;QAC7B,IAAI;YACF,MAAM,cAAc;iBACjB,OAAO,CAAC,oBAAoB,oBAAoB,IAAI,CAAC;iBACrD,OAAO,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;SACnC;QAAC,WAAM;YACN,MAAM,IAAI,KAAK,CACb,mCAAmC,oBAAoB,6FAA6F,CACrJ,CAAC;SACH;QACD,MAAM,cAAc,CAAC,YAAY,CAAC,EAAE,KAAK,EAAE,oBAAoB,EAAE,CAAC,CAAC;QACnE,MAAM,iBAAiB,CAAC,KAAK,EAAE,CAAC;IAClC,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,aAAa,CACjB,oBAA4B,EAC5B,UAAkB;QAElB,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAC3B,8CAA8C,oBAAoB,0CAA0C,CAC7G,CAAC;QAEF,MAAM,IAAI,CAAC,eAAe,EAAE,CAAC;QAC7B,IAAI;YACF,MAAM,KAAK,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;SAC3C;QAAC,WAAM;YACN,MAAM,IAAI,KAAK,CACb,oDAAoD,oBAAoB,qEAAqE,CAC9I,CAAC;SACH;QACD,MAAM,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC/B,CAAC;CACF;AAzDD,oEAyDC"}
1
+ {"version":3,"file":"payment-provider-settings-field.js","sourceRoot":"","sources":["../../../src/managed-services/monetization-service/payment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AAI,CAAC,UAAU,CAAC,CAAC;IAC/B,CAAC;CACF;AAxDD,oEAwDC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axinom/mosaic-e2e-page-model",
3
- "version": "0.17.0-rc.4",
3
+ "version": "0.17.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.16.0-rc.4"
25
+ "@axinom/mosaic-e2e-ui-selectors": "^0.16.0-rc.6"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/node": "^18.11.18",
@@ -35,5 +35,5 @@
35
35
  "publishConfig": {
36
36
  "access": "public"
37
37
  },
38
- "gitHead": "6b7371f3ae6db64b9ba831680b4a0af604e38372"
38
+ "gitHead": "443722dfff104c670fa9ad27b9ecddc84663d75d"
39
39
  }
@@ -1,4 +1,5 @@
1
1
  import { GenericField } from '@axinom/mosaic-e2e-ui-selectors';
2
+ import { Locator } from 'playwright-core';
2
3
 
3
4
  /**
4
5
  * A model for a "Recurrence Period" form field which can be used to configure
@@ -24,7 +25,13 @@ export class PaymentPlanRecurrencePeriodField extends GenericField {
24
25
  readonly quantityInput = this.content.locator(
25
26
  '//input[@name="periodQuantity"]',
26
27
  );
27
- readonly unitInput = this.content.locator('//select[@name="periodUnit"]');
28
+
29
+ readonly unitInput = this.getLocator('//*[@id="periodUnit"]');
30
+
31
+ readonly option = (value: string): Locator =>
32
+ this.getGlobalLocator(
33
+ `//li[@role="option" and normalize-space(text())="${value}"]`,
34
+ );
28
35
 
29
36
  /**
30
37
  * Sets values for both inputs of the recurrence period field.
@@ -38,6 +45,10 @@ export class PaymentPlanRecurrencePeriodField extends GenericField {
38
45
  ): Promise<void> {
39
46
  await this.verifyFieldType();
40
47
  await this.quantityInput.fill(quantity.toString());
41
- await this.unitInput.selectOption({ label: unit });
48
+ await this.unitInput.click();
49
+ await this.unitInput.fill(unit);
50
+ const optionElement = this.option(unit);
51
+ await optionElement.waitFor({ state: 'visible' });
52
+ await optionElement.click();
42
53
  }
43
54
  }
@@ -28,24 +28,23 @@ export class PaymentProviderSettingsField extends GenericField {
28
28
  * @param paymentProviderTitle Label for the payment provider. e.g. 'PayPal'
29
29
  */
30
30
  async addPaymentProvider(paymentProviderTitle: string): Promise<void> {
31
- const providerSelect = this.getLocator(
32
- '//*[@data-test-id="payment-provider-selection-row"]//select',
31
+ const providerSelect = this.getLocator('//input[@id="addPaymentProvider"]');
32
+ const providerOption = this.getGlobalLocator(
33
+ `//li[normalize-space(text())='${paymentProviderTitle}']`,
33
34
  );
34
35
  const providerAddButton = this.getLocator(
35
- '//*[@data-test-id="payment-provider-selection-row"]//button',
36
+ '//button[@data-test-id="payment-provider-add-button"]',
36
37
  );
37
-
38
38
  await this.verifyFieldType();
39
39
  try {
40
- await providerSelect
41
- .locator(`//option[text()="${paymentProviderTitle}"]`)
42
- .waitFor({ state: 'attached' });
40
+ await providerSelect.click();
41
+ await providerOption.waitFor({ state: 'attached' });
43
42
  } catch {
44
43
  throw new Error(
45
44
  `Could not add payment provider '${paymentProviderTitle}'. Is the payment provider enabled for this environment and not already added to this plan?`,
46
45
  );
47
46
  }
48
- await providerSelect.selectOption({ label: paymentProviderTitle });
47
+ await providerOption.click();
49
48
  await providerAddButton.click();
50
49
  }
51
50