@digital-ai/devops-page-object-deploy 0.0.7 → 0.0.9

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/module.js CHANGED
@@ -9,117 +9,2553 @@ class $7d546dcaafadc158$export$2b65d1d97338f32b {
9
9
  }
10
10
 
11
11
 
12
+ class $6480ad852470b7ac$export$cb21416f3c2fd176 extends (0, $7d546dcaafadc158$export$2b65d1d97338f32b) {
13
+ async handleSaveToastOrAlreadyExists() {
14
+ const toastMessage = this.page.locator('.redux-toastr .rrt-text:visible');
15
+ try {
16
+ await toastMessage.waitFor({
17
+ state: 'visible',
18
+ timeout: 10000
19
+ });
20
+ } catch {
21
+ // No toast appeared — assume the operation succeeded silently (e.g. fast CI environments).
22
+ return;
23
+ }
24
+ const toastText = (await toastMessage.textContent())?.trim() ?? '';
25
+ if (toastText === 'Your change was saved.') return;
26
+ if (/already exists/i.test(toastText)) {
27
+ const cancelButton = this.page.getByRole('button', {
28
+ name: 'Cancel'
29
+ });
30
+ if (await cancelButton.isVisible()) await cancelButton.click();
31
+ else await this.page.locator('i.xl-icon.close-icon').first().click();
32
+ return;
33
+ }
34
+ await (0, $lE6ZQ$expect)(toastMessage).toHaveText('Your change was saved.');
35
+ }
36
+ async openRootContextMenu(rootId) {
37
+ await this.closeModalIfPresent();
38
+ await this.ensureExplorerTreeReady();
39
+ const rootTitle = this.page.locator(`span[data-id="${rootId}"]`);
40
+ await rootTitle.scrollIntoViewIfNeeded();
41
+ await rootTitle.click();
42
+ const menuButton = this.page.locator(`i.context-menu-button[data-id="${rootId}"]`);
43
+ await menuButton.scrollIntoViewIfNeeded();
44
+ for(let attempt = 0; attempt < 3; attempt += 1)try {
45
+ await menuButton.click({
46
+ force: true
47
+ });
48
+ return;
49
+ } catch {
50
+ if (attempt === 2) throw new Error(`Failed to open context menu for ${rootId}`);
51
+ await this.page.waitForTimeout(300);
52
+ }
53
+ }
54
+ async ensureExplorerTreeReady() {
55
+ const applicationsRoot = this.page.locator('div[data-id="Applications"]');
56
+ try {
57
+ await applicationsRoot.waitFor({
58
+ state: 'visible',
59
+ timeout: 3000
60
+ });
61
+ return;
62
+ } catch {
63
+ // Fall through to open Explorer.
64
+ }
65
+ const explorerCandidates = [
66
+ this.page.locator('p.MuiTypography-root', {
67
+ hasText: 'Explorer'
68
+ }),
69
+ this.page.getByRole('link', {
70
+ name: 'Explorer'
71
+ }),
72
+ this.page.getByRole('button', {
73
+ name: 'Explorer'
74
+ })
75
+ ];
76
+ for (const candidate of explorerCandidates)try {
77
+ if (await candidate.count() > 0) {
78
+ await candidate.first().click({
79
+ timeout: 10000
80
+ });
81
+ break;
82
+ }
83
+ } catch {
84
+ // Try next candidate.
85
+ }
86
+ await applicationsRoot.waitFor({
87
+ state: 'visible',
88
+ timeout: 10000
89
+ });
90
+ }
91
+ async closeModalIfPresent() {
92
+ const modal = this.page.locator('div.xl-react-widget-modal-dialog.in');
93
+ if (await modal.count() === 0) return;
94
+ if (!await modal.first().isVisible()) return;
95
+ const cancelButton = modal.getByRole('button', {
96
+ name: 'Cancel'
97
+ }).first();
98
+ if (await cancelButton.isVisible()) await cancelButton.click();
99
+ else {
100
+ const closeIcon = modal.locator('i.xl-icon.close-icon').first();
101
+ if (await closeIcon.isVisible()) await closeIcon.click();
102
+ }
103
+ try {
104
+ await this.page.locator('body.xl-react-modal-open').waitFor({
105
+ state: 'hidden',
106
+ timeout: 10000
107
+ });
108
+ } catch {
109
+ // Modal may already be closing.
110
+ }
111
+ }
112
+ }
113
+
114
+
115
+
116
+
12
117
  class $e18c8d3707c8c74c$export$36d69433c4f81145 extends (0, $7d546dcaafadc158$export$2b65d1d97338f32b) {
13
118
  async clickUserManagement() {
14
- await this.page.locator("p.MuiTypography-root", {
15
- hasText: "User management"
119
+ await this.page.locator('p.MuiTypography-root', {
120
+ hasText: 'User management'
121
+ }).click();
122
+ await this.page.getByRole('link', {
123
+ name: 'Users'
16
124
  }).click();
17
- await this.page.getByRole("link", {
18
- name: "Users"
125
+ }
126
+ async clickExplorer() {
127
+ await this.page.locator('p.MuiTypography-root', {
128
+ hasText: 'Explorer'
19
129
  }).click();
20
130
  }
21
131
  async verifyDeployLogoIsPresent() {
22
- const logo = this.page.getByAltText("Deploy");
132
+ const logo = this.page.getByAltText('Deploy');
23
133
  await (0, $lE6ZQ$expect)(logo).toBeVisible();
24
134
  }
25
135
  async verifyDeployTextIsPresent() {
26
- const title = this.page.getByTitle("digital.ai");
136
+ const title = this.page.getByTitle('digital.ai');
27
137
  await (0, $lE6ZQ$expect)(title).toBeVisible();
28
138
  }
139
+ async clickReports() {
140
+ await this.page.locator('p.MuiTypography-root', {
141
+ hasText: 'Reports'
142
+ }).click();
143
+ }
144
+ async verifyReportsOnlyAccess() {
145
+ const sidebar = this.page.locator('.dot-sidebar');
146
+ await (0, $lE6ZQ$expect)(sidebar.getByText('Reports', {
147
+ exact: true
148
+ })).toBeVisible();
149
+ await (0, $lE6ZQ$expect)(sidebar.getByText('Explorer', {
150
+ exact: true
151
+ })).toBeVisible();
152
+ await (0, $lE6ZQ$expect)(sidebar.getByText('Rules and Macros', {
153
+ exact: true
154
+ })).toHaveCount(0);
155
+ await (0, $lE6ZQ$expect)(sidebar.getByText('Gitops', {
156
+ exact: true
157
+ })).toHaveCount(0);
158
+ await (0, $lE6ZQ$expect)(sidebar.getByText('Local sources', {
159
+ exact: true
160
+ })).toHaveCount(0);
161
+ await (0, $lE6ZQ$expect)(sidebar.getByText('Plugins', {
162
+ exact: true
163
+ })).toHaveCount(0);
164
+ await (0, $lE6ZQ$expect)(sidebar.getByText('User management', {
165
+ exact: true
166
+ })).toHaveCount(0);
167
+ }
168
+ async verifyNoCiDataVisible() {
169
+ await (0, $lE6ZQ$expect)(this.page.getByText('LocalHost', {
170
+ exact: true
171
+ })).toHaveCount(0);
172
+ await (0, $lE6ZQ$expect)(this.page.getByText('LocalEnv', {
173
+ exact: true
174
+ })).toHaveCount(0);
175
+ await (0, $lE6ZQ$expect)(this.page.getByText('App', {
176
+ exact: true
177
+ })).toHaveCount(0);
178
+ }
29
179
  }
30
180
 
31
181
 
32
182
 
33
183
 
34
184
  class $ca2721b1aeb903c5$export$ecdc3cf9d1cfe143 extends (0, $7d546dcaafadc158$export$2b65d1d97338f32b) {
35
- /**
36
- * Login with username and password
37
- * @param userName
38
- * @param password
39
- */ // this should be refactored to take an object and not disable the rule!!
40
- // eslint-disable-next-line max-params
41
- async createNewUser(username, fullName, email, password, confirmPassword) {
42
- await this.page.locator("p.MuiTypography-root", {
43
- hasText: "Users"
44
- }).click();
45
- await this.page.getByRole("button", {
46
- name: "Add user"
47
- }).click();
48
- await this.page.locator('input[name="username"]').fill(username);
49
- await this.page.locator('input[name="fullName"]').fill(fullName);
185
+ async openUsersTab() {
186
+ await this.page.locator('p.MuiTypography-root', {
187
+ hasText: 'Users'
188
+ }).click();
189
+ }
190
+ async waitForToastIfPresent(timeoutVisible = 3000, timeoutHidden = 5000) {
191
+ const toast = this.page.getByRole('alertdialog');
192
+ try {
193
+ await toast.waitFor({
194
+ state: 'visible',
195
+ timeout: timeoutVisible
196
+ });
197
+ await toast.waitFor({
198
+ state: 'hidden',
199
+ timeout: timeoutHidden
200
+ });
201
+ } catch {
202
+ // Toast is transient; skip if it doesn't appear.
203
+ }
204
+ }
205
+ async waitForModalCloseIfPresent() {
206
+ try {
207
+ await this.page.locator('input[name="username"]').waitFor({
208
+ state: 'hidden',
209
+ timeout: 5000
210
+ });
211
+ await this.page.locator('body.xl-react-modal-open').waitFor({
212
+ state: 'hidden',
213
+ timeout: 5000
214
+ });
215
+ await this.page.waitForLoadState('networkidle');
216
+ } catch {
217
+ // When user already exists, modal stays open; caller handles error toast.
218
+ }
219
+ }
220
+ async openGlobalPermissions() {
221
+ await this.page.getByRole('link', {
222
+ name: 'Global permissions'
223
+ }).click();
224
+ }
225
+ async filterRoleInPermissions(roleName) {
226
+ const filter = this.page.locator('input[placeholder="Filter by roles"]:visible');
227
+ await filter.waitFor({
228
+ state: 'visible'
229
+ });
230
+ await (0, $lE6ZQ$expect)(filter).toBeEditable();
231
+ await filter.fill('');
232
+ await filter.fill(roleName);
233
+ await (0, $lE6ZQ$expect)(filter).toHaveValue(roleName);
234
+ await filter.press('Enter');
235
+ await this.page.getByRole('button', {
236
+ name: 'Refresh'
237
+ }).click();
238
+ await this.page.waitForLoadState('networkidle');
239
+ await this.page.locator('table tbody tr:visible').first().waitFor({
240
+ state: 'visible'
241
+ });
242
+ const escapedRoleName = roleName.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
243
+ const roleCell = this.page.locator('td.permissions-pagination-table-component-role:visible').filter({
244
+ hasText: new RegExp(`^\\s*${escapedRoleName}\\s*$`)
245
+ }).first();
246
+ await (0, $lE6ZQ$expect)(roleCell).toBeVisible();
247
+ return roleCell.locator('xpath=ancestor::tr');
248
+ }
249
+ /* Create a new user */ async createNewUser(username, email, password) {
250
+ await this.openUsersTab();
251
+ await this.page.getByRole('button', {
252
+ name: 'Add user'
253
+ }).click();
254
+ const usernameInput = this.page.locator('input[name="username"]');
255
+ await usernameInput.waitFor({
256
+ state: 'visible'
257
+ });
258
+ await usernameInput.fill(username);
259
+ await this.page.locator('input[name="fullName"]').fill(username);
50
260
  await this.page.locator('input[name="email"]').fill(email);
51
261
  const passwordInput = this.page.locator('input[name="password"]');
262
+ const confirmInput = this.page.locator('input[name="confirmPassword"]');
263
+ await passwordInput.waitFor({
264
+ state: 'visible'
265
+ });
52
266
  await passwordInput.click({
53
267
  force: true
54
268
  });
55
269
  await passwordInput.fill(password);
56
- await this.page.locator('input[name="confirmPassword"]').fill(confirmPassword);
57
- await this.page.getByRole("button", {
58
- name: "Save"
270
+ await confirmInput.fill(password);
271
+ const saveButton = this.page.getByRole('button', {
272
+ name: 'Save'
273
+ });
274
+ try {
275
+ await (0, $lE6ZQ$expect)(saveButton).toBeEnabled({
276
+ timeout: 5000
277
+ });
278
+ } catch {
279
+ await passwordInput.fill('');
280
+ await confirmInput.fill('');
281
+ await passwordInput.type(password, {
282
+ delay: 50
283
+ });
284
+ await confirmInput.type(password, {
285
+ delay: 50
286
+ });
287
+ await (0, $lE6ZQ$expect)(saveButton).toBeEnabled({
288
+ timeout: 5000
289
+ });
290
+ }
291
+ await saveButton.click();
292
+ await this.waitForToastIfPresent();
293
+ await this.waitForModalCloseIfPresent();
294
+ }
295
+ /* Verify success message */ async verifySuccessMessage() {
296
+ const successMessage = this.page.getByRole('alertdialog');
297
+ try {
298
+ await successMessage.waitFor({
299
+ state: 'visible',
300
+ timeout: 3000
301
+ });
302
+ } catch {
303
+ // Toast never appeared — skip silently.
304
+ return;
305
+ }
306
+ await (0, $lE6ZQ$expect)(successMessage).toHaveText(/User ".*" created/i);
307
+ }
308
+ /* Verify user error message */ async verifyUserErrorMessage() {
309
+ const errorToast = this.page.locator('.rrt-middle-container[role="alertdialog"]').nth(1);
310
+ try {
311
+ await errorToast.waitFor({
312
+ state: 'visible',
313
+ timeout: 3000
314
+ });
315
+ } catch {
316
+ // Toast is transient; skip if it never appears.
317
+ return;
318
+ }
319
+ await (0, $lE6ZQ$expect)(errorToast).toContainText(/already in use/i);
320
+ }
321
+ /* Delete the user and verify it is deleted */ async deleteTheUserAndVerifyItIsDeleted(username) {
322
+ await this.openUsersTab();
323
+ const filter = this.page.getByPlaceholder('Filter...');
324
+ await filter.fill(username);
325
+ await filter.press('Enter');
326
+ const escapedUsername = username.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
327
+ const userRow = this.page.getByRole('row', {
328
+ name: new RegExp(`\\b${escapedUsername}\\b`)
329
+ }).first();
330
+ await userRow.waitFor({
331
+ state: 'visible'
332
+ });
333
+ await userRow.locator('button.delete.xl-icon.table-action').click();
334
+ const confirmDialog = this.page.locator('.xl-react-widget-modal-dialog.in:visible').filter({
335
+ hasText: /Delete user/i
336
+ }).first();
337
+ await confirmDialog.waitFor({
338
+ state: 'visible'
339
+ });
340
+ await confirmDialog.getByRole('button', {
341
+ name: 'Delete',
342
+ exact: true
343
+ }).click();
344
+ await confirmDialog.waitFor({
345
+ state: 'hidden'
346
+ });
347
+ const deleteToast = this.page.getByRole('alertdialog').filter({
348
+ hasText: /deleted/i
349
+ });
350
+ await (0, $lE6ZQ$expect)(deleteToast).toHaveText(/User ".*" deleted/i);
351
+ await deleteToast.waitFor({
352
+ state: 'hidden'
353
+ });
354
+ await userRow.waitFor({
355
+ state: 'detached'
356
+ });
357
+ }
358
+ /* Edit the user and verify the changes */ async editUserAndVerify(username, editfullname) {
359
+ await this.openUsersTab();
360
+ const filter = this.page.getByPlaceholder('Filter...');
361
+ await filter.fill(username);
362
+ await filter.press('Enter');
363
+ const escapedUsername = username.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
364
+ const userRow = this.page.getByRole('row', {
365
+ name: new RegExp(`\\b${escapedUsername}\\b`)
366
+ }).first();
367
+ await userRow.waitFor({
368
+ state: 'visible'
369
+ });
370
+ await userRow.locator('i.icon-edit.dot-i').click();
371
+ await this.page.locator('input[name="fullName"]').fill(editfullname);
372
+ const passwordInput = this.page.locator('input[name="password"]');
373
+ const confirmInput = this.page.locator('input[name="confirmPassword"]');
374
+ if (await passwordInput.count()) {
375
+ await passwordInput.click({
376
+ force: true
377
+ });
378
+ await passwordInput.press(process.platform === 'darwin' ? 'Meta+A' : 'Control+A');
379
+ await passwordInput.press('Backspace');
380
+ }
381
+ if (await confirmInput.count()) {
382
+ await confirmInput.click({
383
+ force: true
384
+ });
385
+ await confirmInput.press(process.platform === 'darwin' ? 'Meta+A' : 'Control+A');
386
+ await confirmInput.press('Backspace');
387
+ }
388
+ const saveButton = this.page.getByRole('button', {
389
+ name: 'Save',
390
+ exact: true
391
+ });
392
+ await (0, $lE6ZQ$expect)(saveButton).toBeEnabled({
393
+ timeout: 5000
394
+ });
395
+ await saveButton.click();
396
+ const editToast = this.page.getByRole('alertdialog').filter({
397
+ hasText: 'Your change was saved'
398
+ });
399
+ await (0, $lE6ZQ$expect)(editToast).toBeVisible();
400
+ }
401
+ /* Disable the user by toggling the login permission checkbox */ async disableUser(username) {
402
+ await this.openUsersTab();
403
+ const filter = this.page.getByPlaceholder('Filter...');
404
+ await filter.fill(username);
405
+ await filter.press('Enter');
406
+ const escapedUsername = username.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
407
+ const userRow = this.page.getByRole('row', {
408
+ name: new RegExp(`\\b${escapedUsername}\\b`)
409
+ }).first();
410
+ await userRow.waitFor({
411
+ state: 'visible'
412
+ });
413
+ const checkbox = userRow.getByRole('checkbox');
414
+ await checkbox.click();
415
+ await (0, $lE6ZQ$expect)(checkbox).not.toBeChecked();
416
+ }
417
+ /* Revoke login permission for a role via Global permissions */ async revokeLoginPermission(roleName) {
418
+ await this.openGlobalPermissions();
419
+ const roleRow = await this.filterRoleInPermissions(roleName);
420
+ const normalizedRoleName = roleName.replace(/\s+/g, '_');
421
+ const loginCheckbox = roleRow.locator(`td.permissions-pagination-table-component-${normalizedRoleName}-4 input[type="checkbox"]`);
422
+ const saveButton = this.page.getByRole('button', {
423
+ name: 'Save'
424
+ });
425
+ if (await loginCheckbox.isVisible() && await loginCheckbox.isChecked()) {
426
+ await loginCheckbox.uncheck();
427
+ await saveButton.click();
428
+ const saveMessage = this.page.getByRole('alertdialog');
429
+ await (0, $lE6ZQ$expect)(saveMessage).toContainText('Your change was saved');
430
+ return;
431
+ }
432
+ if (await saveButton.isVisible()) await (0, $lE6ZQ$expect)(saveButton).toBeDisabled();
433
+ }
434
+ /* Grant only login and report view permissions for a role */ async grantOnlyLoginAndReportPermissions(roleName) {
435
+ await this.openGlobalPermissions();
436
+ const roleRow = await this.filterRoleInPermissions(roleName);
437
+ const checkboxes = roleRow.locator('input[type="checkbox"]');
438
+ const count = await checkboxes.count();
439
+ for(let i = 0; i < count; i += 1){
440
+ const checkbox = checkboxes.nth(i);
441
+ if (await checkbox.isChecked()) await checkbox.uncheck();
442
+ }
443
+ await roleRow.locator(`td.permissions-pagination-table-component-${roleName}-4 input[type="checkbox"]`).check();
444
+ await roleRow.locator(`td.permissions-pagination-table-component-${roleName}-5 input[type="checkbox"]`).check();
445
+ await this.page.getByRole('button', {
446
+ name: 'Save'
447
+ }).click();
448
+ const saveMessage = this.page.getByRole('alertdialog');
449
+ await (0, $lE6ZQ$expect)(saveMessage).toContainText('Your change was saved');
450
+ }
451
+ /* Create a role and assign a principal to it */ async createRoleAndAssignUser(roleName, principal) {
452
+ await this.page.getByRole('link', {
453
+ name: 'Roles'
454
+ }).click();
455
+ await this.page.getByPlaceholder('Filter by roles').first().waitFor({
456
+ state: 'visible'
457
+ });
458
+ await this.page.locator('body.xl-react-modal-open').waitFor({
459
+ state: 'hidden'
460
+ });
461
+ await this.page.getByRole('button', {
462
+ name: 'Add role'
463
+ }).click();
464
+ const roleDialog = this.page.locator('.add-edit-role-component');
465
+ await roleDialog.waitFor({
466
+ state: 'visible'
467
+ });
468
+ await roleDialog.locator('input[name="name"]').fill(roleName);
469
+ const principalsInput = roleDialog.locator('input.react-tagsinput-input');
470
+ await principalsInput.fill(principal);
471
+ await principalsInput.press('Enter');
472
+ await roleDialog.getByRole('button', {
473
+ name: 'Save'
474
+ }).click();
475
+ const saveMessage = this.page.getByRole('alertdialog');
476
+ await (0, $lE6ZQ$expect)(saveMessage).toHaveText(/Role ".*" created/);
477
+ await saveMessage.waitFor({
478
+ state: 'hidden'
479
+ });
480
+ await roleDialog.waitFor({
481
+ state: 'hidden'
482
+ });
483
+ }
484
+ /* Delete a role by name */ async deleteRole(roleName) {
485
+ await this.page.getByRole('link', {
486
+ name: 'Roles'
487
+ }).click();
488
+ const filter = this.page.getByPlaceholder('Filter by roles').first();
489
+ await filter.fill(roleName);
490
+ await filter.press('Enter');
491
+ const escapedRoleName = roleName.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
492
+ const roleRow = this.page.locator('td.roles-table-name').filter({
493
+ hasText: new RegExp(`^\\s*${escapedRoleName}\\s*$`)
494
+ }).first().locator('xpath=ancestor::tr');
495
+ await roleRow.waitFor({
496
+ state: 'visible'
497
+ });
498
+ await roleRow.locator('button.delete.table-action').click();
499
+ const confirmDelete = this.page.getByRole('button', {
500
+ name: 'Delete',
501
+ exact: true
502
+ });
503
+ if (await confirmDelete.isVisible()) await confirmDelete.click();
504
+ }
505
+ }
506
+
507
+
508
+
509
+ class $a4d71fd851704781$export$c88e1d16f82516d extends (0, $6480ad852470b7ac$export$cb21416f3c2fd176) {
510
+ /* Helps to navigate to the Overthere LocalHost page */ async navigateToOverthereLocalHostPage() {
511
+ await this.openRootContextMenu('Infrastructure');
512
+ await this.page.getByRole('link', {
513
+ name: 'New'
514
+ }).click();
515
+ await this.page.getByRole('link', {
516
+ name: 'overthere'
517
+ }).click();
518
+ await this.page.getByRole('link', {
519
+ name: 'LocalHost'
520
+ }).click();
521
+ }
522
+ /* Opens the New > overthere > LocalHost form from the Infrastructure tree context menu */ async openNewLocalHost() {
523
+ await this.closeModalIfPresent();
524
+ await this.ensureExplorerTreeReady();
525
+ const infrastructureRoot = this.page.locator('span[data-id="Infrastructure"]');
526
+ await infrastructureRoot.scrollIntoViewIfNeeded();
527
+ await infrastructureRoot.click();
528
+ const contextMenu = this.page.locator('i.context-menu-button[data-id="Infrastructure"]');
529
+ await contextMenu.scrollIntoViewIfNeeded();
530
+ await contextMenu.click({
531
+ force: true
532
+ });
533
+ await this.page.getByRole('link', {
534
+ name: 'New'
535
+ }).click();
536
+ await this.page.getByRole('link', {
537
+ name: 'overthere'
538
+ }).click();
539
+ await this.page.getByRole('link', {
540
+ name: 'LocalHost'
541
+ }).click();
542
+ }
543
+ async openInfrastructureNewLocalHost() {
544
+ await this.openNewLocalHost();
545
+ }
546
+ /* Helps to create a LocalHost of type UNIX/Windows/Zos */ async createHostForGivenType(name, type) {
547
+ await this.page.locator('input[name="name"]').fill(name);
548
+ await this.page.locator('label:has-text("Operating system")').locator('xpath=following::input[1]').click();
549
+ await this.page.getByText(type, {
550
+ exact: true
59
551
  }).click();
552
+ await this.page.getByRole('button', {
553
+ name: 'Save and close'
554
+ }).click();
555
+ await this.handleSaveToastOrAlreadyExists();
60
556
  }
61
- async verifySuccessMessage() {
62
- const SuccessMessage = this.page.getByRole("alertdialog");
63
- await (0, $lE6ZQ$expect)(SuccessMessage).toBeVisible();
64
- await (0, $lE6ZQ$expect)(SuccessMessage).toHaveText(/User ".*" created/i);
557
+ /**
558
+ * Runs the "Check connection" control task on the given host node once.
559
+ * Expects the deployment plan page, executes it, waits for EXECUTED state, then finishes.
560
+ * @param hostDataId The full tree data-id, e.g. "Infrastructure/MyHost"
561
+ */ async runCheckConnection(hostDataId) {
562
+ // Ensure the tree node is visible by expanding Infrastructure if needed
563
+ const infraToggle = this.page.locator('div[data-id="Infrastructure"] .infinite-tree-node > a');
564
+ const hostNode = this.page.locator(`span[data-id="${hostDataId}"]`);
565
+ for(let attempt = 0; attempt < 3; attempt += 1){
566
+ if (await hostNode.count() > 0 && await hostNode.isVisible()) break;
567
+ await infraToggle.click();
568
+ await this.page.waitForTimeout(500);
569
+ }
570
+ // Hover host node to reveal context menu button
571
+ //await hostNode.scrollIntoViewIfNeeded();
572
+ await hostNode.hover();
573
+ const ctxBtn = this.page.locator(`i.context-menu-button[data-id="${hostDataId}"]`);
574
+ await ctxBtn.waitFor({
575
+ state: 'visible',
576
+ timeout: 5000
577
+ });
578
+ await ctxBtn.click({
579
+ force: true
580
+ });
581
+ // Click "Check connection" in the context menu
582
+ await this.page.getByRole('link', {
583
+ name: 'Check connection'
584
+ }).click();
585
+ // Wait for the deployment plan panel and execute
586
+ await this.page.locator('.xl-react-widget-modal-dialog button.deploy.xl-primary, button.xl-primary:has-text("Execute")').first().waitFor({
587
+ state: 'visible',
588
+ timeout: 10000
589
+ });
590
+ await this.page.locator('.xl-react-widget-modal-dialog button.deploy.xl-primary, button.xl-primary:has-text("Execute")').first().click();
591
+ // Wait for EXECUTED status
592
+ const executedLabel = this.page.locator('span.label', {
593
+ hasText: 'EXECUTED'
594
+ }).first();
595
+ await executedLabel.waitFor({
596
+ state: 'visible',
597
+ timeout: 30000
598
+ });
599
+ // Finish
600
+ const finishButton = this.page.locator('button.finish.xl-primary, button:has-text("Finish")').first();
601
+ if (await finishButton.isVisible()) await finishButton.click();
602
+ // Wait for modal/plan to close
603
+ const modal = this.page.locator('div.xl-react-widget-modal-dialog.in');
604
+ if (await modal.count() > 0) await modal.first().waitFor({
605
+ state: 'hidden',
606
+ timeout: 15000
607
+ });
65
608
  }
66
- async verifyUserErrorMessage() {
67
- await (0, $lE6ZQ$expect)(this.page.locator('.rrt-middle-container[role="alertdialog"]').nth(1)).toContainText(/already in use/i);
609
+ }
610
+
611
+
612
+
613
+ class $a63f1342e8823465$export$12530425267834a9 extends (0, $6480ad852470b7ac$export$cb21416f3c2fd176) {
614
+ /* Helps to navigate to the Environments page */ async navigateToEnvironmentsPage() {
615
+ await this.ensureExplorerTreeReady();
68
616
  }
69
- async deleteTheUserAndVerifyItIsDeleted(username) {
70
- await this.page.locator("p.MuiTypography-root", {
71
- hasText: "Users"
617
+ /* Helps to create a new Environment */ async createEnvironment(environmentName, hostName, dictionaryName) {
618
+ await this.openRootContextMenu('Environments');
619
+ await this.page.getByRole('link', {
620
+ name: 'New'
72
621
  }).click();
73
- await this.page.waitForTimeout(10000);
74
- await this.page.getByPlaceholder("Filter...").fill(username);
75
- await this.page.waitForTimeout(10000);
76
- await this.page.locator("td.users-table-actions button.delete.xl-icon.table-action").click();
77
- await this.page.getByRole("button", {
78
- name: "Delete",
622
+ await this.page.getByRole('link', {
623
+ name: 'Environment'
624
+ }).click();
625
+ await this.page.locator('input[name="name"]').fill(environmentName);
626
+ await this.page.locator('i.xl-icon.arrow-down-icon.show-all').nth(0).click();
627
+ await this.page.getByTitle(`Infrastructure/${hostName}`, {
628
+ exact: true
629
+ }).click();
630
+ await this.page.locator('i.xl-icon.arrow-down-icon.show-all').nth(1).click();
631
+ await this.page.getByTitle(`Environments/${dictionaryName}`, {
79
632
  exact: true
80
633
  }).click();
81
- const DeleteMessage = this.page.getByRole("alertdialog");
82
- await (0, $lE6ZQ$expect)(DeleteMessage).toBeVisible();
83
- await (0, $lE6ZQ$expect)(DeleteMessage).toHaveText(/User ".*" deleted/i);
634
+ await this.page.getByRole('button', {
635
+ name: 'Save and close'
636
+ }).click();
637
+ await this.handleSaveToastOrAlreadyExists();
84
638
  }
85
- async editUserAndVerify(username, editfullname) {
86
- await this.page.locator("p.MuiTypography-root", {
87
- hasText: "Users"
639
+ /* Creates a new udm.Dictionary under Environments with entry usr=admin */ async createDictionary(dictionaryName) {
640
+ await this.openRootContextMenu('Environments');
641
+ await this.page.getByRole('link', {
642
+ name: 'New'
88
643
  }).click();
89
- await this.page.waitForTimeout(10000);
90
- await this.page.getByPlaceholder("Filter...").fill(username);
91
- await this.page.waitForTimeout(10000);
92
- await this.page.locator("i.icon-edit.dot-i").first().click();
93
- await this.page.locator('input[name="fullName"]').fill(editfullname);
94
- await this.page.getByRole("button", {
95
- name: "Save",
644
+ await this.page.getByRole('link', {
645
+ name: 'Dictionary',
96
646
  exact: true
97
647
  }).click();
98
- const EditMessage = this.page.getByRole("alertdialog");
99
- await (0, $lE6ZQ$expect)(EditMessage).toBeVisible();
100
- const editedUsername = this.page.locator("td.users-table-fullName div").textContent();
101
- // eslint-disable-next-line no-console
102
- console.log(editedUsername);
648
+ await this.page.locator('input[name="name"]').fill(dictionaryName);
649
+ // Type the key in the Entries field and press Enter to create the row
650
+ // (The hint text "Search or create a new key/value" is a div, not a real placeholder)
651
+ const entriesInput = this.page.getByRole('textbox').nth(3);
652
+ await entriesInput.fill('usr');
653
+ await entriesInput.press('Enter');
654
+ // Fill the value field that appears after the key is created
655
+ await this.page.getByRole('textbox', {
656
+ name: 'Add value...'
657
+ }).fill('admin');
658
+ await this.page.getByRole('button', {
659
+ name: 'Save and close'
660
+ }).click();
661
+ await this.handleSaveToastOrAlreadyExists();
103
662
  }
104
663
  }
105
664
 
106
665
 
107
- class $95d5ebc9765b570f$export$b8a61e5c71402559 {
666
+
667
+
668
+ class $3fb4750cbb53e5e6$export$1533b625ec0c75e2 extends (0, $6480ad852470b7ac$export$cb21416f3c2fd176) {
108
669
  constructor(page){
109
- this.page = page;
670
+ super(page);
671
+ }
672
+ /* Helps to navigate to the Applications page */ async navigateToApplicationsPage() {
673
+ await this.openRootContextMenu('Applications');
674
+ await this.page.getByRole('link', {
675
+ name: 'New'
676
+ }).click();
677
+ await this.page.getByRole('link', {
678
+ name: 'Application'
679
+ }).click();
680
+ }
681
+ /* Creates a new application */ async createNewApplication(applicationName) {
682
+ if (await this.nodeExists(`Applications/${applicationName}`)) return;
683
+ await this.openRootContextMenu('Applications');
684
+ await this.page.getByRole('link', {
685
+ name: 'New'
686
+ }).click();
687
+ await this.page.getByRole('link', {
688
+ name: 'Application'
689
+ }).click();
690
+ await this.page.locator('input[name="name"]').waitFor({
691
+ state: 'visible'
692
+ });
693
+ await this.page.locator('input[name="name"]').click();
694
+ await this.page.locator('input[name="name"]').fill(applicationName);
695
+ await this.page.getByRole('button', {
696
+ name: 'Save and close'
697
+ }).click();
698
+ await this.page.locator('input[name="name"]').waitFor({
699
+ state: 'hidden',
700
+ timeout: 5000
701
+ });
702
+ await this.handleSaveToastOrAlreadyExists();
703
+ await this.waitForApplicationNode(applicationName);
704
+ }
705
+ /* Creates a new deployment package */ async createNewDeploymentPackage(applicationName, packageName) {
706
+ const appDataId = `Applications/${applicationName}`;
707
+ const packageDataId = `Applications/${applicationName}/${packageName}`;
708
+ if (await this.nodeExists(packageDataId)) return;
709
+ // Expand Applications
710
+ await this.ensureExplorerTreeReady();
711
+ await this.waitForApplicationNode(applicationName);
712
+ // Hover over app node
713
+ const appNode = this.page.locator(`span[data-id="${appDataId}"]`);
714
+ await (0, $lE6ZQ$expect)(appNode).toBeVisible();
715
+ await appNode.scrollIntoViewIfNeeded();
716
+ await appNode.hover();
717
+ // Open context menu + create new deployment package
718
+ const contextMenu = this.page.locator(`i.context-menu-button[data-id="${appDataId}"]`);
719
+ await (0, $lE6ZQ$expect)(contextMenu).toBeVisible();
720
+ await contextMenu.click();
721
+ await this.page.getByRole('link', {
722
+ name: 'New'
723
+ }).click();
724
+ await this.page.getByRole('link', {
725
+ name: 'Deployment Package'
726
+ }).click();
727
+ // Fill & save
728
+ const nameInput = this.page.locator('input[name="name"]');
729
+ await nameInput.fill(packageName);
730
+ await this.page.getByRole('button', {
731
+ name: 'Save and close'
732
+ }).click();
733
+ await nameInput.waitFor({
734
+ state: 'hidden',
735
+ timeout: 5000
736
+ });
737
+ await this.handleSaveToastOrAlreadyExists();
738
+ await this.waitForPackageNode(applicationName, packageName);
739
+ }
740
+ /* Creates a new command application */ async createNewCmdApplication(values) {
741
+ const appDataId = `Applications/${values[0]}`;
742
+ const packageDataId = `Applications/${values[0]}/${values[1]}`;
743
+ const commandDataId = `Applications/${values[0]}/${values[1]}/${values[2]}`;
744
+ if (await this.nodeExists(commandDataId)) return;
745
+ // Expand app node and click package
746
+ await this.ensureExplorerTreeReady();
747
+ await this.waitForApplicationNode(values[0]);
748
+ await this.waitForPackageNode(values[0], values[1]);
749
+ await this.page.locator(`div[data-id="${appDataId}"] .infinite-tree-node > a`).click();
750
+ await this.clickPackageNodeWithRetry(packageDataId);
751
+ // Open context menu
752
+ const packageMenu = this.page.locator(`i.context-menu-button[data-id="${packageDataId}"]`);
753
+ await (0, $lE6ZQ$expect)(packageMenu).toBeVisible();
754
+ await packageMenu.click();
755
+ // Create Command application
756
+ await this.page.getByRole('link', {
757
+ name: 'New'
758
+ }).click();
759
+ await this.page.getByRole('link', {
760
+ name: 'cmd'
761
+ }).click();
762
+ await this.page.getByRole('link', {
763
+ name: 'Command'
764
+ }).click();
765
+ await this.page.locator('input[name="name"]').fill(values[2]);
766
+ await this.page.locator('textarea[name="commandLine"]').fill(values[3]);
767
+ // Some server configs default username to {{usr}} placeholder. Use evaluate to
768
+ // set value directly on DOM + fire React's change event, bypassing visibility checks.
769
+ await this.page.evaluate(()=>{
770
+ const inputs = Array.from(document.querySelectorAll('input[name="username"]'));
771
+ const setter = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value')?.set;
772
+ for (const input of inputs){
773
+ setter?.call(input, 'admin');
774
+ input.dispatchEvent(new Event('input', {
775
+ bubbles: true
776
+ }));
777
+ input.dispatchEvent(new Event('change', {
778
+ bubbles: true
779
+ }));
780
+ }
781
+ });
782
+ const saveBtn = this.page.locator('button', {
783
+ hasText: /^Save$/
784
+ }).first();
785
+ await (0, $lE6ZQ$expect)(saveBtn).toBeEnabled();
786
+ await saveBtn.click();
787
+ await this.page.waitForTimeout(3000);
788
+ await this.handleSaveToastOrAlreadyExists();
789
+ // Close dialog
790
+ await this.page.locator('i.xl-icon.close-icon').first().click();
791
+ }
792
+ /*Deploy the application*/ async deployApp(values) {
793
+ const versionNode = `Applications/${values[0]}/${values[1]}`;
794
+ await this.ensureExplorerTreeReady();
795
+ await this.waitForPackageNode(values[0], values[1]);
796
+ await this.openPackageMenuWithRetry(versionNode);
797
+ await this.page.getByRole('link', {
798
+ name: 'Deploy',
799
+ exact: true
800
+ }).click();
801
+ await this.page.locator(`input[name="selections"][value="Environments/${values[2]}"]`).click();
802
+ await this.page.getByRole('button', {
803
+ name: 'Continue'
804
+ }).click();
805
+ // Wait for the deployment properties wizard to fully load and evaluate validation rules
806
+ await this.page.locator('.errors-wrapper').waitFor({
807
+ state: 'attached',
808
+ timeout: 15000
809
+ });
810
+ const errorIcon = this.page.locator('a.validation-icons-wrapper.error');
811
+ // Actively wait for the error icon to appear — isVisible() alone races against wizard rendering
812
+ let hasError = false;
813
+ try {
814
+ await errorIcon.waitFor({
815
+ state: 'visible',
816
+ timeout: 5000
817
+ });
818
+ hasError = true;
819
+ } catch {
820
+ // No validation errors detected
821
+ }
822
+ if (hasError) {
823
+ await this.page.getByRole('button', {
824
+ name: 'Deployment Properties'
825
+ }).click();
826
+ const usernameInput = this.page.locator('input[name="username"]');
827
+ await usernameInput.waitFor({
828
+ state: 'visible'
829
+ });
830
+ await usernameInput.fill(values[3]);
831
+ await this.page.getByRole('button', {
832
+ name: 'Save'
833
+ }).click();
834
+ await errorIcon.waitFor({
835
+ state: 'hidden',
836
+ timeout: 10000
837
+ });
838
+ }
839
+ await this.page.locator('button.deploy.xl-primary').waitFor({
840
+ state: 'visible'
841
+ });
842
+ await this.page.locator('button.deploy.xl-primary').click();
843
+ //Get the task id
844
+ const taskIdLocator = this.page.locator('div.task-id').first();
845
+ await (0, $lE6ZQ$expect)(taskIdLocator).toBeVisible({
846
+ timeout: 60000
847
+ });
848
+ await (0, $lE6ZQ$expect)(taskIdLocator).not.toHaveText('', {
849
+ timeout: 60000
850
+ });
851
+ this.taskId = (await taskIdLocator.textContent() ?? '').trim();
852
+ //Verify no failure and all are done
853
+ const labels = this.page.locator('span.label');
854
+ await (0, $lE6ZQ$expect)(labels).toHaveCount(3);
855
+ await (0, $lE6ZQ$expect)(labels).toHaveText([
856
+ 'EXECUTED',
857
+ 'DONE',
858
+ 'DONE'
859
+ ]);
860
+ //Get the text executed
861
+ await this.page.locator('div[data-id="0_1_1"] .infinite-tree-node > a').click();
862
+ await this.page.getByTitle('Execute Test Command').click();
863
+ this.executedText = await this.page.locator('div.step-log-body pre').nth(1).innerText();
864
+ //Verify in monitoring tab searching with the task id
865
+ await this.page.locator('div[data-id="TASK_MONITOR"] .infinite-tree-node > a').click();
866
+ await this.page.locator('span[data-id="DEPLOYMENT_TASKS"]').dblclick();
867
+ await this.page.waitForTimeout(5000);
868
+ await this.page.locator('div.deployment-task-filter-task-id input[placeholder="Search"]').first().fill(this.taskId);
869
+ const stateText = await this.page.locator('td.tasks-table-state').first().innerText();
870
+ (0, $lE6ZQ$expect)(stateText.trim()).toBe('Executed');
871
+ //Click the row to go to deployment screen
872
+ await this.page.locator('table.table.table-striped tbody tr').first().dblclick();
873
+ await this.page.locator('button.finish.xl-primary').click();
874
+ }
875
+ /* Deploys or redeploys the application in bulk — exact copy of deployApp flow with forceRedeploy */ async deployAppBulk(values) {
876
+ const versionNode = `Applications/${values[0]}/${values[1]}`;
877
+ await this.ensureExplorerTreeReady();
878
+ await this.waitForPackageNode(values[0], values[1]);
879
+ await this.openPackageMenuWithRetry(versionNode);
880
+ await this.page.getByRole('link', {
881
+ name: 'Deploy',
882
+ exact: true
883
+ }).click();
884
+ await this.page.locator(`input[name="selections"][value="Environments/${values[2]}"]`).click();
885
+ await this.page.getByRole('button', {
886
+ name: 'Continue'
887
+ }).click();
888
+ // Wait for the deployment properties wizard to fully load and evaluate validation rules
889
+ await this.page.locator('.errors-wrapper').waitFor({
890
+ state: 'attached',
891
+ timeout: 15000
892
+ });
893
+ const errorIcon = this.page.locator('a.validation-icons-wrapper.error');
894
+ let hasError = false;
895
+ try {
896
+ await errorIcon.waitFor({
897
+ state: 'visible',
898
+ timeout: 5000
899
+ });
900
+ hasError = true;
901
+ } catch {
902
+ // No validation errors detected
903
+ }
904
+ // Always open Deployment Properties to set forceRedeploy=true
905
+ await this.page.getByRole('button', {
906
+ name: 'Deployment Properties'
907
+ }).click();
908
+ const usernameInput = this.page.locator('input[name="username"]');
909
+ if (hasError) {
910
+ await usernameInput.waitFor({
911
+ state: 'visible'
912
+ });
913
+ await usernameInput.fill(values[3]);
914
+ }
915
+ const forceRedeployInput = this.page.locator('input[name="forceRedeploy"]');
916
+ await forceRedeployInput.waitFor({
917
+ state: 'visible',
918
+ timeout: 10000
919
+ });
920
+ if (!await forceRedeployInput.isChecked()) await forceRedeployInput.check();
921
+ await this.page.getByRole('button', {
922
+ name: 'Save'
923
+ }).click();
924
+ if (hasError) await errorIcon.waitFor({
925
+ state: 'hidden',
926
+ timeout: 10000
927
+ });
928
+ await this.page.locator('button.deploy.xl-primary').waitFor({
929
+ state: 'visible'
930
+ });
931
+ await this.page.locator('button.deploy.xl-primary').click();
932
+ const labels = this.page.locator('span.label');
933
+ await (0, $lE6ZQ$expect)(labels).toHaveCount(3, {
934
+ timeout: 120000
935
+ });
936
+ await (0, $lE6ZQ$expect)(labels).toHaveText([
937
+ 'EXECUTED',
938
+ 'DONE',
939
+ 'DONE'
940
+ ], {
941
+ timeout: 120000
942
+ });
943
+ const finishButton = this.page.locator('button.finish.xl-primary');
944
+ if (await finishButton.isVisible()) await finishButton.click();
945
+ await this.page.locator('div.xl-react-widget-modal-dialog.in').waitFor({
946
+ state: 'hidden',
947
+ timeout: 30000
948
+ });
949
+ }
950
+ /* Redeploy the same package repeatedly — delegates to deployAppBulk (forceRedeploy already set).
951
+ async redeployAppBulk(values: string[]): Promise<void> {
952
+ await this.deployAppBulk(values);
953
+ }*/ async verifyApplicationIsVisibleToTheUser(applicationName) {
954
+ //await this.navigation.homePage.clickExplorer();
955
+ await this.assertTreeNodeVisibility('Applications', applicationName, {
956
+ shouldBeVisible: true
957
+ });
958
+ }
959
+ async verifyCiNodesVisibility(nodes, shouldBeVisible, page = this.page) {
960
+ const { applicationName: applicationName, environmentName: environmentName, infrastructureName: infrastructureName } = nodes;
961
+ await page.locator('button.dot-avatar').waitFor({
962
+ state: 'visible',
963
+ timeout: 30000
964
+ });
965
+ const currentUrl = page.url();
966
+ if (!/#\/explorer/.test(currentUrl)) await page.goto('/#/explorer');
967
+ await page.waitForURL(/#\/explorer/);
968
+ await page.locator('div[data-id="Applications"]').waitFor({
969
+ state: 'visible',
970
+ timeout: 15000
971
+ });
972
+ await this.assertTreeNodeVisibility('Applications', applicationName, {
973
+ shouldBeVisible: shouldBeVisible,
974
+ page: page
975
+ });
976
+ await this.assertTreeNodeVisibility('Environments', environmentName, {
977
+ shouldBeVisible: shouldBeVisible,
978
+ page: page
979
+ });
980
+ await this.assertTreeNodeVisibility('Infrastructure', infrastructureName, {
981
+ shouldBeVisible: shouldBeVisible,
982
+ page: page
983
+ });
984
+ }
985
+ async assertTreeNodeVisibility(rootName, childName, { page: page = this.page, shouldBeVisible: shouldBeVisible }) {
986
+ const rootToggle = page.locator(`div[data-id="${rootName}"] .infinite-tree-node > a`);
987
+ await (0, $lE6ZQ$expect)(rootToggle).toBeVisible();
988
+ await rootToggle.click();
989
+ await page.locator(`div[data-id="${rootName}"]`).waitFor({
990
+ state: 'visible'
991
+ });
992
+ await page.waitForTimeout(1500);
993
+ const childNode = page.locator(`span[data-id="${rootName}/${childName}"]`);
994
+ if (shouldBeVisible) {
995
+ if (!await childNode.isVisible()) {
996
+ await rootToggle.click();
997
+ await page.waitForTimeout(1000);
998
+ }
999
+ await (0, $lE6ZQ$expect)(childNode).toBeVisible();
1000
+ } else await (0, $lE6ZQ$expect)(childNode).toHaveCount(0);
1001
+ }
1002
+ async refreshExplorerTree() {
1003
+ const refreshButton = this.page.getByRole('button', {
1004
+ name: 'Refresh'
1005
+ }).first();
1006
+ if (await refreshButton.isVisible()) {
1007
+ await refreshButton.click();
1008
+ await this.page.waitForLoadState('networkidle');
1009
+ }
1010
+ }
1011
+ async nodeExists(dataId) {
1012
+ await this.ensureExplorerTreeReady();
1013
+ const node = this.page.locator(`span[data-id="${dataId}"]`);
1014
+ if (await node.count() > 0) return true;
1015
+ await this.refreshExplorerTree();
1016
+ return await node.count() > 0;
1017
+ }
1018
+ async waitForApplicationNode(applicationName) {
1019
+ const appDataId = `Applications/${applicationName}`;
1020
+ const appNode = this.page.locator(`span[data-id="${appDataId}"]`);
1021
+ const rootToggle = this.page.locator('div[data-id="Applications"] .infinite-tree-node > a');
1022
+ await this.ensureExplorerTreeReady();
1023
+ await rootToggle.waitFor({
1024
+ state: 'visible'
1025
+ });
1026
+ for(let attempt = 0; attempt < 3; attempt += 1){
1027
+ if (await appNode.count() === 0 || !await appNode.isVisible()) {
1028
+ await rootToggle.click();
1029
+ await this.page.waitForTimeout(500);
1030
+ }
1031
+ try {
1032
+ await (0, $lE6ZQ$expect)(appNode).toBeVisible({
1033
+ timeout: 5000
1034
+ });
1035
+ return;
1036
+ } catch {
1037
+ await this.refreshExplorerTree();
1038
+ }
1039
+ }
1040
+ await (0, $lE6ZQ$expect)(appNode).toBeVisible({
1041
+ timeout: 15000
1042
+ });
1043
+ }
1044
+ async waitForPackageNode(applicationName, packageName) {
1045
+ const packageDataId = `Applications/${applicationName}/${packageName}`;
1046
+ const packageNode = this.page.locator(`span[data-id="${packageDataId}"]`);
1047
+ const appRow = this.page.locator(`div[data-id="Applications/${applicationName}"]`);
1048
+ const appToggle = appRow.locator('.infinite-tree-node > a');
1049
+ // Detects whether the app is already expanded (has any visible child span)
1050
+ const anyChildNode = this.page.locator(`span[data-id^="Applications/${applicationName}/"]`).first();
1051
+ await this.waitForApplicationNode(applicationName);
1052
+ await appRow.scrollIntoViewIfNeeded();
1053
+ await appToggle.waitFor({
1054
+ state: 'visible'
1055
+ });
1056
+ for(let attempt = 0; attempt < 5; attempt += 1){
1057
+ // Only click the toggle if the node is currently collapsed — prevents accidental collapse
1058
+ if (!await anyChildNode.isVisible()) {
1059
+ await appToggle.scrollIntoViewIfNeeded();
1060
+ await appToggle.click({
1061
+ force: true
1062
+ });
1063
+ await this.page.waitForTimeout(500);
1064
+ }
1065
+ try {
1066
+ await (0, $lE6ZQ$expect)(packageNode).toBeVisible({
1067
+ timeout: 5000
1068
+ });
1069
+ return;
1070
+ } catch {
1071
+ // Package still not visible — refresh tree and re-expand on next attempt
1072
+ await this.refreshExplorerTree();
1073
+ await this.waitForApplicationNode(applicationName);
1074
+ await appToggle.waitFor({
1075
+ state: 'visible'
1076
+ });
1077
+ }
1078
+ }
1079
+ await (0, $lE6ZQ$expect)(packageNode).toBeVisible({
1080
+ timeout: 15000
1081
+ });
1082
+ }
1083
+ async clickPackageNodeWithRetry(packageDataId) {
1084
+ const appName = packageDataId.split('/')[1];
1085
+ for(let attempt = 0; attempt < 3; attempt += 1){
1086
+ const appRow = this.page.locator(`div[data-id="Applications/${appName}"]`);
1087
+ const appToggle = appRow.locator('.infinite-tree-node > a');
1088
+ try {
1089
+ await appToggle.scrollIntoViewIfNeeded();
1090
+ } catch {
1091
+ // Tree can re-render between retries; re-query next loop.
1092
+ }
1093
+ await appToggle.click({
1094
+ force: true
1095
+ });
1096
+ const packageNode = this.page.locator(`span[data-id="${packageDataId}"]`).first();
1097
+ await (0, $lE6ZQ$expect)(packageNode).toBeVisible({
1098
+ timeout: 5000
1099
+ });
1100
+ try {
1101
+ await packageNode.click();
1102
+ return;
1103
+ } catch {
1104
+ await this.page.waitForTimeout(300);
1105
+ }
1106
+ }
1107
+ await this.page.locator(`span[data-id="${packageDataId}"]`).first().click();
1108
+ }
1109
+ async openPackageMenuWithRetry(versionDataId) {
1110
+ const appName = versionDataId.split('/')[1];
1111
+ const appToggle = this.page.locator(`div[data-id="Applications/${appName}"] .infinite-tree-node > a`);
1112
+ // The context-menu button is CSS-hidden until the tree row is hovered.
1113
+ // Hover the node row first so the button becomes visible, then click it.
1114
+ const nodeRow = this.page.locator(`div[data-id="${versionDataId}"] .infinite-tree-node`);
1115
+ for(let attempt = 0; attempt < 3; attempt += 1){
1116
+ const menuButton = this.page.locator(`i.context-menu-button[data-id="${versionDataId}"]`).first();
1117
+ try {
1118
+ await nodeRow.hover({
1119
+ timeout: 5000
1120
+ });
1121
+ await (0, $lE6ZQ$expect)(menuButton).toBeVisible({
1122
+ timeout: 5000
1123
+ });
1124
+ await menuButton.click();
1125
+ return;
1126
+ } catch {
1127
+ await appToggle.click();
1128
+ await this.page.waitForTimeout(300);
1129
+ }
1130
+ }
1131
+ await this.page.locator(`i.context-menu-button[data-id="${versionDataId}"]`).first().click({
1132
+ force: true
1133
+ });
1134
+ }
1135
+ }
1136
+
1137
+
1138
+
1139
+
1140
+ class $5eb37a606d823774$export$b8a443164510a1b4 extends (0, $7d546dcaafadc158$export$2b65d1d97338f32b) {
1141
+ async openTab(tabLabel, paneId) {
1142
+ const tab = this.page.locator('.app-root .dot-sidebar .dot-list p').filter({
1143
+ hasText: tabLabel
1144
+ }).first();
1145
+ await tab.scrollIntoViewIfNeeded();
1146
+ await tab.click();
1147
+ await this.page.locator(`#pane-${paneId}`).waitFor({
1148
+ state: 'visible',
1149
+ timeout: 20000
1150
+ });
1151
+ }
1152
+ async downloadReport(buttonLabel, paneId, selector) {
1153
+ const pane = this.page.locator(`#pane-${paneId}`);
1154
+ const exportButton = selector ? pane.locator(selector) : pane.getByRole('button', {
1155
+ name: buttonLabel
1156
+ });
1157
+ const fallbackButton = pane.locator('button:has-text("Export")');
1158
+ const downloadPromise = this.page.waitForEvent('download', {
1159
+ timeout: 20000
1160
+ });
1161
+ if (await exportButton.isVisible()) await exportButton.click();
1162
+ else await fallbackButton.first().click();
1163
+ return downloadPromise;
1164
+ }
1165
+ async openDashboardTab() {
1166
+ await this.openTab('Dashboard', 'DashboardTab');
1167
+ }
1168
+ async openDeploymentsTab() {
1169
+ await this.openTab('Deployments', 'DeploymentsTab');
1170
+ }
1171
+ async openControlTasksTab() {
1172
+ await this.openTab('Control tasks', 'ControlTasksTab');
1173
+ }
1174
+ async openAuditReportTab() {
1175
+ await this.openTab('Audit report', 'AuditReportTab');
1176
+ }
1177
+ async downloadDeploymentsExport() {
1178
+ return this.downloadReport('Export report', 'DeploymentsTab');
1179
+ }
1180
+ async downloadControlTasksExport() {
1181
+ return this.downloadReport('Export report', 'ControlTasksTab');
1182
+ }
1183
+ async downloadAuditReportExport() {
1184
+ return this.downloadReport('Export report', 'AuditReportTab');
1185
+ }
1186
+ /* Clicks on the Deployment Tasks section */ async clickDeploymentTasks() {
1187
+ await this.page.locator('p.MuiTypography-root', {
1188
+ hasText: 'Deployments'
1189
+ }).click();
1190
+ }
1191
+ async verifyTheDeploymentValues(values) {
1192
+ await this.page.locator('div.deployment-task-filter-task-id input[placeholder="Search"]:visible').first().fill(values[0]);
1193
+ const escapedApp = values[2].replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
1194
+ const escapedPkg = values[3].replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
1195
+ const packagePattern = new RegExp(`${escapedApp}/${escapedPkg}`, 'i');
1196
+ const row = this.page.locator('table.table-striped tbody tr').filter({
1197
+ has: this.page.locator('td.report-table-package .deployment-report-package', {
1198
+ hasText: packagePattern
1199
+ })
1200
+ }).first();
1201
+ await row.waitFor({
1202
+ state: 'visible',
1203
+ timeout: 5000
1204
+ });
1205
+ const packageCell = row.locator('td.report-table-package .deployment-report-package').first();
1206
+ await (0, $lE6ZQ$expect)(packageCell).toContainText(packagePattern);
1207
+ await (0, $lE6ZQ$expect)(row.locator('td.report-table-originalType .deployment-report-task-type')).toHaveText(/Initial/i);
1208
+ await (0, $lE6ZQ$expect)(row.locator('td.report-table-user .deployment-report-user')).toHaveText('admin');
1209
+ //Click the row
1210
+ await packageCell.dblclick();
1211
+ await this.page.locator('div[data-id="0_1_1"] .infinite-tree-node > a').click();
1212
+ await this.page.getByTitle('Execute Test Command').click();
1213
+ //Get the log text
1214
+ const text = await this.page.locator('div.step-log-body pre').nth(1).innerText();
1215
+ //Verify both the log text are same
1216
+ (0, $lE6ZQ$expect)(text).toContain(values[1]);
1217
+ }
1218
+ }
1219
+
1220
+
1221
+
1222
+
1223
+ class $9a7d1625454209b8$export$5c1198389e139c11 extends (0, $7d546dcaafadc158$export$2b65d1d97338f32b) {
1224
+ getPane() {
1225
+ return this.page.locator('#pane-ControlTasksTab');
1226
+ }
1227
+ getPagination() {
1228
+ return this.getPane().locator('.react-bootstrap-table-pagination');
1229
+ }
1230
+ getTableBody() {
1231
+ return this.getPane().locator('.react-bootstrap-table tbody');
1232
+ }
1233
+ getLastUpdated() {
1234
+ return this.getPane().locator('.last-updated-component');
1235
+ }
1236
+ // ── Navigation ───────────────────────────────────────────────────────────
1237
+ async verifySelected() {
1238
+ const pane = this.getPane();
1239
+ await (0, $lE6ZQ$expect)(pane).toBeVisible();
1240
+ await (0, $lE6ZQ$expect)(this.page.locator('.dot-sidebar a[href*="controltasks"], .dot-sidebar .dot-list p', {
1241
+ hasText: 'Control tasks'
1242
+ }).first()).toBeVisible();
1243
+ }
1244
+ // ── Filters ───────────────────────────────────────────────────────────────
1245
+ async verifyFiltersVisible() {
1246
+ const pane = this.getPane();
1247
+ const filtersPanel = pane.locator('.xl-react-redux-table-filters-panel');
1248
+ await (0, $lE6ZQ$expect)(filtersPanel).toBeVisible();
1249
+ await (0, $lE6ZQ$expect)(pane.locator('.control-task-filter-targets .react-tagsinput-input')).toBeVisible();
1250
+ await (0, $lE6ZQ$expect)(pane.locator('.control-task-filter-task-name input[placeholder="Search"]')).toBeVisible();
1251
+ await (0, $lE6ZQ$expect)(pane.locator('.control-task-id input[placeholder="Search"]')).toBeVisible();
1252
+ await (0, $lE6ZQ$expect)(pane.locator('.control-task-filter-start-date')).toBeVisible();
1253
+ await (0, $lE6ZQ$expect)(pane.locator('.control-task-filter-end-date')).toBeVisible();
1254
+ await (0, $lE6ZQ$expect)(pane.locator('.control-task-filter-worker input[placeholder="Search"]')).toBeVisible();
1255
+ await (0, $lE6ZQ$expect)(pane.locator('.control-task-filter-state .react-tagsinput-input')).toBeVisible();
1256
+ }
1257
+ async hideFilters() {
1258
+ const pane = this.getPane();
1259
+ const filtersPanel = pane.locator('.xl-react-redux-table-filters-panel');
1260
+ const hideFiltersButton = pane.getByRole('button', {
1261
+ name: 'Hide filters'
1262
+ });
1263
+ await (0, $lE6ZQ$expect)(filtersPanel).toBeVisible();
1264
+ await hideFiltersButton.click();
1265
+ await (0, $lE6ZQ$expect)(filtersPanel).toBeHidden();
1266
+ }
1267
+ async showFilters() {
1268
+ const pane = this.getPane();
1269
+ const filtersPanel = pane.locator('.xl-react-redux-table-filters-panel');
1270
+ const showFiltersButton = pane.getByRole('button', {
1271
+ name: 'Show filters'
1272
+ });
1273
+ if (await filtersPanel.isVisible()) return;
1274
+ for(let attempt = 0; attempt < 3; attempt += 1){
1275
+ if (await showFiltersButton.isVisible()) await showFiltersButton.click({
1276
+ force: true
1277
+ });
1278
+ if (await filtersPanel.isVisible()) return;
1279
+ await this.page.waitForTimeout(300);
1280
+ }
1281
+ await (0, $lE6ZQ$expect)(filtersPanel).toBeVisible();
1282
+ }
1283
+ async ensureFiltersVisible() {
1284
+ const pane = this.getPane();
1285
+ const filtersPanel = pane.locator('.xl-react-redux-table-filters-panel');
1286
+ if (await filtersPanel.isVisible()) return;
1287
+ const showFiltersButton = pane.getByRole('button', {
1288
+ name: 'Show filters'
1289
+ });
1290
+ if (await showFiltersButton.isVisible()) await showFiltersButton.click({
1291
+ force: true
1292
+ });
1293
+ await (0, $lE6ZQ$expect)(filtersPanel).toBeVisible();
1294
+ }
1295
+ // ── Date filters ─────────────────────────────────────────────────────────
1296
+ async setStartDate(value) {
1297
+ const field = this.getPane().locator('.control-task-filter-start-date');
1298
+ await field.click();
1299
+ await field.fill(value);
1300
+ await this.getLastUpdated().click({
1301
+ force: true
1302
+ });
1303
+ }
1304
+ async setEndDate(value) {
1305
+ const field = this.getPane().locator('.control-task-filter-end-date');
1306
+ await field.click();
1307
+ await field.fill(value);
1308
+ await this.getLastUpdated().click({
1309
+ force: true
1310
+ });
1311
+ }
1312
+ async expectStartDateValue(value) {
1313
+ await (0, $lE6ZQ$expect)(this.getPane().locator('.control-task-filter-start-date')).toHaveValue(value);
1314
+ }
1315
+ async expectEndDateValue(value) {
1316
+ await (0, $lE6ZQ$expect)(this.getPane().locator('.control-task-filter-end-date')).toHaveValue(value);
1317
+ }
1318
+ async checkInvalidStartDateError() {
1319
+ const field = this.getPane().locator('.control-task-filter-start-date');
1320
+ await field.click();
1321
+ await field.press('End');
1322
+ await field.press('a');
1323
+ await this.page.keyboard.press('Escape');
1324
+ await (0, $lE6ZQ$expect)(this.getPane().getByText('Example: Dec 1, 2018').first()).toBeVisible();
1325
+ }
1326
+ async checkInvalidEndDateError() {
1327
+ const field = this.getPane().locator('.control-task-filter-end-date');
1328
+ await field.click();
1329
+ await field.press('End');
1330
+ await field.press('b');
1331
+ await this.page.keyboard.press('Escape');
1332
+ await (0, $lE6ZQ$expect)(this.getPane().getByText('Example: Dec 1, 2018').first()).toBeVisible();
1333
+ }
1334
+ async expectNoStartDateError() {
1335
+ await (0, $lE6ZQ$expect)(this.getPane().getByText('Example: Dec 1, 2018')).toHaveCount(0);
1336
+ }
1337
+ async expectNoEndDateError() {
1338
+ await (0, $lE6ZQ$expect)(this.getPane().getByText('Example: Dec 1, 2018')).toHaveCount(0);
1339
+ }
1340
+ // ── Tag filters ───────────────────────────────────────────────────────────
1341
+ async selectTargetsTagsFilter(text, optionName) {
1342
+ await this.selectTagsFilterFirstSuggestion('.control-task-filter-targets .react-tagsinput', text, optionName);
1343
+ }
1344
+ async clearTargetsTagsFirstTag() {
1345
+ const remove = this.getPane().locator('.control-task-filter-targets .react-tagsinput-tag:nth-child(1) .react-tagsinput-remove');
1346
+ if (await remove.count()) await remove.click();
1347
+ }
1348
+ async selectStatesTagsFilter(text, optionName) {
1349
+ await this.selectTagsFilterFirstSuggestion('.control-task-filter-state .react-tagsinput', text, optionName);
1350
+ }
1351
+ async clearStatesTagsFirstTag() {
1352
+ const remove = this.getPane().locator('.control-task-filter-state .react-tagsinput-tag:nth-child(1) .react-tagsinput-remove');
1353
+ if (await remove.count()) await remove.click();
1354
+ }
1355
+ // ── Text filters ──────────────────────────────────────────────────────────
1356
+ async filterByTaskName(name) {
1357
+ await this.getPane().locator('.control-task-filter-task-name input[placeholder="Search"]').fill(name);
1358
+ }
1359
+ async clearTaskName() {
1360
+ await this.filterByTaskName('');
1361
+ }
1362
+ async filterByTaskId(id) {
1363
+ await this.getPane().locator('.control-task-id input[placeholder="Search"]').fill(id);
1364
+ }
1365
+ async clearTaskId() {
1366
+ await this.filterByTaskId('');
1367
+ }
1368
+ async filterByWorker(worker) {
1369
+ await this.getPane().locator('.control-task-filter-worker input[placeholder="Search"]').fill(worker);
1370
+ }
1371
+ async clearWorkerFilter() {
1372
+ await this.filterByWorker('');
1373
+ }
1374
+ // ── Tasks toggle ──────────────────────────────────────────────────────────
1375
+ async clickMyTasks() {
1376
+ await this.getPane().getByRole('button', {
1377
+ name: 'My tasks'
1378
+ }).click();
1379
+ }
1380
+ async clickAllTasks() {
1381
+ await this.getPane().getByRole('button', {
1382
+ name: 'All tasks'
1383
+ }).click();
1384
+ }
1385
+ // ── Toolbar ───────────────────────────────────────────────────────────────
1386
+ async clickRefresh() {
1387
+ await this.getPane().getByRole('button', {
1388
+ name: 'Refresh'
1389
+ }).click();
1390
+ }
1391
+ async verifyLastUpdatedAndRefresh() {
1392
+ const lastUpdated = this.getLastUpdated();
1393
+ await (0, $lE6ZQ$expect)(lastUpdated).toBeVisible();
1394
+ await (0, $lE6ZQ$expect)(lastUpdated).not.toHaveText('');
1395
+ await this.getPane().getByRole('button', {
1396
+ name: 'Refresh'
1397
+ }).click();
1398
+ await (0, $lE6ZQ$expect)(lastUpdated).toBeVisible();
1399
+ }
1400
+ // ── Table assertions ──────────────────────────────────────────────────────
1401
+ async verifyTableHasRowsOrEmpty() {
1402
+ const pane = this.getPane();
1403
+ const table = pane.locator('table.table-striped');
1404
+ await (0, $lE6ZQ$expect)(table).toBeVisible();
1405
+ const rows = this.getTableBody().locator('tr');
1406
+ const noDataCell = this.getTableBody().locator('td.react-bs-table-no-data');
1407
+ const emptyState = pane.getByText(/No report data available/i);
1408
+ await (0, $lE6ZQ$expect)(async ()=>{
1409
+ if (await rows.count() > 0) return true;
1410
+ if (await noDataCell.count() > 0 && await noDataCell.first().isVisible()) return true;
1411
+ if (await emptyState.count() > 0 && await emptyState.first().isVisible()) return true;
1412
+ return false;
1413
+ }).toBeTruthy();
1414
+ }
1415
+ async verifyTableColumns() {
1416
+ const headers = this.getPane().locator('.react-bootstrap-table thead th');
1417
+ await (0, $lE6ZQ$expect)(headers.filter({
1418
+ hasText: 'Control task name'
1419
+ })).toBeVisible();
1420
+ await (0, $lE6ZQ$expect)(headers.filter({
1421
+ hasText: 'Target CI'
1422
+ })).toBeVisible();
1423
+ await (0, $lE6ZQ$expect)(headers.filter({
1424
+ hasText: 'Description'
1425
+ })).toBeVisible();
1426
+ await (0, $lE6ZQ$expect)(headers.filter({
1427
+ hasText: 'User'
1428
+ })).toBeVisible();
1429
+ await (0, $lE6ZQ$expect)(headers.filter({
1430
+ hasText: 'State'
1431
+ })).toBeVisible();
1432
+ await (0, $lE6ZQ$expect)(headers.filter({
1433
+ hasText: 'Start date'
1434
+ })).toBeVisible();
1435
+ await (0, $lE6ZQ$expect)(headers.filter({
1436
+ hasText: 'End date'
1437
+ })).toBeVisible();
1438
+ await (0, $lE6ZQ$expect)(headers.filter({
1439
+ hasText: 'Worker'
1440
+ })).toBeVisible();
1441
+ }
1442
+ async waitForTableReady() {
1443
+ await (0, $lE6ZQ$expect)(async ()=>{
1444
+ const loading = await this.getPane().getByText('Data loading').count();
1445
+ (0, $lE6ZQ$expect)(loading).toBe(0);
1446
+ const table = this.getPane().locator('table.table-striped');
1447
+ (0, $lE6ZQ$expect)(await table.count()).toBeGreaterThan(0);
1448
+ }).toPass({
1449
+ timeout: 20000
1450
+ });
1451
+ }
1452
+ async expectNumberOfRows(count) {
1453
+ await this.waitForTableReady();
1454
+ await (0, $lE6ZQ$expect)(this.getTableBody().locator('tr')).toHaveCount(count);
1455
+ }
1456
+ async expectAtLeastNumberOfRows(count) {
1457
+ await this.waitForTableReady();
1458
+ await (0, $lE6ZQ$expect)(async ()=>{
1459
+ const total = await this.getTableBody().locator('tr').count();
1460
+ (0, $lE6ZQ$expect)(total).toBeGreaterThanOrEqual(count);
1461
+ }).toPass({
1462
+ timeout: 30000
1463
+ });
1464
+ }
1465
+ async expectTotal(total) {
1466
+ await (0, $lE6ZQ$expect)(this.getPagination().locator('> div').filter({
1467
+ hasText: 'Total:'
1468
+ })).toContainText(`Total: ${total}`);
1469
+ }
1470
+ async expectAtLeastTotal(count) {
1471
+ await this.waitForTableReady();
1472
+ await (0, $lE6ZQ$expect)(async ()=>{
1473
+ const text = await this.getPagination().locator('> div').filter({
1474
+ hasText: 'Total:'
1475
+ }).textContent();
1476
+ const match = text?.match(/Total:\s*(\d+)/);
1477
+ const total = match ? Number(match[1]) : 0;
1478
+ (0, $lE6ZQ$expect)(total).toBeGreaterThanOrEqual(count);
1479
+ }).toPass();
1480
+ }
1481
+ async getTotalCount() {
1482
+ await this.waitForTableReady();
1483
+ const text = await this.getPagination().locator('> div').filter({
1484
+ hasText: 'Total:'
1485
+ }).textContent();
1486
+ const match = text?.match(/Total:\s*(\d+)/);
1487
+ return match ? Number(match[1]) : 0;
1488
+ }
1489
+ async expectValue(row, column, expected) {
1490
+ const cell = this.getTableBody().locator(`tr:nth-child(${row}) td.report-table-${column}`);
1491
+ await (0, $lE6ZQ$expect)(cell).toHaveText(expected);
1492
+ }
1493
+ async expectValueContains(row, column, expected) {
1494
+ const cell = this.getTableBody().locator(`tr:nth-child(${row}) td.report-table-${column}`);
1495
+ await (0, $lE6ZQ$expect)(cell).toContainText(expected);
1496
+ }
1497
+ async shouldHaveScrollBar() {
1498
+ await this.waitForTableReady();
1499
+ const container = this.getPane().locator('div.report');
1500
+ const overflowX = await container.evaluate((el)=>window.getComputedStyle(el).overflowX);
1501
+ (0, $lE6ZQ$expect)([
1502
+ 'auto',
1503
+ 'scroll'
1504
+ ]).toContain(overflowX);
1505
+ }
1506
+ // ── Sorting ───────────────────────────────────────────────────────────────
1507
+ async sortBy(column) {
1508
+ await this.getPane().locator(`.react-bootstrap-table thead th.report-table-${column}`).click();
1509
+ }
1510
+ async verifyIsSorted(column) {
1511
+ const sortOrder = this.getPane().locator(`.react-bootstrap-table thead th.report-table-${column} .react-bootstrap-table-sort-order`);
1512
+ await (0, $lE6ZQ$expect)(sortOrder).toBeVisible();
1513
+ }
1514
+ async getColumnValues(column) {
1515
+ await this.waitForTableReady();
1516
+ const cells = this.getTableBody().locator(`tr td.report-table-${column}`);
1517
+ const count = await cells.count();
1518
+ const values = [];
1519
+ for(let i = 0; i < count; i += 1)values.push((await cells.nth(i).textContent())?.trim() ?? '');
1520
+ return values;
1521
+ }
1522
+ // ── Pagination ────────────────────────────────────────────────────────────
1523
+ async getLastPageNumber() {
1524
+ await this.waitForTableReady();
1525
+ const links = this.getPagination().getByRole('list').getByRole('link');
1526
+ const count = await links.count();
1527
+ if (count < 2) return 1;
1528
+ const text = await links.nth(count - 2).textContent();
1529
+ const num = Number(text?.trim());
1530
+ return Number.isFinite(num) && num > 0 ? num : 1;
1531
+ }
1532
+ async goToPage(page) {
1533
+ await this.getPagination().getByRole('link', {
1534
+ name: page.toString(),
1535
+ exact: true
1536
+ }).click();
1537
+ }
1538
+ async goToFirstPage() {
1539
+ const firstLink = this.getPagination().getByRole('link', {
1540
+ name: '<<'
1541
+ });
1542
+ if (await firstLink.count()) await firstLink.click();
1543
+ else await this.getPagination().getByRole('link', {
1544
+ name: '1',
1545
+ exact: true
1546
+ }).click();
1547
+ }
1548
+ async goToLastPage() {
1549
+ const lastLink = this.getPagination().getByRole('link', {
1550
+ name: '>>'
1551
+ });
1552
+ if (await lastLink.count()) await lastLink.click();
1553
+ else {
1554
+ const links = this.getPagination().getByRole('list').getByRole('link');
1555
+ const count = await links.count();
1556
+ await links.nth(count - 2).click();
1557
+ }
1558
+ }
1559
+ async goToPreviousPage() {
1560
+ await this.getPagination().getByRole('link', {
1561
+ name: '<',
1562
+ exact: true
1563
+ }).click();
1564
+ }
1565
+ async goToNextPage() {
1566
+ await this.getPagination().getByRole('link', {
1567
+ name: '>',
1568
+ exact: true
1569
+ }).click();
1570
+ }
1571
+ async expectPage(page) {
1572
+ await (0, $lE6ZQ$expect)(async ()=>{
1573
+ const pagination = this.getPagination();
1574
+ const activeLink = pagination.locator('li.active').getByRole('link', {
1575
+ name: page.toString(),
1576
+ exact: true
1577
+ });
1578
+ if (await activeLink.count() > 0) return;
1579
+ const ariaCurrent = pagination.locator('[aria-current="page"]').filter({
1580
+ hasText: page.toString()
1581
+ });
1582
+ if (await ariaCurrent.count() > 0) return;
1583
+ // When there is only 1 page, the pagination may not render page links at all.
1584
+ // In that case page 1 is implicitly active.
1585
+ if (page === 1) {
1586
+ const nextLink = pagination.getByRole('link', {
1587
+ name: '>',
1588
+ exact: true
1589
+ });
1590
+ const pageLinks = pagination.getByRole('link').filter({
1591
+ hasText: /^\d+$/
1592
+ });
1593
+ if (await nextLink.count() === 0 && await pageLinks.count() === 0) return;
1594
+ }
1595
+ throw new Error(`Page ${page} not active`);
1596
+ }).toPass({
1597
+ timeout: 30000
1598
+ });
1599
+ }
1600
+ async expectPageLinkVisible(pageNumber) {
1601
+ await (0, $lE6ZQ$expect)(this.getPagination().getByRole('link', {
1602
+ name: pageNumber.toString(),
1603
+ exact: true
1604
+ })).toBeVisible();
1605
+ }
1606
+ async expectPaginationLinksVisible() {
1607
+ await (0, $lE6ZQ$expect)(this.getPagination().getByRole('link', {
1608
+ name: '>',
1609
+ exact: true
1610
+ })).toBeVisible();
1611
+ }
1612
+ async expectPaginationLinksHidden() {
1613
+ await (0, $lE6ZQ$expect)(this.getPagination().getByRole('link', {
1614
+ name: '>',
1615
+ exact: true
1616
+ })).toHaveCount(0);
1617
+ }
1618
+ async setPageSize(size) {
1619
+ await this.openPageSizeMenu();
1620
+ await this.getPagination().getByRole('menu').getByRole('menuitem', {
1621
+ name: size.toString(),
1622
+ exact: true
1623
+ }).click();
1624
+ await this.waitForTableReady();
1625
+ }
1626
+ async expectPageSize(size) {
1627
+ await (0, $lE6ZQ$expect)(this.getPagination().getByRole('button', {
1628
+ name: size.toString(),
1629
+ exact: true
1630
+ })).toBeVisible();
1631
+ }
1632
+ async expectPageSizes(sizes) {
1633
+ await this.openPageSizeMenu();
1634
+ const menu = this.getPagination().getByRole('menu');
1635
+ await (0, $lE6ZQ$expect)(menu.getByRole('menuitem')).toHaveCount(sizes.length);
1636
+ for (const size of sizes)await (0, $lE6ZQ$expect)(menu.getByRole('menuitem', {
1637
+ name: size.toString(),
1638
+ exact: true
1639
+ })).toBeVisible();
1640
+ await this.closePageSizeMenu();
1641
+ }
1642
+ // ── Private helpers ───────────────────────────────────────────────────────
1643
+ async openPageSizeMenu() {
1644
+ const toggle = this.getPagination().locator('.dropdown-toggle');
1645
+ await toggle.click();
1646
+ await this.getPagination().getByRole('menu').waitFor({
1647
+ state: 'visible'
1648
+ });
1649
+ }
1650
+ async closePageSizeMenu() {
1651
+ const menu = this.getPagination().getByRole('menu');
1652
+ if (await menu.isVisible()) await this.getPagination().locator('.dropdown-toggle').click();
1653
+ }
1654
+ async expectTagAdded(tagTitle) {
1655
+ const tags = this.getPane().locator('.xl-react-widget-tags .react-tagsinput-tag');
1656
+ const byTitle = tags.locator(`[title='${tagTitle}']`);
1657
+ const byContainsTitle = tags.filter({
1658
+ hasText: tagTitle.split('/').pop() ?? tagTitle
1659
+ });
1660
+ if (await byTitle.count() > 0) await (0, $lE6ZQ$expect)(byTitle.first()).toBeVisible();
1661
+ else await (0, $lE6ZQ$expect)(byContainsTitle.first()).toBeVisible();
1662
+ }
1663
+ async selectTagsFilterFirstSuggestion(filterSelector, text, optionName) {
1664
+ const pane = this.getPane();
1665
+ const filter = pane.locator(filterSelector);
1666
+ const input = filter.locator('.xl-react-widget-autocomplete .react-tagsinput-input');
1667
+ await input.click({
1668
+ force: true
1669
+ });
1670
+ await input.fill(text);
1671
+ const suggestionList = pane.locator('.xl-react-autocomplete-suggestion-list');
1672
+ await (0, $lE6ZQ$expect)(suggestionList).toBeVisible();
1673
+ const optionByTitle = suggestionList.locator(`.yt-option[title="${optionName}"]`);
1674
+ const optionByText = suggestionList.locator('.yt-option', {
1675
+ hasText: optionName
1676
+ });
1677
+ const gridOption = suggestionList.getByRole('rowgroup').getByText(optionName, {
1678
+ exact: false
1679
+ });
1680
+ let option;
1681
+ if (await optionByTitle.count()) option = optionByTitle.first();
1682
+ else if (await optionByText.count()) option = optionByText.first();
1683
+ else option = gridOption.first();
1684
+ await (0, $lE6ZQ$expect)(option).toBeVisible();
1685
+ const iconCheckbox = option.locator('i.xl-icon.icon-s.checkbox');
1686
+ if (await iconCheckbox.count()) await iconCheckbox.click();
1687
+ else await option.click();
1688
+ await this.page.locator('body').click({
1689
+ position: {
1690
+ x: 10,
1691
+ y: 10
1692
+ }
1693
+ });
1694
+ await this.expectTagAdded(optionName);
1695
+ }
1696
+ }
1697
+
1698
+
1699
+
1700
+
1701
+ class $7e0dd2c52b1925ce$export$a3e02ac2d0adbb20 extends (0, $7d546dcaafadc158$export$2b65d1d97338f32b) {
1702
+ async downloadReport() {
1703
+ const pane = this.page.locator('#pane-DashboardTab');
1704
+ const exportButton = pane.locator('button.export-audit-report');
1705
+ const fallbackButton = pane.locator('button:has-text("Export")');
1706
+ const downloadPromise = this.page.waitForEvent('download', {
1707
+ timeout: 20000
1708
+ });
1709
+ if (await exportButton.isVisible()) await exportButton.click();
1710
+ else await fallbackButton.first().click();
1711
+ return downloadPromise;
1712
+ }
1713
+ async downloadDashboardExport() {
1714
+ return this.downloadReport();
1715
+ }
1716
+ async verifySummarySection() {
1717
+ const pane = this.page.locator('#pane-DashboardTab');
1718
+ const summary = pane.locator('.statistics-block');
1719
+ await (0, $lE6ZQ$expect)(pane.getByText('Usage summary for current month', {
1720
+ exact: false
1721
+ })).toBeVisible();
1722
+ await (0, $lE6ZQ$expect)(pane.locator('button:has-text("Export")')).toBeVisible();
1723
+ await (0, $lE6ZQ$expect)(summary.locator('.tile-title[title="Successful deployments"]')).toBeVisible();
1724
+ await (0, $lE6ZQ$expect)(summary.locator('.tile-title[title="Retried deployments"]')).toBeVisible();
1725
+ await (0, $lE6ZQ$expect)(summary.locator('.tile-title[title="Rollback deployments"]')).toBeVisible();
1726
+ await (0, $lE6ZQ$expect)(summary.locator('.tile-title[title="Aborted deployments"]')).toBeVisible();
1727
+ await (0, $lE6ZQ$expect)(pane.getByText('Deployment status overview', {
1728
+ exact: true
1729
+ })).toBeVisible();
1730
+ }
1731
+ async verifyLast30DaysSection() {
1732
+ const pane = this.page.locator('#pane-DashboardTab');
1733
+ await (0, $lE6ZQ$expect)(pane.locator('h1.time-period-text', {
1734
+ hasText: /Last 30 days/i
1735
+ })).toBeVisible();
1736
+ const successCard = pane.getByText('Top 10 successful deployments', {
1737
+ exact: true
1738
+ }).first().locator('..');
1739
+ const retriedCard = pane.getByText('Top 10 retried deployments', {
1740
+ exact: true
1741
+ }).first().locator('..');
1742
+ const longestCard = pane.getByText('Top 10 longest deployments', {
1743
+ exact: true
1744
+ }).first().locator('..');
1745
+ await this.expectCardHasDataOrEmpty(successCard);
1746
+ await this.expectCardHasDataOrEmpty(retriedCard);
1747
+ await this.expectCardHasDataOrEmpty(longestCard);
1748
+ }
1749
+ async verifySelected() {
1750
+ const pane = this.page.locator('#pane-DashboardTab');
1751
+ await (0, $lE6ZQ$expect)(pane).toBeVisible();
1752
+ await (0, $lE6ZQ$expect)(this.page.getByText('Dashboard', {
1753
+ exact: true
1754
+ })).toBeVisible();
1755
+ }
1756
+ async verifyLastUpdatedAndRefresh() {
1757
+ const pane = this.page.locator('#pane-DashboardTab');
1758
+ const lastUpdated = pane.locator('.last-updated-component');
1759
+ await (0, $lE6ZQ$expect)(lastUpdated).toBeVisible();
1760
+ await (0, $lE6ZQ$expect)(lastUpdated).not.toHaveText('');
1761
+ const refreshButton = pane.getByRole('button', {
1762
+ name: 'Refresh'
1763
+ });
1764
+ await refreshButton.click();
1765
+ await (0, $lE6ZQ$expect)(lastUpdated).toBeVisible();
1766
+ }
1767
+ async verifyDateRangeDefault() {
1768
+ const pane = this.page.locator('#pane-DashboardTab');
1769
+ const dateRangeInput = pane.locator('#date-range-input');
1770
+ await (0, $lE6ZQ$expect)(dateRangeInput).toHaveValue('Current month');
1771
+ }
1772
+ async selectDateRange(optionLabel) {
1773
+ const pane = this.page.locator('#pane-DashboardTab');
1774
+ const dateRangeInput = pane.locator('#date-range-input');
1775
+ try {
1776
+ await dateRangeInput.selectOption({
1777
+ label: optionLabel
1778
+ });
1779
+ return;
1780
+ } catch {
1781
+ // Fall back to clicking the open dropdown list.
1782
+ }
1783
+ await dateRangeInput.click();
1784
+ const optionRole = this.page.getByRole('option', {
1785
+ name: optionLabel
1786
+ });
1787
+ const menuItemRole = this.page.getByRole('menuitem', {
1788
+ name: optionLabel
1789
+ });
1790
+ const fallbackOption = this.page.locator('li', {
1791
+ hasText: optionLabel
1792
+ });
1793
+ if (await optionRole.isVisible()) {
1794
+ await optionRole.click();
1795
+ return;
1796
+ }
1797
+ if (await menuItemRole.isVisible()) {
1798
+ await menuItemRole.click();
1799
+ return;
1800
+ }
1801
+ await fallbackOption.first().click();
1802
+ }
1803
+ async verifyDateRangeHeaderContains(label) {
1804
+ const pane = this.page.locator('#pane-DashboardTab');
1805
+ await (0, $lE6ZQ$expect)(pane.locator('.title-header', {
1806
+ hasText: label
1807
+ })).toBeVisible();
1808
+ }
1809
+ async verifyOverviewChartsOrEmpty() {
1810
+ const pane = this.page.locator('#pane-DashboardTab');
1811
+ const statusOverview = pane.getByText('Deployment status overview', {
1812
+ exact: true
1813
+ }).first().locator('..');
1814
+ await this.expectWidgetHasChartOrEmpty(statusOverview);
1815
+ const numberOfDeployments = pane.getByText('Number of deployments over time', {
1816
+ exact: true
1817
+ }).first().locator('..');
1818
+ await this.expectWidgetHasChartOrEmpty(numberOfDeployments);
1819
+ const averageDuration = pane.getByText('Average deployment duration over time', {
1820
+ exact: true
1821
+ }).first().locator('..');
1822
+ await this.expectWidgetHasChartOrEmpty(averageDuration);
1823
+ }
1824
+ async verifyDeploymentStatusLegend() {
1825
+ const pane = this.page.locator('#pane-DashboardTab');
1826
+ const tile = pane.locator('.deployment-status-overview');
1827
+ await (0, $lE6ZQ$expect)(tile).toBeVisible();
1828
+ const legendItems = tile.locator('.recharts-legend-item-text');
1829
+ if (await legendItems.count()) {
1830
+ await (0, $lE6ZQ$expect)(legendItems.filter({
1831
+ hasText: 'Successful'
1832
+ }).first()).toBeVisible();
1833
+ await (0, $lE6ZQ$expect)(legendItems.filter({
1834
+ hasText: 'Retried'
1835
+ }).first()).toBeVisible();
1836
+ await (0, $lE6ZQ$expect)(legendItems.filter({
1837
+ hasText: 'Rollback'
1838
+ }).first()).toBeVisible();
1839
+ await (0, $lE6ZQ$expect)(legendItems.filter({
1840
+ hasText: 'Aborted'
1841
+ }).first()).toBeVisible();
1842
+ return;
1843
+ }
1844
+ // No-data state: chart, canvas, or no-data widget must be visible
1845
+ const chartOrNoData = tile.locator('svg, canvas, .no-data-widget');
1846
+ await (0, $lE6ZQ$expect)(chartOrNoData.first()).toBeVisible();
1847
+ }
1848
+ async verifyButtonsFocusable() {
1849
+ const pane = this.page.locator('#pane-DashboardTab');
1850
+ const exportButton = pane.getByRole('button', {
1851
+ name: 'Export'
1852
+ });
1853
+ const refreshButton = pane.getByRole('button', {
1854
+ name: 'Refresh'
1855
+ });
1856
+ await exportButton.focus();
1857
+ await (0, $lE6ZQ$expect)(exportButton).toBeFocused();
1858
+ await refreshButton.focus();
1859
+ await (0, $lE6ZQ$expect)(refreshButton).toBeFocused();
1860
+ }
1861
+ async verifyDateRangeOptions() {
1862
+ const pane = this.page.locator('#pane-DashboardTab');
1863
+ const select = pane.locator('#date-range-input');
1864
+ const expectedOptions = [
1865
+ 'Current month',
1866
+ 'Last 30 days',
1867
+ 'Last 90 days',
1868
+ 'Last 180 days',
1869
+ 'Last 360 days',
1870
+ 'Custom date range'
1871
+ ];
1872
+ for (const option of expectedOptions)await (0, $lE6ZQ$expect)(select.locator(`option:has-text("${option}")`)).toBeAttached();
1873
+ }
1874
+ async verifyLast6MonthsSection() {
1875
+ const pane = this.page.locator('#pane-DashboardTab');
1876
+ const trendBlock = pane.locator('.time-period-section.trend-block');
1877
+ await (0, $lE6ZQ$expect)(trendBlock).toBeVisible();
1878
+ await (0, $lE6ZQ$expect)(trendBlock.locator('h1.time-period-text')).toContainText('Last 6 months');
1879
+ const numDeployments = trendBlock.locator('.number-of-deployments-over-time');
1880
+ const avgDuration = trendBlock.locator('.average-deployment-duration-over-time');
1881
+ await (0, $lE6ZQ$expect)(numDeployments).toBeVisible();
1882
+ await (0, $lE6ZQ$expect)(avgDuration).toBeVisible();
1883
+ }
1884
+ async verifyKpiTileNumbers() {
1885
+ const pane = this.page.locator('#pane-DashboardTab');
1886
+ const tiles = [
1887
+ pane.locator('.successful.text-widget'),
1888
+ pane.locator('.retried.text-widget'),
1889
+ pane.locator('.rollback.text-widget'),
1890
+ pane.locator('.aborted.text-widget')
1891
+ ];
1892
+ for (const tile of tiles){
1893
+ await (0, $lE6ZQ$expect)(tile).toBeVisible();
1894
+ await (0, $lE6ZQ$expect)(tile.locator('.number')).toBeVisible();
1895
+ }
1896
+ }
1897
+ async verifyCustomDateRangeInputs() {
1898
+ const pane = this.page.locator('#pane-DashboardTab');
1899
+ await pane.locator('#date-range-input').selectOption({
1900
+ label: 'Custom date range'
1901
+ });
1902
+ await (0, $lE6ZQ$expect)(pane.locator('.custom-date-range')).toBeVisible();
1903
+ await (0, $lE6ZQ$expect)(pane.locator('#custom-range-start-date')).toBeVisible();
1904
+ await (0, $lE6ZQ$expect)(pane.locator('#custom-range-end-date')).toBeVisible();
1905
+ // Restore default
1906
+ await pane.locator('#date-range-input').selectOption({
1907
+ label: 'Current month'
1908
+ });
1909
+ }
1910
+ async expectCardHasDataOrEmpty(card) {
1911
+ const tableRows = card.locator('table tbody tr');
1912
+ if (await tableRows.count()) {
1913
+ await (0, $lE6ZQ$expect)(tableRows.first()).toBeVisible();
1914
+ return;
1915
+ }
1916
+ const rowData = card.locator('.row-data');
1917
+ if (await rowData.count()) {
1918
+ await (0, $lE6ZQ$expect)(rowData.first()).toBeAttached();
1919
+ return;
1920
+ }
1921
+ await (0, $lE6ZQ$expect)(card.getByText('No data available for the current period', {
1922
+ exact: true
1923
+ })).toBeVisible();
1924
+ }
1925
+ async expectWidgetHasChartOrEmpty(widget) {
1926
+ const chart = widget.locator('svg, canvas');
1927
+ const noData = widget.getByText('No data available for the current period', {
1928
+ exact: true
1929
+ });
1930
+ const chartVisible = await chart.first().isVisible();
1931
+ const noDataVisible = await noData.isVisible();
1932
+ (0, $lE6ZQ$expect)(chartVisible || noDataVisible).toBeTruthy();
1933
+ }
1934
+ }
1935
+
1936
+
1937
+
1938
+
1939
+ class $48379bea92ea9e64$export$41a993d086bafffd extends (0, $7d546dcaafadc158$export$2b65d1d97338f32b) {
1940
+ getPane() {
1941
+ return this.page.locator('#pane-DeploymentsTab');
1942
+ }
1943
+ getPagination() {
1944
+ return this.getPane().locator('.react-bootstrap-table-pagination');
1945
+ }
1946
+ getTableBody() {
1947
+ return this.getPane().locator('.react-bootstrap-table tbody');
1948
+ }
1949
+ getLastUpdated() {
1950
+ return this.getPane().locator('.last-updated-component');
1951
+ }
1952
+ async resolveDateField(containerSelector) {
1953
+ const container = this.getPane().locator(containerSelector);
1954
+ const input = container.locator('input');
1955
+ if (await input.count()) return input.first();
1956
+ return container;
1957
+ }
1958
+ async verifySelected() {
1959
+ const pane = this.getPane();
1960
+ await (0, $lE6ZQ$expect)(pane).toBeVisible();
1961
+ await (0, $lE6ZQ$expect)(this.page.getByText('Deployments', {
1962
+ exact: true
1963
+ })).toBeVisible();
1964
+ }
1965
+ async verifyFiltersVisible() {
1966
+ const pane = this.getPane();
1967
+ const filtersPanel = pane.locator('.xl-react-redux-table-filters-panel');
1968
+ await (0, $lE6ZQ$expect)(filtersPanel).toBeVisible();
1969
+ await (0, $lE6ZQ$expect)(pane.locator('.deployment-task-filter-start-date')).toBeVisible();
1970
+ await (0, $lE6ZQ$expect)(pane.locator('.deployment-task-filter-end-date')).toBeVisible();
1971
+ await (0, $lE6ZQ$expect)(pane.locator('.deployment-task-filter-task-id input[placeholder="Search"]')).toBeVisible();
1972
+ await (0, $lE6ZQ$expect)(pane.locator('.deployment-task-filter-worker input[placeholder="Search"]')).toBeVisible();
1973
+ await (0, $lE6ZQ$expect)(pane.locator('.deployment-task-filter-applications .react-tagsinput-input')).toBeVisible();
1974
+ await (0, $lE6ZQ$expect)(pane.locator('.deployment-task-filter-environments .react-tagsinput-input')).toBeVisible();
1975
+ await (0, $lE6ZQ$expect)(pane.locator('.deployment-task-filter-state .react-tagsinput-input')).toBeVisible();
1976
+ await (0, $lE6ZQ$expect)(pane.locator('.deployment-task-filter-types .react-tagsinput-input')).toBeVisible();
1977
+ const tasksFilterInput = pane.locator('.deployment-task-filter-tasks .react-tagsinput-input');
1978
+ if (await tasksFilterInput.count()) await (0, $lE6ZQ$expect)(tasksFilterInput).toBeVisible();
1979
+ }
1980
+ async verifyLastUpdatedAndRefresh() {
1981
+ const pane = this.getPane();
1982
+ const lastUpdated = this.getLastUpdated();
1983
+ await (0, $lE6ZQ$expect)(lastUpdated).toBeVisible();
1984
+ await (0, $lE6ZQ$expect)(lastUpdated).not.toHaveText('');
1985
+ const refreshButton = pane.getByRole('button', {
1986
+ name: 'Refresh'
1987
+ });
1988
+ await refreshButton.click();
1989
+ await (0, $lE6ZQ$expect)(lastUpdated).toBeVisible();
1990
+ }
1991
+ async verifyTableHasRowsOrEmpty() {
1992
+ const pane = this.getPane();
1993
+ const table = pane.locator('table.table-striped');
1994
+ await (0, $lE6ZQ$expect)(table).toBeVisible();
1995
+ const rows = this.getTableBody().locator('tr');
1996
+ const noDataCell = this.getTableBody().locator('tr td.react-bs-table-no-data');
1997
+ const emptyState = pane.getByText(/No data/i);
1998
+ await (0, $lE6ZQ$expect)(async ()=>{
1999
+ if (await rows.count()) return true;
2000
+ if (await noDataCell.count() > 0 && await noDataCell.first().isVisible()) return true;
2001
+ if (await emptyState.count() > 0 && await emptyState.first().isVisible()) return true;
2002
+ return false;
2003
+ }).toBeTruthy();
2004
+ }
2005
+ async hideFilters() {
2006
+ const pane = this.getPane();
2007
+ const filtersPanel = pane.locator('.xl-react-redux-table-filters-panel');
2008
+ const hideFiltersButton = pane.getByRole('button', {
2009
+ name: 'Hide filters'
2010
+ });
2011
+ await (0, $lE6ZQ$expect)(filtersPanel).toBeVisible();
2012
+ await hideFiltersButton.click();
2013
+ await (0, $lE6ZQ$expect)(filtersPanel).toBeHidden();
2014
+ }
2015
+ async showFilters() {
2016
+ const pane = this.getPane();
2017
+ const filtersPanel = pane.locator('.xl-react-redux-table-filters-panel');
2018
+ const showFiltersButton = pane.getByRole('button', {
2019
+ name: 'Show filters'
2020
+ });
2021
+ if (await filtersPanel.isVisible()) return;
2022
+ for(let attempt = 0; attempt < 3; attempt += 1){
2023
+ if (await showFiltersButton.isVisible()) await showFiltersButton.click({
2024
+ force: true
2025
+ });
2026
+ if (await filtersPanel.isVisible()) return;
2027
+ await this.page.waitForTimeout(300);
2028
+ }
2029
+ await (0, $lE6ZQ$expect)(filtersPanel).toBeVisible();
2030
+ }
2031
+ async ensureFiltersVisible() {
2032
+ const pane = this.getPane();
2033
+ const filtersPanel = pane.locator('.xl-react-redux-table-filters-panel');
2034
+ if (await filtersPanel.isVisible()) return;
2035
+ const showFiltersButton = pane.getByRole('button', {
2036
+ name: 'Show filters'
2037
+ });
2038
+ if (await showFiltersButton.isVisible()) await showFiltersButton.click({
2039
+ force: true
2040
+ });
2041
+ await (0, $lE6ZQ$expect)(filtersPanel).toBeVisible();
2042
+ }
2043
+ async clickRefresh() {
2044
+ const pane = this.getPane();
2045
+ await pane.getByRole('button', {
2046
+ name: 'Refresh'
2047
+ }).click();
2048
+ }
2049
+ async expectTotal(total) {
2050
+ await (0, $lE6ZQ$expect)(this.getPagination().locator('> div').filter({
2051
+ hasText: 'Total:'
2052
+ })).toContainText(`Total: ${total}`);
2053
+ }
2054
+ async expectNumberOfRows(count) {
2055
+ await this.waitForTableReady();
2056
+ await (0, $lE6ZQ$expect)(this.getTableBody().locator('tr')).toHaveCount(count);
2057
+ }
2058
+ async expectAtLeastNumberOfRows(count) {
2059
+ await this.waitForTableReady();
2060
+ await (0, $lE6ZQ$expect)(async ()=>{
2061
+ const total = await this.getTableBody().locator('tr').count();
2062
+ (0, $lE6ZQ$expect)(total).toBeGreaterThanOrEqual(count);
2063
+ }).toPass({
2064
+ timeout: 30000
2065
+ });
2066
+ }
2067
+ async expectAtLeastTotal(count) {
2068
+ await this.waitForTableReady();
2069
+ await (0, $lE6ZQ$expect)(async ()=>{
2070
+ const text = await this.getPagination().locator('> div').filter({
2071
+ hasText: 'Total:'
2072
+ }).textContent();
2073
+ const match = text?.match(/Total:\s*(\d+)/);
2074
+ const total = match ? Number(match[1]) : 0;
2075
+ (0, $lE6ZQ$expect)(total).toBeGreaterThanOrEqual(count);
2076
+ }).toPass();
2077
+ }
2078
+ async expectValue(row, column, expected) {
2079
+ const cell = this.getTableBody().locator(`tr:nth-child(${row}) td.report-table-${column}`);
2080
+ await (0, $lE6ZQ$expect)(cell).toHaveText(expected);
2081
+ }
2082
+ async expectValueContains(row, column, expected) {
2083
+ const cell = this.getTableBody().locator(`tr:nth-child(${row}) td.report-table-${column}`);
2084
+ await (0, $lE6ZQ$expect)(cell).toContainText(expected);
2085
+ }
2086
+ async sortBy(column) {
2087
+ const header = this.getPane().locator(`.react-bootstrap-table thead th.report-table-${column}`);
2088
+ await header.click();
2089
+ }
2090
+ async isAscendingSorted(column) {
2091
+ const sortOrder = this.getPane().locator(`.react-bootstrap-table thead th.report-table-${column} .react-bootstrap-table-sort-order`);
2092
+ await (0, $lE6ZQ$expect)(sortOrder).toBeVisible();
2093
+ }
2094
+ async getColumnValues(column) {
2095
+ await this.waitForTableReady();
2096
+ const cells = this.getTableBody().locator(`tr td.report-table-${column}`);
2097
+ const count = await cells.count();
2098
+ const values = [];
2099
+ for(let i = 0; i < count; i += 1)values.push((await cells.nth(i).textContent())?.trim() ?? '');
2100
+ return values;
2101
+ }
2102
+ async getLastPageNumber() {
2103
+ await this.waitForTableReady();
2104
+ const links = this.getPagination().getByRole('list').getByRole('link');
2105
+ const count = await links.count();
2106
+ if (count < 2) return 1;
2107
+ // links order on page 1: [1, 2, ..., n, >] — last numeric is nth(count-2)
2108
+ const text = await links.nth(count - 2).textContent();
2109
+ const num = Number(text?.trim());
2110
+ return Number.isFinite(num) && num > 0 ? num : 1;
2111
+ }
2112
+ async getTotalCount() {
2113
+ await this.waitForTableReady();
2114
+ const text = await this.getPagination().locator('> div').filter({
2115
+ hasText: 'Total:'
2116
+ }).textContent();
2117
+ const match = text?.match(/Total:\s*(\d+)/);
2118
+ return match ? Number(match[1]) : 0;
2119
+ }
2120
+ async expectPage(page) {
2121
+ await (0, $lE6ZQ$expect)(async ()=>{
2122
+ const pagination = this.getPagination();
2123
+ // primary: react-bootstrap li.active with child link
2124
+ const activeLink = pagination.locator('li.active').getByRole('link', {
2125
+ name: page.toString(),
2126
+ exact: true
2127
+ });
2128
+ if (await activeLink.count() > 0) return;
2129
+ // fallback: aria-current="page"
2130
+ const ariaCurrent = pagination.locator('[aria-current="page"]').filter({
2131
+ hasText: page.toString()
2132
+ });
2133
+ if (await ariaCurrent.count() > 0) return;
2134
+ throw new Error(`Page ${page} not active`);
2135
+ }).toPass({
2136
+ timeout: 30000
2137
+ });
2138
+ }
2139
+ async goToPage(page) {
2140
+ await this.getPagination().getByRole('link', {
2141
+ name: page.toString()
2142
+ }).click();
2143
+ }
2144
+ async goToFirstPage() {
2145
+ const firstLink = this.getPagination().getByRole('link', {
2146
+ name: '<<'
2147
+ });
2148
+ if (await firstLink.count()) await firstLink.click();
2149
+ else await this.getPagination().getByRole('link', {
2150
+ name: '1',
2151
+ exact: true
2152
+ }).click();
2153
+ }
2154
+ async goToLastPage() {
2155
+ const lastLink = this.getPagination().getByRole('link', {
2156
+ name: '>>'
2157
+ });
2158
+ if (await lastLink.count()) await lastLink.click();
2159
+ else {
2160
+ const links = this.getPagination().getByRole('list').getByRole('link');
2161
+ const count = await links.count();
2162
+ // last numeric link is second-to-last (last is '>')
2163
+ await links.nth(count - 2).click();
2164
+ }
2165
+ }
2166
+ async goToPreviousPage() {
2167
+ await this.getPagination().getByRole('link', {
2168
+ name: '<',
2169
+ exact: true
2170
+ }).click();
2171
+ }
2172
+ async goToNextPage() {
2173
+ await this.getPagination().getByRole('link', {
2174
+ name: '>',
2175
+ exact: true
2176
+ }).click();
2177
+ }
2178
+ async expectPageLinkVisible(pageNumber) {
2179
+ await (0, $lE6ZQ$expect)(this.getPagination().getByRole('link', {
2180
+ name: pageNumber.toString(),
2181
+ exact: true
2182
+ })).toBeVisible();
2183
+ }
2184
+ async expectPaginationLinksVisible() {
2185
+ await (0, $lE6ZQ$expect)(this.getPagination().getByRole('link', {
2186
+ name: '>',
2187
+ exact: true
2188
+ })).toBeVisible();
2189
+ }
2190
+ async expectPaginationLinksHidden() {
2191
+ await (0, $lE6ZQ$expect)(this.getPagination().getByRole('link', {
2192
+ name: '>',
2193
+ exact: true
2194
+ })).toHaveCount(0);
2195
+ }
2196
+ async expectPageSize(size) {
2197
+ await (0, $lE6ZQ$expect)(this.getPagination().getByRole('button', {
2198
+ name: size.toString(),
2199
+ exact: true
2200
+ })).toBeVisible();
2201
+ }
2202
+ async expectPageSizes(sizes) {
2203
+ await this.openPageSizeMenu();
2204
+ const menu = this.getPagination().getByRole('menu');
2205
+ await (0, $lE6ZQ$expect)(menu.getByRole('menuitem')).toHaveCount(sizes.length);
2206
+ for (const size of sizes)await (0, $lE6ZQ$expect)(menu.getByRole('menuitem', {
2207
+ name: size.toString(),
2208
+ exact: true
2209
+ })).toBeVisible();
2210
+ await this.closePageSizeMenu();
2211
+ }
2212
+ async setPageSize(size) {
2213
+ await this.openPageSizeMenu();
2214
+ await this.getPagination().getByRole('menu').getByRole('menuitem', {
2215
+ name: size.toString(),
2216
+ exact: true
2217
+ }).click();
2218
+ await this.waitForTableReady();
2219
+ }
2220
+ async shouldHaveScrollBar() {
2221
+ await this.waitForTableReady();
2222
+ const container = this.getPane().locator('div.report');
2223
+ const overflowX = await container.evaluate((el)=>window.getComputedStyle(el).overflowX);
2224
+ (0, $lE6ZQ$expect)([
2225
+ 'auto',
2226
+ 'scroll'
2227
+ ]).toContain(overflowX);
2228
+ }
2229
+ async setStartDate(value) {
2230
+ const field = await this.resolveDateField('.deployment-task-filter-start-date');
2231
+ await field.click();
2232
+ await field.fill(value);
2233
+ await this.getLastUpdated().click({
2234
+ force: true
2235
+ });
2236
+ }
2237
+ async setEndDate(value) {
2238
+ const field = await this.resolveDateField('.deployment-task-filter-end-date');
2239
+ await field.click();
2240
+ await field.fill(value);
2241
+ await this.getLastUpdated().click({
2242
+ force: true
2243
+ });
2244
+ }
2245
+ async expectStartDateValue(value) {
2246
+ await this.expectDateFieldValue('.deployment-task-filter-start-date', value);
2247
+ }
2248
+ async expectEndDateValue(value) {
2249
+ await this.expectDateFieldValue('.deployment-task-filter-end-date', value);
2250
+ }
2251
+ async checkInvalidStartDateError() {
2252
+ const field = await this.resolveDateField('.deployment-task-filter-start-date');
2253
+ await field.click(); // opens calendar
2254
+ await field.press('End');
2255
+ await field.press('a'); // append invalid char
2256
+ await this.page.keyboard.press('Escape'); // close calendar → error appears below field
2257
+ await (0, $lE6ZQ$expect)(this.getPane().getByText('Example: Dec 1, 2018').first()).toBeVisible();
2258
+ }
2259
+ async checkInvalidEndDateError() {
2260
+ const field = await this.resolveDateField('.deployment-task-filter-end-date');
2261
+ await field.click(); // opens calendar
2262
+ await field.press('End');
2263
+ await field.press('b'); // append invalid char
2264
+ await this.page.keyboard.press('Escape'); // close calendar → error appears below field
2265
+ await (0, $lE6ZQ$expect)(this.getPane().getByText('Example: Dec 1, 2018').first()).toBeVisible();
2266
+ }
2267
+ async expectNoStartDateError() {
2268
+ await (0, $lE6ZQ$expect)(this.getPane().getByText('Example: Dec 1, 2018')).toHaveCount(0);
2269
+ }
2270
+ async expectNoEndDateError() {
2271
+ await (0, $lE6ZQ$expect)(this.getPane().getByText('Example: Dec 1, 2018')).toHaveCount(0);
2272
+ }
2273
+ async selectRadioFilter(label) {
2274
+ await this.ensureFiltersVisible();
2275
+ const pane = this.getPane();
2276
+ const radioGroup = pane.locator('.xl-react-widget-radio-group');
2277
+ const labelLocator = radioGroup.locator(`label[data='${label}']`);
2278
+ if (await labelLocator.count()) {
2279
+ await labelLocator.click();
2280
+ return;
2281
+ }
2282
+ const fallbackByText = radioGroup.getByText(label, {
2283
+ exact: true
2284
+ });
2285
+ if (await fallbackByText.count()) {
2286
+ await fallbackByText.click();
2287
+ return;
2288
+ }
2289
+ const ariaRadio = pane.locator('[role="radio"]', {
2290
+ hasText: label
2291
+ });
2292
+ if (await ariaRadio.count()) await ariaRadio.first().click();
2293
+ }
2294
+ async expectApplicationsRadioSelected() {
2295
+ const radio = this.getPane().locator('.xl-react-widget-radio-group label[data="Application(s)"]');
2296
+ if (await radio.count() === 0) return;
2297
+ await (0, $lE6ZQ$expect)(radio).toHaveAttribute('style', /background-color/);
2298
+ }
2299
+ async selectTagsFilterApplications(text, optionName) {
2300
+ await this.selectTagsFilterFirstSuggestion('.deployment-task-filter-applications .react-tagsinput', text, optionName);
2301
+ }
2302
+ async selectTagsFilterEnvironments(text, optionName) {
2303
+ await this.selectTagsFilterFirstSuggestion('.deployment-task-filter-environments .react-tagsinput', text, optionName);
2304
+ }
2305
+ async selectStatesTagsFilterFirstSuggestion(text, optionName) {
2306
+ await this.selectTagsFilterFirstSuggestion('.deployment-task-filter-state .react-tagsinput', text, optionName);
2307
+ }
2308
+ async clearStatesTagsFirstTag() {
2309
+ const remove = this.getPane().locator('.deployment-task-filter-state .react-tagsinput-tag:nth-child(1) .react-tagsinput-remove');
2310
+ if (await remove.count()) await remove.click();
2311
+ }
2312
+ async clearApplicationsTagsFirstTag() {
2313
+ const remove = this.getPane().locator('.deployment-task-filter-applications .react-tagsinput-tag:nth-child(1) .react-tagsinput-remove');
2314
+ if (await remove.count()) await remove.click();
2315
+ }
2316
+ async clearEnvironmentsTagsFirstTag() {
2317
+ const remove = this.getPane().locator('.deployment-task-filter-environments .react-tagsinput-tag:nth-child(1) .react-tagsinput-remove');
2318
+ if (await remove.count()) await remove.click();
2319
+ }
2320
+ async setTaskId(taskId) {
2321
+ const input = this.getPane().locator('.deployment-task-filter-task-id input');
2322
+ await input.fill(taskId);
2323
+ await (0, $lE6ZQ$expect)(input).toHaveValue(taskId);
2324
+ }
2325
+ async setWorkerName(workerName) {
2326
+ const input = this.getPane().locator('.deployment-task-filter-worker input');
2327
+ await input.fill(workerName);
2328
+ await (0, $lE6ZQ$expect)(input).toHaveValue(workerName);
2329
+ }
2330
+ async clearWorkerName() {
2331
+ await this.setWorkerName('');
2332
+ }
2333
+ async expectTagAdded(tagTitle) {
2334
+ const tags = this.getPane().locator('.xl-react-widget-tags .react-tagsinput-tag');
2335
+ const byTitle = tags.locator(`[title='${tagTitle}']`);
2336
+ const byContainsTitle = tags.filter({
2337
+ hasText: tagTitle.split('/').pop() ?? tagTitle
2338
+ });
2339
+ const count = await byTitle.count();
2340
+ if (count > 0) await (0, $lE6ZQ$expect)(byTitle.first()).toBeVisible();
2341
+ else await (0, $lE6ZQ$expect)(byContainsTitle.first()).toBeVisible();
2342
+ }
2343
+ async selectTagsFilterFirstSuggestion(filterSelector, text, optionName) {
2344
+ const pane = this.getPane();
2345
+ const filter = pane.locator(filterSelector);
2346
+ const input = filter.locator('.xl-react-widget-autocomplete .react-tagsinput-input');
2347
+ await input.click({
2348
+ force: true
2349
+ });
2350
+ await input.fill(text);
2351
+ const suggestionList = pane.locator('.xl-react-autocomplete-suggestion-list');
2352
+ await (0, $lE6ZQ$expect)(suggestionList).toBeVisible();
2353
+ // Try .yt-option first (State/Type filters), then aria grid row (Application/Environment filters)
2354
+ const optionByTitle = suggestionList.locator(`.yt-option[title="${optionName}"]`);
2355
+ const optionByText = suggestionList.locator('.yt-option', {
2356
+ hasText: optionName
2357
+ });
2358
+ const gridOption = suggestionList.getByRole('rowgroup').getByText(optionName, {
2359
+ exact: false
2360
+ });
2361
+ let option;
2362
+ if (await optionByTitle.count()) option = optionByTitle.first();
2363
+ else if (await optionByText.count()) option = optionByText.first();
2364
+ else option = gridOption.first();
2365
+ await (0, $lE6ZQ$expect)(option).toBeVisible();
2366
+ const iconCheckbox = option.locator('i.xl-icon.icon-s.checkbox');
2367
+ if (await iconCheckbox.count()) await iconCheckbox.click();
2368
+ else await option.click();
2369
+ await this.page.locator('body').click({
2370
+ position: {
2371
+ x: 10,
2372
+ y: 10
2373
+ }
2374
+ });
2375
+ await this.expectTagAdded(optionName);
2376
+ }
2377
+ async waitForTableReady() {
2378
+ // Poll until loading indicator is gone AND table content (rows or empty state) is present
2379
+ await (0, $lE6ZQ$expect)(async ()=>{
2380
+ const loading = await this.getPane().getByText('Data loading').count();
2381
+ if (loading > 0) throw new Error('Still loading');
2382
+ const rows = await this.getTableBody().locator('tr').count();
2383
+ const noData = await this.getTableBody().locator('td.react-bs-table-no-data').count();
2384
+ if (rows === 0 && noData === 0) throw new Error('No table content yet');
2385
+ }).toPass({
2386
+ timeout: 60000
2387
+ });
2388
+ }
2389
+ async openPageSizeMenu() {
2390
+ const btn = this.getPagination().getByRole('toolbar').getByRole('button');
2391
+ const expanded = await btn.getAttribute('aria-expanded');
2392
+ if (expanded !== 'true') {
2393
+ await btn.click();
2394
+ await (0, $lE6ZQ$expect)(this.getPagination().getByRole('menu')).toBeVisible();
2395
+ }
2396
+ }
2397
+ async closePageSizeMenu() {
2398
+ const btn = this.getPagination().getByRole('toolbar').getByRole('button');
2399
+ const expanded = await btn.getAttribute('aria-expanded');
2400
+ if (expanded === 'true') {
2401
+ await btn.click();
2402
+ await (0, $lE6ZQ$expect)(this.getPagination().getByRole('menu')).toBeHidden();
2403
+ }
2404
+ }
2405
+ async expectDateFieldValue(containerSelector, value) {
2406
+ const container = this.getPane().locator(containerSelector);
2407
+ const input = container.locator('input');
2408
+ if (await input.count() > 0) {
2409
+ await (0, $lE6ZQ$expect)(input.first()).toHaveValue(value);
2410
+ return;
2411
+ }
2412
+ await (0, $lE6ZQ$expect)(container).toHaveValue(value);
2413
+ }
2414
+ }
2415
+
2416
+
2417
+
2418
+ class $801d6ccd71155137$export$e37b272c81a10693 extends (0, $6480ad852470b7ac$export$cb21416f3c2fd176) {
2419
+ /* Navigates to the Infrastructure Edit Permissions page via the tree context menu */ async navigateToPage() {
2420
+ await this.openRootContextMenu('Infrastructure');
2421
+ await this.page.getByRole('link', {
2422
+ name: 'Edit Permissions'
2423
+ }).click();
2424
+ }
2425
+ async navigateToInfraEditPermissionPage() {
2426
+ await this.navigateToPage();
2427
+ }
2428
+ /* Gives the permissions to a role */ async givePermissionsToRole(roleName) {
2429
+ const filter = this.page.getByPlaceholder('Filter by roles').first();
2430
+ await filter.waitFor({
2431
+ state: 'visible'
2432
+ });
2433
+ await filter.scrollIntoViewIfNeeded();
2434
+ await filter.fill(roleName);
2435
+ const roleRow = this.page.locator('table.table-striped tbody tr').first();
2436
+ const checkboxes = roleRow.locator('input[type="checkbox"]');
2437
+ const count = await checkboxes.count();
2438
+ for(let i = 0; i < count; i += 1){
2439
+ const checkbox = checkboxes.nth(i);
2440
+ if (!await checkbox.isChecked()) await checkbox.check();
2441
+ }
2442
+ await this.page.getByRole('button', {
2443
+ name: 'Save and close'
2444
+ }).click();
2445
+ await this.handleSaveToastOrAlreadyExists();
2446
+ }
2447
+ }
2448
+
2449
+
2450
+
2451
+ class $0c1804a88a0b5036$export$c919546f4bf88f35 extends (0, $6480ad852470b7ac$export$cb21416f3c2fd176) {
2452
+ /* Navigates to the Environments Edit Permissions page via the tree context menu */ async navigateToPage() {
2453
+ await this.openRootContextMenu('Environments');
2454
+ await this.page.getByRole('link', {
2455
+ name: 'Edit Permissions'
2456
+ }).click();
2457
+ }
2458
+ async navigateToEnvEditPermissionPage() {
2459
+ await this.navigateToPage();
2460
+ }
2461
+ /* Gives the permissions to a role */ async givePermissionsToRole(roleName) {
2462
+ const filter = this.page.getByPlaceholder('Filter by roles').first();
2463
+ await filter.waitFor({
2464
+ state: 'visible'
2465
+ });
2466
+ await filter.scrollIntoViewIfNeeded();
2467
+ await filter.fill(roleName);
2468
+ const roleRow = this.page.locator('table.table-striped tbody tr').first();
2469
+ const labels = [
2470
+ 'deploy initial',
2471
+ 'read',
2472
+ 'repo edit'
2473
+ ];
2474
+ const headers = this.page.locator('table.table-striped thead th');
2475
+ const headerCount = await headers.count();
2476
+ const headerTexts = [];
2477
+ for(let i = 0; i < headerCount; i += 1)headerTexts.push((await headers.nth(i).innerText()).trim().toLowerCase());
2478
+ for (const label of labels){
2479
+ const colIndex = headerTexts.findIndex((text)=>text.includes(label));
2480
+ if (colIndex === -1) throw new Error(`Permission column not found: ${label}`);
2481
+ const checkbox = roleRow.locator('td').nth(colIndex).locator('input[type="checkbox"]');
2482
+ if (!await checkbox.isChecked()) await checkbox.check();
2483
+ }
2484
+ await this.page.getByRole('button', {
2485
+ name: 'Save and close'
2486
+ }).click();
2487
+ await this.handleSaveToastOrAlreadyExists();
2488
+ }
2489
+ }
2490
+
2491
+
2492
+
2493
+ class $e3cbc2135fe6aa40$export$ecd8b3e50e92d781 extends (0, $6480ad852470b7ac$export$cb21416f3c2fd176) {
2494
+ /* Navigates to the Applications Edit Permissions page via the tree context menu */ async navigateToPage() {
2495
+ await this.openRootContextMenu('Applications');
2496
+ await this.page.getByRole('link', {
2497
+ name: 'Edit Permissions'
2498
+ }).click();
2499
+ }
2500
+ async navigateToAppEditPermissionPage() {
2501
+ await this.navigateToPage();
2502
+ }
2503
+ /* Gives the permissions to a role */ async givePermissionsToRole(roleName) {
2504
+ const filter = this.page.getByPlaceholder('Filter by roles').first();
2505
+ await filter.waitFor({
2506
+ state: 'visible'
2507
+ });
2508
+ await filter.scrollIntoViewIfNeeded();
2509
+ await filter.fill(roleName);
2510
+ const roleRow = this.page.locator('table.table-striped tbody tr').first();
2511
+ const labels = [
2512
+ 'read',
2513
+ 'repo edit'
2514
+ ];
2515
+ const headers = this.page.locator('table.table-striped thead th');
2516
+ const headerCount = await headers.count();
2517
+ const headerTexts = [];
2518
+ for(let i = 0; i < headerCount; i += 1)headerTexts.push((await headers.nth(i).innerText()).trim().toLowerCase());
2519
+ for (const label of labels){
2520
+ const colIndex = headerTexts.findIndex((text)=>text.includes(label));
2521
+ if (colIndex === -1) throw new Error(`Permission column not found: ${label}`);
2522
+ const checkbox = roleRow.locator('td').nth(colIndex).locator('input[type="checkbox"]');
2523
+ if (!await checkbox.isChecked()) await checkbox.check();
2524
+ }
2525
+ await this.page.getByRole('button', {
2526
+ name: 'Save and close'
2527
+ }).click();
2528
+ await this.handleSaveToastOrAlreadyExists();
2529
+ }
2530
+ }
2531
+
2532
+
2533
+ class $95d5ebc9765b570f$export$b8a61e5c71402559 extends (0, $6480ad852470b7ac$export$cb21416f3c2fd176) {
2534
+ constructor(page){
2535
+ super(page);
110
2536
  this.homePage = new (0, $e18c8d3707c8c74c$export$36d69433c4f81145)(page);
111
2537
  this.userPage = new (0, $ca2721b1aeb903c5$export$ecdc3cf9d1cfe143)(page);
2538
+ this.overthereLocalHostPage = new (0, $a4d71fd851704781$export$c88e1d16f82516d)(page);
2539
+ this.environmentsPage = new (0, $a63f1342e8823465$export$12530425267834a9)(page);
2540
+ this.applicationsPage = new (0, $3fb4750cbb53e5e6$export$1533b625ec0c75e2)(page);
2541
+ this.reportsPage = new (0, $5eb37a606d823774$export$b8a443164510a1b4)(page);
2542
+ this.reportsControlTasksPage = new (0, $9a7d1625454209b8$export$5c1198389e139c11)(page);
2543
+ this.reportsDashboardPage = new (0, $7e0dd2c52b1925ce$export$a3e02ac2d0adbb20)(page);
2544
+ this.reportsDeploymentsPage = new (0, $48379bea92ea9e64$export$41a993d086bafffd)(page);
2545
+ this.infrastructureEditPermissionsPage = new (0, $801d6ccd71155137$export$e37b272c81a10693)(page);
2546
+ this.environmentEditPermissionsPage = new (0, $0c1804a88a0b5036$export$c919546f4bf88f35)(page);
2547
+ this.applicationEditPermissionsPage = new (0, $e3cbc2135fe6aa40$export$ecd8b3e50e92d781)(page);
112
2548
  }
113
2549
  async navigateToHomePage() {
114
- await this.page.goto("/home");
2550
+ await this.page.goto('/home');
115
2551
  }
116
2552
  async navigateToUserPage() {
117
- await this.page.locator("p.MuiTypography-root", {
118
- hasText: "User management"
2553
+ await this.page.locator('p.MuiTypography-root', {
2554
+ hasText: 'User management'
119
2555
  }).click();
120
2556
  }
121
2557
  async clickCollapseSideView() {
122
- const collapseButton = this.page.getByTestId("back-button");
2558
+ const collapseButton = this.page.getByTestId('back-button');
123
2559
  await collapseButton.click();
124
2560
  }
125
2561
  }
@@ -128,53 +2564,71 @@ class $95d5ebc9765b570f$export$b8a61e5c71402559 {
128
2564
 
129
2565
 
130
2566
  class $c5e912d43cd579b2$export$f14c0e3f98d164c0 extends (0, $7d546dcaafadc158$export$2b65d1d97338f32b) {
131
- /**
132
- * Login with username and password
133
- * @param userName
134
- * @param password
135
- */ async login(userName, password) {
136
- await this.page.goto("/#/login");
137
- await (0, $lE6ZQ$expect)(this.page).toHaveTitle("Digital.ai Deploy");
138
- await this.page.getByPlaceholder("user").fill(userName, {
139
- timeout: 1000
140
- });
141
- await this.page.getByPlaceholder("Password").fill(password, {
2567
+ /* Login with username and password*/ async login(userName, password, pageOverride) {
2568
+ const p = pageOverride ?? this.page;
2569
+ await p.goto('/#/login');
2570
+ await (0, $lE6ZQ$expect)(p).toHaveTitle('Digital.ai Deploy');
2571
+ await p.getByPlaceholder('user').fill(userName, {
2572
+ timeout: 10000
2573
+ });
2574
+ await p.getByPlaceholder('Password').fill(password, {
142
2575
  timeout: 10000
143
2576
  });
144
- await this.page.getByRole("button", {
145
- name: "Log in"
2577
+ await p.getByRole('button', {
2578
+ name: 'Log in'
146
2579
  }).click({
147
2580
  timeout: 10000
148
2581
  });
149
2582
  }
150
- async verifyInvalidPasswordMessage() {
151
- const errorMessage = this.page.getByText("The username and/or password you have entered is incorrect.");
2583
+ /* Verify invalid password message */ async verifyInvalidPasswordMessage() {
2584
+ const errorMessage = this.page.getByText('The username and/or password you have entered is incorrect.');
152
2585
  await (0, $lE6ZQ$expect)(errorMessage).toBeVisible();
153
2586
  }
154
- /**
155
- * Logout as authenticated user
156
- */ async logout() {
157
- await this.page.locator("button.dot-avatar").click();
158
- await this.page.getByText("Log out", {
2587
+ /* Verify the error message shown when a disabled user attempts to log in */ async verifyDisabledUserLoginError(pageOverride) {
2588
+ const p = pageOverride ?? this.page;
2589
+ const errorMessage = p.getByText('Your account is currently disabled. Please contact your Deploy administrator for further assistance.');
2590
+ await (0, $lE6ZQ$expect)(errorMessage).toBeVisible();
2591
+ }
2592
+ /* Verify the error message shown when a user without login permission attempts to log in */ async verifyNoLoginPermissionError(pageOverride) {
2593
+ const p = pageOverride ?? this.page;
2594
+ const errorMessage = p.locator('div.error-message.permission-error');
2595
+ await (0, $lE6ZQ$expect)(errorMessage).toBeVisible({
2596
+ timeout: 20000
2597
+ });
2598
+ }
2599
+ /* Logout as authenticated user */ async logout() {
2600
+ await this.page.locator('button.dot-avatar').click();
2601
+ await this.page.getByText('Log out', {
159
2602
  exact: true
160
2603
  }).click();
161
- await (0, $lE6ZQ$expect)(this.page.getByText("Log in").first()).toBeVisible();
2604
+ await this.page.waitForURL('**/#/login', {
2605
+ timeout: 15000
2606
+ });
2607
+ await this.page.reload();
2608
+ await this.page.waitForLoadState('networkidle');
2609
+ await this.page.waitForURL('**/#/login', {
2610
+ timeout: 15000
2611
+ });
2612
+ await this.page.getByPlaceholder('user').waitFor({
2613
+ state: 'visible',
2614
+ timeout: 15000
2615
+ });
162
2616
  }
163
2617
  }
164
2618
 
165
2619
 
166
2620
  const $114b0b206b8d644f$export$e0969da9b8fb378d = (0, $lE6ZQ$test).extend({
167
- fixtures: async ({ page: page }, use)=>{
2621
+ fixtures: async ({ page: page }, use)=>{
168
2622
  const fixtures = new $114b0b206b8d644f$var$Fixtures(page);
169
2623
  await use(fixtures);
170
2624
  return fixtures;
171
2625
  },
172
- loginPage: async ({ page: page }, use)=>{
2626
+ loginPage: async ({ page: page }, use)=>{
173
2627
  const loginPage = new (0, $c5e912d43cd579b2$export$f14c0e3f98d164c0)(page);
174
2628
  await use(loginPage);
175
2629
  return loginPage;
176
2630
  },
177
- navigation: async ({ page: page }, use)=>{
2631
+ navigation: async ({ page: page }, use)=>{
178
2632
  const navigationPage = new (0, $95d5ebc9765b570f$export$b8a61e5c71402559)(page);
179
2633
  await use(navigationPage);
180
2634
  return navigationPage;