@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,459 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MonetizationService = void 0;
4
+ const mosaic_e2e_ui_selectors_1 = require("@axinom/mosaic-e2e-ui-selectors");
5
+ const managed_service_model_1 = require("./managed-service-model");
6
+ const payment_provider_settings_field_1 = require("./payment-provider-settings-field");
7
+ /** A model for the managed monetization service. */
8
+ class MonetizationService extends managed_service_model_1.ManagedServiceModel {
9
+ /** Verify the URL is a subscription plan details station. */
10
+ async verifySubscriptionPlanDetailsUrl() {
11
+ try {
12
+ await this.page.waitForURL(/\/monetization\/subscriptionplans\/[\w-]{36}$/);
13
+ }
14
+ catch (_a) {
15
+ throw new Error('The subscription plan details station must be loaded before using this method.');
16
+ }
17
+ }
18
+ /** Verify the URL is a payment plan details station. */
19
+ async verifyPaymentPlanDetailsUrl() {
20
+ try {
21
+ await this.page.waitForURL(/\/monetization\/subscriptionplans\/[\w-]{36}\/paymentplans\/[\w-]{36}$/);
22
+ }
23
+ catch (_a) {
24
+ throw new Error('The payment plan details station must be loaded before using this method.');
25
+ }
26
+ }
27
+ /** Verify the URL is a claim set details station. */
28
+ async verifyClaimSetDetailsUrl() {
29
+ try {
30
+ await this.page.waitForURL(/\/monetization\/claimsets\/\d+$/);
31
+ }
32
+ catch (_a) {
33
+ throw new Error('The claim set details station must be loaded before using this method.');
34
+ }
35
+ }
36
+ /**
37
+ * This method navigates to the subscription plans explorer station.
38
+ * The management system must be loaded & signed in before using this method.
39
+ *
40
+ * The following steps will be taken:
41
+ * - Navigate to the home breadcrumb, then tiles: 'Monetization', 'Subscription Plans'
42
+ * - Wait for the page transition to complete
43
+ */
44
+ async navigateToSubscriptionPlans() {
45
+ const { hub, list } = this.uiManagedWorkflows;
46
+ await this.uiShell.navigateToLandingPageTile('Monetization');
47
+ // click subscription plans tile
48
+ const label = 'Subscription Plans';
49
+ const tile = hub.getGroup(1).getTileByLabel(label);
50
+ try {
51
+ await tile.getLocator().waitFor({ state: 'visible' });
52
+ }
53
+ catch (_a) {
54
+ throw new Error(`Monetization hub tile '${label}' is not visible.`);
55
+ }
56
+ await tile.anchor.click();
57
+ await this.uiShell.waitForPageTransition();
58
+ await list.waitForData();
59
+ }
60
+ /**
61
+ * This method navigates to the claim sets explorer station.
62
+ * The management system must be loaded & signed in before using this method.
63
+ *
64
+ * The following steps will be taken:
65
+ * - Navigate to the home breadcrumb, then tiles: 'Monetization', 'Claim Sets'
66
+ * - Wait for the page transition to complete
67
+ */
68
+ async navigateToClaimSets() {
69
+ const { hub, list } = this.uiManagedWorkflows;
70
+ await this.uiShell.navigateToLandingPageTile('Monetization');
71
+ // click claim sets tile
72
+ const label = 'Claim Sets';
73
+ const tile = hub.getGroup(1).getTileByLabel(label);
74
+ try {
75
+ await tile.getLocator().waitFor({ state: 'visible' });
76
+ }
77
+ catch (_a) {
78
+ throw new Error(`Monetization hub tile '${label}' is not visible.`);
79
+ }
80
+ await tile.anchor.click();
81
+ await this.uiShell.waitForPageTransition();
82
+ await list.waitForData();
83
+ }
84
+ /**
85
+ * This method navigates to a subscription plan details station by title.
86
+ * The management system must be loaded & signed in before using this method.
87
+ * If there is not exactly one matching subscription plan an exception will be raised.
88
+ *
89
+ * The following steps will be taken:
90
+ * - Navigate to the home breadcrumb, then tiles: 'Monetization', 'Subscription Plans'
91
+ * - Filter by title and verify that a single result is shown
92
+ * - Click the subscription plan row action
93
+ * - Wait for the subscription plan details page to load
94
+ */
95
+ async navigateToSubscriptionPlanDetails(filterBy) {
96
+ const { list, filters, form } = this.uiManagedWorkflows;
97
+ await this.navigateToSubscriptionPlans();
98
+ // filter to the item
99
+ await filters
100
+ .getFilterByName('title')
101
+ .asFreeTextFilter()
102
+ .setValue(filterBy.title);
103
+ await list.waitForData();
104
+ // Verify that there is exactly one matching row
105
+ if ((await list.allVisibleRows.count()) !== 1) {
106
+ throw new Error(`Failed to find exactly one subscription plan with title '${filterBy.title}'.`);
107
+ }
108
+ // navigate
109
+ await list.getRow(1).actionButton.click();
110
+ await this.uiShell.waitForPageTransition();
111
+ await form.waitForData();
112
+ }
113
+ /**
114
+ * This method navigates to a claim set details station by unique key.
115
+ * The management system must be loaded & signed in before using this method.
116
+ * If there is not exactly one matching claim set an exception will be raised.
117
+ *
118
+ * The following steps will be taken:
119
+ * - Navigate to the home breadcrumb, then tiles: 'Monetization', 'Claim Sets'
120
+ * - Filter by unique key and verify that a single result is shown
121
+ * - Click the claim set row action
122
+ * - Wait for the claim set details station to load
123
+ */
124
+ async navigateToClaimSetDetails(filterBy) {
125
+ const { list, filters, form } = this.uiManagedWorkflows;
126
+ await this.navigateToClaimSets();
127
+ // filter to the item
128
+ await filters
129
+ .getFilterByName('key')
130
+ .asFreeTextFilter()
131
+ .setValue(filterBy.uniqueKey);
132
+ await list.waitForData();
133
+ // Verify that there is exactly one matching row
134
+ if ((await list.allVisibleRows.count()) !== 1) {
135
+ throw new Error(`Failed to find exactly one claim set with unique key '${filterBy.uniqueKey}'.`);
136
+ }
137
+ // navigate
138
+ await list.getRow(1).actionButton.click();
139
+ await this.uiShell.waitForPageTransition();
140
+ await form.waitForData();
141
+ }
142
+ /**
143
+ * This method creates a new subscription plan.
144
+ * The management system must be loaded & signed in before using this method.
145
+ * When this method completes, the new subscription plan details station will be loaded.
146
+ *
147
+ * The following steps will be taken:
148
+ * - Navigate to the home breadcrumb, then tiles: 'Monetization', 'Subscription Plans'
149
+ * - Click 'NEW', enter the title then click 'Proceed'
150
+ * - Wait for the subscription plan details station to load
151
+ */
152
+ async createSubscriptionPlan(properties) {
153
+ const { form, actions, pageHeader } = this.uiManagedWorkflows;
154
+ await this.navigateToSubscriptionPlans();
155
+ // Create a new Subscription Plan
156
+ await pageHeader.actions.getActionByLabel('NEW').click();
157
+ await form
158
+ .getFieldByName('title')
159
+ .asSingleLineTextField()
160
+ .setValue(properties.title);
161
+ await actions.getActionByLabel(mosaic_e2e_ui_selectors_1.ActionLabel.Proceed).click();
162
+ await this.uiShell.waitForPageTransition();
163
+ await form.waitForData();
164
+ }
165
+ /**
166
+ * This method configures a payment provider for the subscription plan.
167
+ * The subscription plan details station must be loaded before using this method.
168
+ * If the payment provider is not enabled for the environment, or is already added an exception will be raised.
169
+ *
170
+ * The following steps will be taken:
171
+ * - Verify that a subscription plan details station is loaded
172
+ * - Add a payment provider by key, and set the external Id field (if it is shown).
173
+ * - Click the 'refresh' breadcrumb and wait for the subscription plan details station to reload
174
+ */
175
+ async subscriptionPlanAddPaymentProvider(paymentProviderSettings) {
176
+ const { form } = this.uiManagedWorkflows;
177
+ const { providerKey, externalId } = paymentProviderSettings;
178
+ await this.verifySubscriptionPlanDetailsUrl();
179
+ const providerSettingsField = form
180
+ .getFieldByLabel('Payment Providers & Settings')
181
+ .as(payment_provider_settings_field_1.PaymentProviderSettingsField);
182
+ await providerSettingsField.addPaymentProvider(providerKey);
183
+ if (externalId !== undefined) {
184
+ await providerSettingsField.setExternalId(providerKey, externalId);
185
+ }
186
+ // Refresh to save
187
+ await this.uiShell.navigateToBreadcrumbRefresh();
188
+ await form.waitForData();
189
+ }
190
+ /**
191
+ * This method assigns a claim set to the subscription plan.
192
+ * The subscription plan details station must be loaded before using this method.
193
+ * If the claim set does not exist, or is already added to this subscription plan then an exception will be raised.
194
+ *
195
+ * The following steps will be taken:
196
+ * - Verify that a subscription plan details station is loaded
197
+ * - Click 'Claim Sets'
198
+ * - Open the claim sets explorer modal, filter by key and select the first result
199
+ * - Click the 'previous' breadcrumb and wait for the subscription plan details station to load
200
+ */
201
+ async subscriptionPlanAssignClaimSet(claimSetKey) {
202
+ const { actions, form } = this.uiManagedWorkflows;
203
+ await this.verifySubscriptionPlanDetailsUrl();
204
+ // Associate the claim set we created in the previous test
205
+ await actions.getActionByLabel('Manage Claim Sets').click();
206
+ await form
207
+ .getFieldByLabel('Claim Sets')
208
+ .asDynamicDataListField()
209
+ .dataList.dataEntryRow.addButton.click();
210
+ const modal = form.modal.asSelectionExplorer();
211
+ await modal.filters
212
+ .getFilterByName('key')
213
+ .asFreeTextFilter()
214
+ .setValue(claimSetKey);
215
+ await modal.list.waitForData();
216
+ await modal.list.getRow(1).selectButton.click();
217
+ // Back to subscription plan details
218
+ await this.uiShell.navigateToBreadcrumbPrevious();
219
+ await form.waitForData();
220
+ }
221
+ /**
222
+ * This method publishes the subscription plan.
223
+ * The subscription plan details station must be loaded before using this method.
224
+ * If the subscription plan cannot be published then an exception will be raised.
225
+ *
226
+ * The following steps will be taken:
227
+ * - Verify that a subscription plan details station is loaded
228
+ * - Click 'Publishing'
229
+ * - Click 'Publish' and confirm
230
+ * - Wait for the subscription plan details station to load and verify that the publication state is 'PUBLISHED'
231
+ */
232
+ async subscriptionPlanPublish() {
233
+ const { form, actions, infoPanel } = this.uiManagedWorkflows;
234
+ await this.verifySubscriptionPlanDetailsUrl();
235
+ await actions.getActionByLabel('Publishing').click();
236
+ await this.uiShell.waitForPageTransition();
237
+ const publishButton = actions.getActionByLabel('Publish');
238
+ try {
239
+ await publishButton.waitFor({ state: 'visible' });
240
+ }
241
+ catch (_a) {
242
+ throw new Error('Subscription plan could not be published. Are there validation errors?');
243
+ }
244
+ await publishButton.click();
245
+ await actions.confirmButton.click();
246
+ await form.waitForData();
247
+ }
248
+ /**
249
+ * This method creates a new payment plan owned by the subscription plan.
250
+ * The subscription plan details station must be loaded before using this method.
251
+ *
252
+ * The following steps will be taken:
253
+ * - Verify that a subscription plan details station is loaded
254
+ * - Click 'Payment Plans' then click 'NEW'
255
+ * - Enter the title and click 'Proceed'
256
+ * - Edit the recurrence period fields
257
+ * - Click the 'refresh' breadcrumb and wait for the payment plan details station to reload
258
+ */
259
+ async subscriptionPlanCreatePaymentPlan(properties) {
260
+ const { actions, pageHeader, form } = this.uiManagedWorkflows;
261
+ await this.verifySubscriptionPlanDetailsUrl();
262
+ // Create a new Payment Plan
263
+ await actions.getActionByLabel('Payment Plans').click();
264
+ await this.uiShell.waitForPageTransition();
265
+ await pageHeader.actions.getActionByLabel('NEW').click();
266
+ await form
267
+ .getFieldByName('title')
268
+ .asSingleLineTextField()
269
+ .setValue(properties.title);
270
+ await actions.getActionByLabel(mosaic_e2e_ui_selectors_1.ActionLabel.Proceed).click();
271
+ // Set recurrence period
272
+ await form
273
+ .getFieldByLabel('Recurrence Period')
274
+ .getLocator('//input[@name="periodQuantity"]')
275
+ .fill(properties.recurrencePeriodQuantity.toString());
276
+ await form
277
+ .getFieldByLabel('Recurrence Period')
278
+ .getLocator('//select[@name="periodUnit"]')
279
+ .selectOption(properties.recurrencePeriodUnit);
280
+ // refresh to save
281
+ await this.uiShell.navigateToBreadcrumbRefresh();
282
+ await form.waitForData();
283
+ }
284
+ /**
285
+ * This method configures a payment provider for the payment plan.
286
+ * The subscription plan details station must be loaded before using this method.
287
+ * If the payment provider is not added to the parent subscription plan, or is already added to this payment plan then an exception will be raised.
288
+ *
289
+ * The following steps will be taken:
290
+ * - Verify that a payment plan details station is loaded
291
+ * - Add a payment provider by key, and set the external Id field (if it is shown).
292
+ * - Click the 'refresh' breadcrumb and wait for the payment plan details station to reload.
293
+ */
294
+ async paymentPlanAddPaymentProvider(paymentProviderSettings) {
295
+ const { form } = this.uiManagedWorkflows;
296
+ const { providerKey, externalId } = paymentProviderSettings;
297
+ await this.verifyPaymentPlanDetailsUrl();
298
+ const providerSettingsField = form
299
+ .getFieldByLabel('Payment Providers & Settings')
300
+ .as(payment_provider_settings_field_1.PaymentProviderSettingsField);
301
+ await providerSettingsField.addPaymentProvider(providerKey);
302
+ if (externalId !== undefined) {
303
+ await providerSettingsField.setExternalId(providerKey, externalId);
304
+ }
305
+ // Refresh to save
306
+ await this.uiShell.navigateToBreadcrumbRefresh();
307
+ await form.waitForData();
308
+ }
309
+ /**
310
+ * This method sets a price for the payment plan for a specific country.
311
+ * The payment plan details station must be loaded before using this method.
312
+ *
313
+ * The following steps will be taken:
314
+ * - Verify that a payment plan details station is loaded
315
+ * - Click 'Price per Country'
316
+ * - Enter new price details and click the add button
317
+ * - Click the 'previous' breadcrumb and wait for the payment plan details station to load
318
+ */
319
+ async paymentPlanAddPrice(pricePerCountry) {
320
+ const { form, actions } = this.uiManagedWorkflows;
321
+ const { country, currency, price } = pricePerCountry;
322
+ await this.verifyPaymentPlanDetailsUrl();
323
+ // Add prices
324
+ await actions.getActionByLabel('Price per Country').click();
325
+ await this.uiShell.waitForPageTransition();
326
+ const dataList = form.getField(1).asDynamicDataListField().dataList;
327
+ await dataList.dataEntryRow.getCell(1).select.selectOption(country);
328
+ await dataList.dataEntryRow.getCell(2).input.fill(price.toString());
329
+ await dataList.dataEntryRow.getCell(3).select.selectOption(currency);
330
+ await dataList.dataEntryRow.addButton.click();
331
+ await dataList.waitForData();
332
+ // Navigate back to the parent payment plan
333
+ await this.uiShell.navigateToBreadcrumbPrevious();
334
+ await form.waitForData();
335
+ }
336
+ /**
337
+ * This method creates a new claim set.
338
+ * The management system must be loaded & signed in before using this method.
339
+ * When this method completes, the new claim set details station will be loaded.
340
+ *
341
+ * The following steps will be taken:
342
+ * - Navigate to the home breadcrumb, then tiles: 'Monetization', 'Claim Sets'
343
+ * - Click 'NEW', enter the title and key then click 'Proceed'
344
+ * - Wait for the claim set details station to load
345
+ */
346
+ async createClaimSet(properties) {
347
+ const { form, pageHeader, actions } = this.uiManagedWorkflows;
348
+ await this.navigateToClaimSets();
349
+ await pageHeader.actions.getActionByLabel('NEW').click();
350
+ await this.uiShell.waitForPageTransition();
351
+ await form
352
+ .getFieldByName('title')
353
+ .asSingleLineTextField()
354
+ .setValue(properties.title);
355
+ await form
356
+ .getFieldByName('key')
357
+ .asSingleLineTextField()
358
+ .setValue(properties.key);
359
+ await actions.getActionByLabel(mosaic_e2e_ui_selectors_1.ActionLabel.Proceed).click();
360
+ await this.uiShell.waitForPageTransition();
361
+ await form.waitForData();
362
+ }
363
+ /**
364
+ * This method assigns claims to a claim set.
365
+ * This claim set details station must be loaded before using this method.
366
+ * NOTE: Only claims which can be added by radio or checkbox are supported.
367
+ *
368
+ * The following steps will be taken:
369
+ * - Verify that a claim set details station is loaded
370
+ * - Click 'Claims'
371
+ * - Add each claim by checkbox or radio button
372
+ * - Click the 'previous' breadcrumb and wait for the claim set details station to load
373
+ */
374
+ async claimSetAssignClaims(claims) {
375
+ const { form, accordion, actions } = this.uiManagedWorkflows;
376
+ await this.verifyClaimSetDetailsUrl();
377
+ // Open claims editor
378
+ await actions.getActionByLabel('Claims').click();
379
+ await this.uiShell.waitForPageTransition();
380
+ // Select each claim
381
+ for (const claim of claims) {
382
+ const input = accordion.getLocator(`//input[@name="${claim}"]`);
383
+ try {
384
+ await input.waitFor({ state: 'visible' });
385
+ }
386
+ catch (_a) {
387
+ throw new Error(`A radio or checkbox for for claim '${claim}' is not visible. Selecting claims by modal is not supported.`);
388
+ }
389
+ await input.check();
390
+ }
391
+ // Back to claim set details
392
+ await this.uiShell.navigateToBreadcrumbPrevious();
393
+ await form.waitForData();
394
+ }
395
+ /**
396
+ * This method publishes a claim set.
397
+ * The claim set details station must be loaded before using this method.
398
+ * If the claim set cannot be published then an exception will be raised.
399
+ *
400
+ * The following steps will be taken:
401
+ * - Verify that a claim set details station is loaded
402
+ * - Click 'Publishing'
403
+ * - Click 'Publish' and confirm
404
+ * - Wait for the claim set details station to load and verify that the publication state is 'PUBLISHED'
405
+ */
406
+ async claimSetPublish() {
407
+ const { form, actions, infoPanel } = this.uiManagedWorkflows;
408
+ await this.verifyClaimSetDetailsUrl();
409
+ await actions.getActionByLabel('Publishing').click();
410
+ await this.uiShell.waitForPageTransition();
411
+ const publishButton = actions.getActionByLabel('Publish');
412
+ try {
413
+ await publishButton.waitFor({ state: 'visible' });
414
+ }
415
+ catch (_a) {
416
+ throw new Error('Claim set could not be published. Are there validation errors?');
417
+ }
418
+ await publishButton.click();
419
+ await actions.confirmButton.click();
420
+ await form.waitForData();
421
+ }
422
+ /**
423
+ * This method deletes a claim set by unique key.
424
+ * The management system must be loaded & signed in before using this method.
425
+ * If the claim set is published then it will first be unpublished.
426
+ * If the claim set cannot be deleted then an exception will be raised.
427
+ *
428
+ * The following steps will be taken:
429
+ * - Navigate to the home breadcrumb, then tiles: 'Monetization', 'Claim Sets'
430
+ * - Filter by unique key and verify that a single result is shown
431
+ * - Navigate to the claim set with the row action
432
+ * - If the action is shown, click 'Unpublish' and confirm
433
+ * - Click 'Delete' and confirm
434
+ * - Wait for the claim sets explorer to load
435
+ */
436
+ async deleteClaimSet(filterBy) {
437
+ const { actions, list } = this.uiManagedWorkflows;
438
+ await this.navigateToClaimSetDetails(filterBy);
439
+ // Unpublish the claim set if published
440
+ if (await actions.getActionByLabel('Unpublish').isVisible()) {
441
+ await actions.getActionByLabel('Unpublish').click();
442
+ await actions.confirmButton.click();
443
+ }
444
+ // Delete the claim set
445
+ try {
446
+ await actions.getActionByLabel('Delete').waitFor({ state: 'visible' });
447
+ }
448
+ catch (_a) {
449
+ throw new Error(`The claim set delete button is not visible`);
450
+ }
451
+ await actions.getActionByLabel('Delete').click();
452
+ await actions.confirmButton.click();
453
+ // Wait for claim sets explorer to load
454
+ await this.uiShell.waitForPageTransition();
455
+ await list.waitForData();
456
+ }
457
+ }
458
+ exports.MonetizationService = MonetizationService;
459
+ //# sourceMappingURL=monetization-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"monetization-service.js","sourceRoot":"","sources":["../../src/managed-services/monetization-service.ts"],"names":[],"mappings":";;;AAAA,6EAA8D;AAC9D,mEAA8D;AAC9D,uFAAiF;AAEjF,oDAAoD;AACpD,MAAa,mBAAoB,SAAQ,2CAAmB;IAC1D,6DAA6D;IACrD,KAAK,CAAC,gCAAgC;QAC5C,IAAI;YACF,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,CACxB,+CAA+C,CAChD,CAAC;SACH;QAAC,WAAM;YACN,MAAM,IAAI,KAAK,CACb,gFAAgF,CACjF,CAAC;SACH;IACH,CAAC;IAED,wDAAwD;IAChD,KAAK,CAAC,2BAA2B;QACvC,IAAI;YACF,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,CACxB,wEAAwE,CACzE,CAAC;SACH;QAAC,WAAM;YACN,MAAM,IAAI,KAAK,CACb,2EAA2E,CAC5E,CAAC;SACH;IACH,CAAC;IAED,q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EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,kBAAkB,CAAC;QAClD,MAAM,IAAI,CAAC,yBAAyB,CAAC,QAAQ,CAAC,CAAC;QAE/C,uCAAuC;QACvC,IAAI,MAAM,OAAO,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC,SAAS,EAAE,EAAE;YAC3D,MAAM,OAAO,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC,KAAK,EAAE,CAAC;YACpD,MAAM,OAAO,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;SACrC;QAED,uBAAuB;QACvB,IAAI;YACF,MAAM,OAAO,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;SACxE;QAAC,WAAM;YACN,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;SAC/D;QACD,MAAM,OAAO,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,CAAC;QACjD,MAAM,OAAO,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;QAEpC,uCAAuC;QACvC,MAAM,IAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC;QAC3C,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;IAC3B,CAAC;CACF;AAjhBD,kDAihBC"}
@@ -0,0 +1,7 @@
1
+ import { GenericField } from '@axinom/mosaic-e2e-ui-selectors';
2
+ /** A model for a payment provider settings form field. */
3
+ export declare class PaymentProviderSettingsField extends GenericField {
4
+ addPaymentProvider(paymentProviderKey: string): Promise<void>;
5
+ setExternalId(paymentProviderKey: string, externalId: string): Promise<void>;
6
+ }
7
+ //# sourceMappingURL=payment-provider-settings-field.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment-provider-settings-field.d.ts","sourceRoot":"","sources":["../../src/managed-services/payment-provider-settings-field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,0DAA0D;AAC1D,qBAAa,4BAA6B,SAAQ,YAAY;IACtD,kBAAkB,CAAC,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAmB7D,aAAa,CACjB,kBAAkB,EAAE,MAAM,EAC1B,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC;CAejB"}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PaymentProviderSettingsField = void 0;
4
+ const mosaic_e2e_ui_selectors_1 = require("@axinom/mosaic-e2e-ui-selectors");
5
+ /** A model for a payment provider settings form field. */
6
+ class PaymentProviderSettingsField extends mosaic_e2e_ui_selectors_1.GenericField {
7
+ async addPaymentProvider(paymentProviderKey) {
8
+ // TODO: improve selector
9
+ const providerSelect = this.getLocator('//select', 1);
10
+ // TODO: improve selector
11
+ const providerAddButton = this.getLocator('//button', 1);
12
+ try {
13
+ await providerSelect
14
+ .locator(`//option[@value="${paymentProviderKey}"]`)
15
+ .waitFor({ state: 'attached' });
16
+ }
17
+ catch (_a) {
18
+ throw new Error(`Could not add payment provider '${paymentProviderKey}'. Is the payment provider enabled for this environment and not already added to this plan?`);
19
+ }
20
+ await providerSelect.selectOption(paymentProviderKey);
21
+ await providerAddButton.click();
22
+ }
23
+ async setExternalId(paymentProviderKey, externalId) {
24
+ const input = this.getLocator(
25
+ // TODO: improve selector
26
+ `//input[@name="providerConfigMap[${paymentProviderKey}].externalId"]`);
27
+ try {
28
+ await input.waitFor({ state: 'visible' });
29
+ }
30
+ catch (_a) {
31
+ throw new Error(`Could not set 'externalId' for payment provider '${paymentProviderKey}'. Is the payment provider enabled and not published for this plan?`);
32
+ }
33
+ await input.fill(externalId);
34
+ }
35
+ }
36
+ exports.PaymentProviderSettingsField = PaymentProviderSettingsField;
37
+ //# sourceMappingURL=payment-provider-settings-field.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment-provider-settings-field.js","sourceRoot":"","sources":["../../src/managed-services/payment-provider-settings-field.ts"],"names":[],"mappings":";;;AAAA,6EAA+D;AAE/D,0DAA0D;AAC1D,MAAa,4BAA6B,SAAQ,sCAAY;IAC5D,KAAK,CAAC,kBAAkB,CAAC,kBAA0B;QACjD,yBAAyB;QACzB,MAAM,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;QACtD,yBAAyB;QACzB,MAAM,iBAAiB,GAAG,IAAI,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;QAEzD,IAAI;YACF,MAAM,cAAc;iBACjB,OAAO,CAAC,oBAAoB,kBAAkB,IAAI,CAAC;iBACnD,OAAO,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;SACnC;QAAC,WAAM;YACN,MAAM,IAAI,KAAK,CACb,mCAAmC,kBAAkB,6FAA6F,CACnJ,CAAC;SACH;QACD,MAAM,cAAc,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC;QACtD,MAAM,iBAAiB,CAAC,KAAK,EAAE,CAAC;IAClC,CAAC;IAED,KAAK,CAAC,aAAa,CACjB,kBAA0B,EAC1B,UAAkB;QAElB,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU;QAC3B,yBAAyB;QACzB,oCAAoC,kBAAkB,gBAAgB,CACvE,CAAC;QAEF,IAAI;YACF,MAAM,KAAK,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;SAC3C;QAAC,WAAM;YACN,MAAM,IAAI,KAAK,CACb,oDAAoD,kBAAkB,qEAAqE,CAC5I,CAAC;SACH;QACD,MAAM,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC/B,CAAC;CACF;AAtCD,oEAsCC"}
@@ -0,0 +1,44 @@
1
+ import { UiWorkflowsModel } from '@axinom/mosaic-e2e-ui-selectors';
2
+ import { Page } from 'playwright-core';
3
+ import { ImageService, MonetizationService } from './managed-services';
4
+ import { SignInPage } from './sign-in';
5
+ import { UiShellModel } from './ui-selectors';
6
+ /**
7
+ * A page object model for the Mosaic management system.
8
+ * This can be extended with custom services.
9
+ */
10
+ export declare class PageModel {
11
+ /** The playwright page object. */
12
+ protected readonly page: Page;
13
+ constructor(
14
+ /** The playwright page object. */
15
+ page: Page);
16
+ /**
17
+ * A model representing the Mosaic UI shell including methods for navigation.
18
+ *
19
+ * Use this model to interact with:
20
+ * - The breadcrumbs bar (on any page)
21
+ * - The landing page
22
+ * - The settings hub page
23
+ */
24
+ readonly uiShell: UiShellModel;
25
+ /**
26
+ * A model representing Mosaic UI workflows for managed services.
27
+ *
28
+ * Use this model to interact with workflows or mod*a*ls of any managed
29
+ * service (Image, Video, Monetization, etc).
30
+ *
31
+ * To avoid UI changes from breaking your tests try to avoid using this model
32
+ * and prefer to use the methods provided by each service model.
33
+ */
34
+ readonly uiManagedWorkflows: UiWorkflowsModel;
35
+ /** A model for management system sign-in */
36
+ readonly signInPage: SignInPage;
37
+ /** A model for the managed image service. */
38
+ readonly imageService: ImageService;
39
+ /** A model for the managed monetization service. */
40
+ readonly monetizationService: MonetizationService;
41
+ /** This method waits for the management system to load after sign in. */
42
+ waitForAppToLoad(): Promise<void>;
43
+ }
44
+ //# sourceMappingURL=page-model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"page-model.d.ts","sourceRoot":"","sources":["../src/page-model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;;GAGG;AACH,qBAAa,SAAS;IAElB,kCAAkC;IAClC,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI;;IAD7B,kCAAkC;IACf,IAAI,EAAE,IAAI;IAG/B;;;;;;;OAOG;IACH,QAAQ,CAAC,OAAO,eAA+B;IAE/C;;;;;;;;OAQG;IACH,QAAQ,CAAC,kBAAkB,mBAAmC;IAE9D,4CAA4C;IAC5C,QAAQ,CAAC,UAAU,aAA6B;IAEhD,6CAA6C;IAC7C,QAAQ,CAAC,YAAY,eAInB;IAEF,oDAAoD;IACpD,QAAQ,CAAC,mBAAmB,sBAI1B;IAEF,yEAAyE;IACnE,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;CAWxC"}
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PageModel = void 0;
4
+ const mosaic_e2e_ui_selectors_1 = require("@axinom/mosaic-e2e-ui-selectors");
5
+ const managed_services_1 = require("./managed-services");
6
+ const sign_in_1 = require("./sign-in");
7
+ const ui_selectors_1 = require("./ui-selectors");
8
+ /**
9
+ * A page object model for the Mosaic management system.
10
+ * This can be extended with custom services.
11
+ */
12
+ class PageModel {
13
+ constructor(
14
+ /** The playwright page object. */
15
+ page) {
16
+ this.page = page;
17
+ /**
18
+ * A model representing the Mosaic UI shell including methods for navigation.
19
+ *
20
+ * Use this model to interact with:
21
+ * - The breadcrumbs bar (on any page)
22
+ * - The landing page
23
+ * - The settings hub page
24
+ */
25
+ this.uiShell = new ui_selectors_1.UiShellModel(this.page);
26
+ /**
27
+ * A model representing Mosaic UI workflows for managed services.
28
+ *
29
+ * Use this model to interact with workflows or mod*a*ls of any managed
30
+ * service (Image, Video, Monetization, etc).
31
+ *
32
+ * To avoid UI changes from breaking your tests try to avoid using this model
33
+ * and prefer to use the methods provided by each service model.
34
+ */
35
+ this.uiManagedWorkflows = new mosaic_e2e_ui_selectors_1.UiWorkflowsModel(this.page);
36
+ /** A model for management system sign-in */
37
+ this.signInPage = new sign_in_1.SignInPage(this.page);
38
+ /** A model for the managed image service. */
39
+ this.imageService = new managed_services_1.ImageService(this.page, this.uiShell, this.uiManagedWorkflows);
40
+ /** A model for the managed monetization service. */
41
+ this.monetizationService = new managed_services_1.MonetizationService(this.page, this.uiShell, this.uiManagedWorkflows);
42
+ }
43
+ /** This method waits for the management system to load after sign in. */
44
+ async waitForAppToLoad() {
45
+ // expect elements 'header' and 'main' to be visible
46
+ try {
47
+ await this.page.locator('header').waitFor({ state: 'visible' });
48
+ await this.page.locator('main').waitFor({ state: 'visible' });
49
+ }
50
+ catch (_a) {
51
+ throw new Error('The management system is not loaded. Are you logged in? Is your account activated?');
52
+ }
53
+ }
54
+ }
55
+ exports.PageModel = PageModel;
56
+ //# sourceMappingURL=page-model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"page-model.js","sourceRoot":"","sources":["../src/page-model.ts"],"names":[],"mappings":";;;AAAA,6EAAmE;AAEnE,yDAAuE;AACvE,uCAAuC;AACvC,iDAA8C;AAE9C;;;GAGG;AACH,MAAa,SAAS;IACpB;IACE,kCAAkC;IACf,IAAU;QAAV,SAAI,GAAJ,IAAI,CAAM;QAG/B;;;;;;;WAOG;QACM,YAAO,GAAG,IAAI,2BAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAE/C;;;;;;;;WAQG;QACM,uBAAkB,GAAG,IAAI,0CAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAE9D,4CAA4C;QACnC,eAAU,GAAG,IAAI,oBAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEhD,6CAA6C;QACpC,iBAAY,GAAG,IAAI,+BAAY,CACtC,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,kBAAkB,CACxB,CAAC;QAEF,oDAAoD;QAC3C,wBAAmB,GAAG,IAAI,sCAAmB,CACpD,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,kBAAkB,CACxB,CAAC;IAtCC,CAAC;IAwCJ,yEAAyE;IACzE,KAAK,CAAC,gBAAgB;QACpB,oDAAoD;QACpD,IAAI;YACF,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;YAChE,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;SAC/D;QAAC,WAAM;YACN,MAAM,IAAI,KAAK,CACb,oFAAoF,CACrF,CAAC;SACH;IACH,CAAC;CACF;AAxDD,8BAwDC"}