@digital-ai/devops-page-object-deploy 0.0.8 → 0.0.10

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,411 +9,2709 @@ 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
  }
29
139
  async clickReports() {
30
- await this.page.locator("p.MuiTypography-root", {
31
- hasText: "Reports"
140
+ await this.page.locator('p.MuiTypography-root', {
141
+ hasText: 'Reports'
32
142
  }).click();
33
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
+ }
34
179
  }
35
180
 
36
181
 
37
182
 
38
183
 
39
184
  class $ca2721b1aeb903c5$export$ecdc3cf9d1cfe143 extends (0, $7d546dcaafadc158$export$2b65d1d97338f32b) {
40
- /* Create a new user */ async createNewUser(username, email, password) {
41
- await this.page.locator("p.MuiTypography-root", {
42
- hasText: "Users"
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'
43
223
  }).click();
44
- await this.page.getByRole("button", {
45
- name: "Add user"
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'
46
253
  }).click();
47
- await this.page.locator('input[name="username"]').fill(username);
254
+ const usernameInput = this.page.locator('input[name="username"]');
255
+ await usernameInput.waitFor({
256
+ state: 'visible'
257
+ });
258
+ await usernameInput.fill(username);
48
259
  await this.page.locator('input[name="fullName"]').fill(username);
49
260
  await this.page.locator('input[name="email"]').fill(email);
50
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
+ });
51
266
  await passwordInput.click({
52
267
  force: true
53
268
  });
54
269
  await passwordInput.fill(password);
55
- await this.page.locator('input[name="confirmPassword"]').fill(password);
56
- await this.page.getByRole("button", {
57
- name: "Save"
58
- }).click();
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();
59
294
  }
60
295
  /* Verify success message */ async verifySuccessMessage() {
61
- const SuccessMessage = this.page.getByRole("alertdialog");
62
- await (0, $lE6ZQ$expect)(SuccessMessage).toBeVisible();
63
- await (0, $lE6ZQ$expect)(SuccessMessage).toHaveText(/User ".*" created/i);
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);
64
307
  }
65
308
  /* Verify user error message */ async verifyUserErrorMessage() {
66
- await (0, $lE6ZQ$expect)(this.page.locator('.rrt-middle-container[role="alertdialog"]').nth(1)).toContainText(/already in use/i);
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);
67
320
  }
68
321
  /* Delete the user and verify it is deleted */ async deleteTheUserAndVerifyItIsDeleted(username) {
69
- await this.page.locator("p.MuiTypography-root", {
70
- hasText: "Users"
71
- }).click();
72
- await this.page.getByPlaceholder("Filter...").fill(username);
73
- await this.page.locator("td.users-table-actions button.delete.xl-icon.table-action").click();
74
- await this.page.getByRole("button", {
75
- name: "Delete",
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',
76
342
  exact: true
77
343
  }).click();
78
- const DeleteMessage = this.page.getByRole("alertdialog");
79
- await (0, $lE6ZQ$expect)(DeleteMessage).toBeVisible();
80
- await (0, $lE6ZQ$expect)(DeleteMessage).toHaveText(/User ".*" deleted/i);
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
+ });
81
357
  }
82
358
  /* Edit the user and verify the changes */ async editUserAndVerify(username, editfullname) {
83
- await this.page.locator("p.MuiTypography-root", {
84
- hasText: "Users"
85
- }).click();
86
- await this.page.getByPlaceholder("Filter...").fill(username);
87
- await this.page.locator("i.icon-edit.dot-i").first().click();
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();
88
371
  await this.page.locator('input[name="fullName"]').fill(editfullname);
89
- await this.page.getByRole("button", {
90
- name: "Save",
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',
91
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'
92
474
  }).click();
93
- const EditMessage = this.page.getByRole("alertdialog");
94
- await (0, $lE6ZQ$expect)(EditMessage).toBeVisible();
95
- await (0, $lE6ZQ$expect)(EditMessage).toContainText("Your change was saved");
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();
96
504
  }
97
505
  }
98
506
 
99
507
 
100
508
 
101
-
102
- class $a4d71fd851704781$export$c88e1d16f82516d extends (0, $7d546dcaafadc158$export$2b65d1d97338f32b) {
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
+ }
103
546
  /* Helps to create a LocalHost of type UNIX/Windows/Zos */ async createHostForGivenType(name, type) {
104
547
  await this.page.locator('input[name="name"]').fill(name);
105
- await this.page.locator('label:has-text("Operating system")').locator("xpath=following::input[1]").click();
548
+ await this.page.locator('label:has-text("Operating system")').locator('xpath=following::input[1]').click();
106
549
  await this.page.getByText(type, {
107
550
  exact: true
108
551
  }).click();
109
- await this.page.getByRole("button", {
110
- name: "Save and close"
552
+ await this.page.getByRole('button', {
553
+ name: 'Save and close'
554
+ }).click();
555
+ await this.handleSaveToastOrAlreadyExists();
556
+ }
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'
111
584
  }).click();
112
- const toastMessage = this.page.locator(".redux-toastr .rrt-text:visible");
113
- await (0, $lE6ZQ$expect)(toastMessage).toHaveText("Your change was saved.", {
114
- timeout: 2000
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
115
607
  });
116
608
  }
117
609
  }
118
610
 
119
611
 
120
612
 
121
-
122
- class $8f7dd2349a88e8b2$export$12530425267834a9 extends (0, $7d546dcaafadc158$export$2b65d1d97338f32b) {
123
- /* Helps to create a new Environment */ async createEnvironment(environmentName, hostName) {
613
+ class $a63f1342e8823465$export$12530425267834a9 extends (0, $6480ad852470b7ac$export$cb21416f3c2fd176) {
614
+ /* Helps to navigate to the Environments page */ async navigateToEnvironmentsPage() {
615
+ await this.ensureExplorerTreeReady();
616
+ }
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'
621
+ }).click();
622
+ await this.page.getByRole('link', {
623
+ name: 'Environment'
624
+ }).click();
124
625
  await this.page.locator('input[name="name"]').fill(environmentName);
125
- await this.page.locator("i.xl-icon.arrow-down-icon.show-all").nth(0).click();
626
+ await this.page.locator('i.xl-icon.arrow-down-icon.show-all').nth(0).click();
126
627
  await this.page.getByTitle(`Infrastructure/${hostName}`, {
127
628
  exact: true
128
629
  }).click();
129
- await this.page.getByRole("button", {
130
- name: "Save and close"
630
+ await this.page.locator('i.xl-icon.arrow-down-icon.show-all').nth(1).click();
631
+ await this.page.getByTitle(`Environments/${dictionaryName}`, {
632
+ exact: true
131
633
  }).click();
132
- const toastMessage = this.page.locator(".redux-toastr .rrt-text:visible");
133
- await (0, $lE6ZQ$expect)(toastMessage).toHaveText("Your change was saved.", {
134
- timeout: 2000
135
- });
634
+ await this.page.getByRole('button', {
635
+ name: 'Save and close'
636
+ }).click();
637
+ await this.handleSaveToastOrAlreadyExists();
638
+ }
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'
643
+ }).click();
644
+ await this.page.getByRole('link', {
645
+ name: 'Dictionary',
646
+ exact: true
647
+ }).click();
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();
136
662
  }
137
663
  }
138
664
 
139
665
 
140
666
 
141
667
 
142
- class $3fb4750cbb53e5e6$export$1533b625ec0c75e2 extends (0, $7d546dcaafadc158$export$2b65d1d97338f32b) {
143
- constructor(page, navigation){
668
+ class $3fb4750cbb53e5e6$export$1533b625ec0c75e2 extends (0, $6480ad852470b7ac$export$cb21416f3c2fd176) {
669
+ constructor(page){
144
670
  super(page);
145
- this.navigation = navigation;
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();
146
680
  }
147
681
  /* Creates a new application */ async createNewApplication(applicationName) {
148
- await this.navigation.navigateToApplicationsPage();
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();
149
690
  await this.page.locator('input[name="name"]').waitFor({
150
- state: "visible"
691
+ state: 'visible'
151
692
  });
152
693
  await this.page.locator('input[name="name"]').click();
153
694
  await this.page.locator('input[name="name"]').fill(applicationName);
154
- await this.page.getByRole("button", {
155
- name: "Save and close"
695
+ await this.page.getByRole('button', {
696
+ name: 'Save and close'
156
697
  }).click();
157
- const toastMessage = this.page.locator(".redux-toastr .rrt-text:visible");
158
- await (0, $lE6ZQ$expect)(toastMessage).toHaveText("Your change was saved.", {
159
- timeout: 2000
698
+ await this.page.locator('input[name="name"]').waitFor({
699
+ state: 'hidden',
700
+ timeout: 5000
160
701
  });
702
+ await this.handleSaveToastOrAlreadyExists();
703
+ await this.waitForApplicationNode(applicationName);
161
704
  }
162
705
  /* Creates a new deployment package */ async createNewDeploymentPackage(applicationName, packageName) {
163
706
  const appDataId = `Applications/${applicationName}`;
707
+ const packageDataId = `Applications/${applicationName}/${packageName}`;
708
+ if (await this.nodeExists(packageDataId)) return;
164
709
  // Expand Applications
165
- const root = this.page.locator('div[data-id="Applications"] .infinite-tree-node > a');
166
- await root.click();
710
+ await this.ensureExplorerTreeReady();
711
+ await this.waitForApplicationNode(applicationName);
167
712
  // Hover over app node
168
713
  const appNode = this.page.locator(`span[data-id="${appDataId}"]`);
169
714
  await (0, $lE6ZQ$expect)(appNode).toBeVisible();
715
+ await appNode.scrollIntoViewIfNeeded();
170
716
  await appNode.hover();
171
717
  // Open context menu + create new deployment package
172
718
  const contextMenu = this.page.locator(`i.context-menu-button[data-id="${appDataId}"]`);
173
719
  await (0, $lE6ZQ$expect)(contextMenu).toBeVisible();
174
720
  await contextMenu.click();
175
- await this.page.getByRole("link", {
176
- name: "New"
721
+ await this.page.getByRole('link', {
722
+ name: 'New'
177
723
  }).click();
178
- await this.page.getByRole("link", {
179
- name: "Deployment Package"
724
+ await this.page.getByRole('link', {
725
+ name: 'Deployment Package'
180
726
  }).click();
181
727
  // Fill & save
182
728
  const nameInput = this.page.locator('input[name="name"]');
183
729
  await nameInput.fill(packageName);
184
- await this.page.getByRole("button", {
185
- name: "Save and close"
730
+ await this.page.getByRole('button', {
731
+ name: 'Save and close'
186
732
  }).click();
187
- const toastMessage = this.page.locator(".redux-toastr .rrt-text:visible");
188
- await (0, $lE6ZQ$expect)(toastMessage).toHaveText("Your change was saved.", {
189
- timeout: 2000
733
+ await nameInput.waitFor({
734
+ state: 'hidden',
735
+ timeout: 5000
190
736
  });
737
+ await this.handleSaveToastOrAlreadyExists();
738
+ await this.waitForPackageNode(applicationName, packageName);
191
739
  }
192
740
  /* Creates a new command application */ async createNewCmdApplication(values) {
193
741
  const appDataId = `Applications/${values[0]}`;
194
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;
195
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]);
196
749
  await this.page.locator(`div[data-id="${appDataId}"] .infinite-tree-node > a`).click();
197
- const packageNode = this.page.locator(`span[data-id="${packageDataId}"]`).first();
198
- await (0, $lE6ZQ$expect)(packageNode).toBeVisible();
199
- await packageNode.click();
750
+ await this.clickPackageNodeWithRetry(packageDataId);
200
751
  // Open context menu
201
752
  const packageMenu = this.page.locator(`i.context-menu-button[data-id="${packageDataId}"]`);
202
753
  await (0, $lE6ZQ$expect)(packageMenu).toBeVisible();
203
754
  await packageMenu.click();
204
755
  // Create Command application
205
- await this.page.getByRole("link", {
206
- name: "New"
756
+ await this.page.getByRole('link', {
757
+ name: 'New'
207
758
  }).click();
208
- await this.page.getByRole("link", {
209
- name: "cmd"
759
+ await this.page.getByRole('link', {
760
+ name: 'cmd'
210
761
  }).click();
211
- await this.page.getByRole("link", {
212
- name: "Command"
762
+ await this.page.getByRole('link', {
763
+ name: 'Command'
213
764
  }).click();
214
765
  await this.page.locator('input[name="name"]').fill(values[2]);
215
766
  await this.page.locator('textarea[name="commandLine"]').fill(values[3]);
216
- const saveBtn = this.page.locator("button", {
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', {
217
783
  hasText: /^Save$/
218
784
  }).first();
219
785
  await (0, $lE6ZQ$expect)(saveBtn).toBeEnabled();
220
786
  await saveBtn.click();
221
787
  await this.page.waitForTimeout(3000);
222
- const toastMessage = this.page.locator(".redux-toastr .rrt-text:visible");
223
- await (0, $lE6ZQ$expect)(toastMessage).toHaveText("Your change was saved.", {
224
- timeout: 2000
225
- });
788
+ await this.handleSaveToastOrAlreadyExists();
226
789
  // Close dialog
227
- await this.page.locator("i.xl-icon.close-icon").first().click();
790
+ await this.page.locator('i.xl-icon.close-icon').first().click();
228
791
  }
229
792
  /*Deploy the application*/ async deployApp(values) {
230
793
  const versionNode = `Applications/${values[0]}/${values[1]}`;
231
- await this.page.locator(`i.context-menu-button[data-id="${versionNode}"]`).click();
232
- await this.page.getByRole("link", {
233
- name: "Deploy",
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',
234
799
  exact: true
235
800
  }).click();
236
801
  await this.page.locator(`input[name="selections"][value="Environments/${values[2]}"]`).click();
237
- await this.page.getByRole("button", {
238
- name: "Continue"
802
+ await this.page.getByRole('button', {
803
+ name: 'Continue'
239
804
  }).click();
240
- await this.page.locator(".errors-wrapper").waitFor({
241
- state: "attached",
242
- timeout: 2000
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
243
809
  });
244
- const errorIcon = this.page.locator("a.validation-icons-wrapper.error");
245
- if (await errorIcon.isVisible()) {
246
- await this.page.getByRole("button", {
247
- name: "Deployment Properties"
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'
248
825
  }).click();
249
- await this.page.locator('input[name="username"]').fill(values[3]);
250
- await this.page.getByRole("button", {
251
- name: "Save"
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'
252
833
  }).click();
834
+ await errorIcon.waitFor({
835
+ state: 'hidden',
836
+ timeout: 10000
837
+ });
253
838
  }
254
- await this.page.locator("button.deploy.xl-primary").click();
839
+ await this.page.locator('button.deploy.xl-primary').waitFor({
840
+ state: 'visible'
841
+ });
842
+ await this.page.locator('button.deploy.xl-primary').click();
255
843
  //Get the task id
256
- this.taskId = await this.page.locator("div.task-id").textContent() || "";
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();
257
852
  //Verify no failure and all are done
258
- const labels = this.page.locator("span.label");
853
+ const labels = this.page.locator('span.label');
259
854
  await (0, $lE6ZQ$expect)(labels).toHaveCount(3);
260
855
  await (0, $lE6ZQ$expect)(labels).toHaveText([
261
- "EXECUTED",
262
- "DONE",
263
- "DONE"
856
+ 'EXECUTED',
857
+ 'DONE',
858
+ 'DONE'
264
859
  ]);
265
860
  //Get the text executed
266
861
  await this.page.locator('div[data-id="0_1_1"] .infinite-tree-node > a').click();
267
- await this.page.getByTitle("Execute Test Command").click();
268
- this.executedText = await this.page.locator("div.step-log-body pre").nth(1).innerText();
862
+ await this.page.getByTitle('Execute Test Command').click();
863
+ this.executedText = await this.page.locator('div.step-log-body pre').nth(1).innerText();
269
864
  //Verify in monitoring tab searching with the task id
270
865
  await this.page.locator('div[data-id="TASK_MONITOR"] .infinite-tree-node > a').click();
271
866
  await this.page.locator('span[data-id="DEPLOYMENT_TASKS"]').dblclick();
272
867
  await this.page.waitForTimeout(5000);
273
868
  await this.page.locator('div.deployment-task-filter-task-id input[placeholder="Search"]').first().fill(this.taskId);
274
- const stateText = await this.page.locator("td.tasks-table-state").first().innerText();
275
- (0, $lE6ZQ$expect)(stateText.trim()).toBe("Executed");
869
+ const stateText = await this.page.locator('td.tasks-table-state').first().innerText();
870
+ (0, $lE6ZQ$expect)(stateText.trim()).toBe('Executed');
276
871
  //Click the row to go to deployment screen
277
- await this.page.locator("table.table.table-striped tbody tr").first().dblclick();
278
- await this.page.locator("button.finish.xl-primary").click();
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
+ class $fe9360dc1f965c8f$export$95a11cbd2815051e extends (0, $6480ad852470b7ac$export$cb21416f3c2fd176) {
1140
+ /* Helps to navigate to the Gitops Configuration page */ async navigateToGitopsConfigurationPage() {
1141
+ await this.openRootContextMenu('Configuration');
1142
+ await this.page.getByRole('link', {
1143
+ name: 'New'
1144
+ }).click();
1145
+ await this.page.locator('a[title="git"]').click();
1146
+ await this.page.getByRole('link', {
1147
+ name: 'GitSource'
1148
+ }).click();
1149
+ await this.ensureExplorerTreeReady();
1150
+ }
1151
+ async openNewgitops() {
1152
+ await this.closeModalIfPresent();
1153
+ await this.ensureExplorerTreeReady();
1154
+ const infrastructureRoot = this.page.locator('span[data-id="Configuration"]');
1155
+ await infrastructureRoot.scrollIntoViewIfNeeded();
1156
+ await infrastructureRoot.click();
1157
+ const contextMenu = this.page.locator('i.context-menu-button[data-id="Configuration"]');
1158
+ await contextMenu.scrollIntoViewIfNeeded();
1159
+ await contextMenu.click({
1160
+ force: true
1161
+ });
1162
+ await this.page.getByRole('link', {
1163
+ name: 'New'
1164
+ }).click();
1165
+ await this.page.locator('a[title="git"]').click();
1166
+ await this.page.getByRole('link', {
1167
+ name: 'GitSource'
1168
+ }).click();
1169
+ }
1170
+ async openConfigurationNewgit() {
1171
+ await this.openNewgitops();
1172
+ }
1173
+ /* Helps to create a gitops ci*/ async createGitopsCI(ciName, gitData) {
1174
+ await this.page.locator('input[name="name"]').fill(ciName);
1175
+ await this.page.locator('input[name="username"]').fill(gitData[0]);
1176
+ await this.page.locator('input[name="password"]').fill(gitData[1]);
1177
+ await this.page.locator('input[name="url"]').fill(gitData[2]);
1178
+ await this.page.getByRole('button', {
1179
+ name: /^Save and close$/i
1180
+ }).click();
1181
+ await this.handleSaveToastOrAlreadyExists();
279
1182
  }
280
1183
  }
281
1184
 
282
1185
 
283
1186
 
284
1187
 
285
- class $76bad9b9e6741f37$export$b8a443164510a1b4 extends (0, $7d546dcaafadc158$export$2b65d1d97338f32b) {
1188
+ class $5eb37a606d823774$export$b8a443164510a1b4 extends (0, $7d546dcaafadc158$export$2b65d1d97338f32b) {
1189
+ async openTab(tabLabel, paneId) {
1190
+ const tab = this.page.locator('.app-root .dot-sidebar .dot-list p').filter({
1191
+ hasText: tabLabel
1192
+ }).first();
1193
+ await tab.scrollIntoViewIfNeeded();
1194
+ await tab.click();
1195
+ await this.page.locator(`#pane-${paneId}`).waitFor({
1196
+ state: 'visible',
1197
+ timeout: 20000
1198
+ });
1199
+ }
1200
+ async downloadReport(buttonLabel, paneId, selector) {
1201
+ const pane = this.page.locator(`#pane-${paneId}`);
1202
+ const exportButton = selector ? pane.locator(selector) : pane.getByRole('button', {
1203
+ name: buttonLabel
1204
+ });
1205
+ const fallbackButton = pane.locator('button:has-text("Export")');
1206
+ const downloadPromise = this.page.waitForEvent('download', {
1207
+ timeout: 20000
1208
+ });
1209
+ if (await exportButton.isVisible()) await exportButton.click();
1210
+ else await fallbackButton.first().click();
1211
+ return downloadPromise;
1212
+ }
1213
+ async openDashboardTab() {
1214
+ await this.openTab('Dashboard', 'DashboardTab');
1215
+ }
1216
+ async openDeploymentsTab() {
1217
+ await this.openTab('Deployments', 'DeploymentsTab');
1218
+ }
1219
+ async openControlTasksTab() {
1220
+ await this.openTab('Control tasks', 'ControlTasksTab');
1221
+ }
1222
+ async openAuditReportTab() {
1223
+ await this.openTab('Audit report', 'AuditReportTab');
1224
+ }
1225
+ async downloadDeploymentsExport() {
1226
+ return this.downloadReport('Export report', 'DeploymentsTab');
1227
+ }
1228
+ async downloadControlTasksExport() {
1229
+ return this.downloadReport('Export report', 'ControlTasksTab');
1230
+ }
1231
+ async downloadAuditReportExport() {
1232
+ return this.downloadReport('Export report', 'AuditReportTab');
1233
+ }
286
1234
  /* Clicks on the Deployment Tasks section */ async clickDeploymentTasks() {
287
- await this.page.locator("p.MuiTypography-root", {
288
- hasText: "Deployments"
1235
+ await this.page.locator('p.MuiTypography-root', {
1236
+ hasText: 'Deployments'
289
1237
  }).click();
290
1238
  }
291
1239
  async verifyTheDeploymentValues(values) {
292
1240
  await this.page.locator('div.deployment-task-filter-task-id input[placeholder="Search"]:visible').first().fill(values[0]);
293
- await this.page.waitForSelector("td.report-table-package .deployment-report-package", {
1241
+ const escapedApp = values[2].replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
1242
+ const escapedPkg = values[3].replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
1243
+ const packagePattern = new RegExp(`${escapedApp}/${escapedPkg}`, 'i');
1244
+ const row = this.page.locator('table.table-striped tbody tr').filter({
1245
+ has: this.page.locator('td.report-table-package .deployment-report-package', {
1246
+ hasText: packagePattern
1247
+ })
1248
+ }).first();
1249
+ await row.waitFor({
1250
+ state: 'visible',
294
1251
  timeout: 5000
295
1252
  });
296
- await (0, $lE6ZQ$expect)(this.page.locator("td.report-table-package .deployment-report-package")).toContainText(new RegExp(`${values[2]}\\/${values[3]}`, "i"));
297
- await (0, $lE6ZQ$expect)(this.page.locator("td.report-table-originalType .deployment-report-task-type")).toHaveText(/Initial/i); // Regex ignores case
298
- await (0, $lE6ZQ$expect)(this.page.locator("td.report-table-user .deployment-report-user")).toHaveText("admin");
1253
+ const packageCell = row.locator('td.report-table-package .deployment-report-package').first();
1254
+ await (0, $lE6ZQ$expect)(packageCell).toContainText(packagePattern);
1255
+ await (0, $lE6ZQ$expect)(row.locator('td.report-table-originalType .deployment-report-task-type')).toHaveText(/Initial/i);
1256
+ await (0, $lE6ZQ$expect)(row.locator('td.report-table-user .deployment-report-user')).toHaveText('admin');
299
1257
  //Click the row
300
- await this.page.locator("td.report-table-package .deployment-report-package").dblclick();
1258
+ await packageCell.dblclick();
301
1259
  await this.page.locator('div[data-id="0_1_1"] .infinite-tree-node > a').click();
302
- await this.page.getByTitle("Execute Test Command").click();
1260
+ await this.page.getByTitle('Execute Test Command').click();
303
1261
  //Get the log text
304
- const text = await this.page.locator("div.step-log-body pre").nth(1).innerText();
1262
+ const text = await this.page.locator('div.step-log-body pre').nth(1).innerText();
305
1263
  //Verify both the log text are same
306
1264
  (0, $lE6ZQ$expect)(text).toContain(values[1]);
307
1265
  }
308
1266
  }
309
1267
 
310
1268
 
311
- class $95d5ebc9765b570f$export$b8a61e5c71402559 {
312
- constructor(page){
313
- this.page = page;
314
- this.homePage = new (0, $e18c8d3707c8c74c$export$36d69433c4f81145)(page);
315
- this.userPage = new (0, $ca2721b1aeb903c5$export$ecdc3cf9d1cfe143)(page);
316
- this.overthereLocalHostPage = new (0, $a4d71fd851704781$export$c88e1d16f82516d)(page);
317
- this.environmentsPage = new (0, $8f7dd2349a88e8b2$export$12530425267834a9)(page);
318
- this.applicationsPage = new (0, $3fb4750cbb53e5e6$export$1533b625ec0c75e2)(page, this);
319
- this.reportsPage = new (0, $76bad9b9e6741f37$export$b8a443164510a1b4)(page);
1269
+
1270
+
1271
+ class $9a7d1625454209b8$export$5c1198389e139c11 extends (0, $7d546dcaafadc158$export$2b65d1d97338f32b) {
1272
+ getPane() {
1273
+ return this.page.locator('#pane-ControlTasksTab');
320
1274
  }
321
- async navigateToHomePage() {
322
- await this.page.goto("/home");
1275
+ getPagination() {
1276
+ return this.getPane().locator('.react-bootstrap-table-pagination');
323
1277
  }
324
- async navigateToUserPage() {
325
- await this.page.locator("p.MuiTypography-root", {
326
- hasText: "User management"
327
- }).click();
1278
+ getTableBody() {
1279
+ return this.getPane().locator('.react-bootstrap-table tbody');
328
1280
  }
329
- async clickCollapseSideView() {
330
- const collapseButton = this.page.getByTestId("back-button");
331
- await collapseButton.click();
1281
+ getLastUpdated() {
1282
+ return this.getPane().locator('.last-updated-component');
332
1283
  }
333
- /* Helps to navigate to the Applications page */ async navigateToApplicationsPage() {
334
- const configNode = this.page.locator('span[data-id="Applications"]');
335
- await configNode.hover();
336
- await this.page.locator('i.context-menu-button[data-id="Applications"]').click();
337
- await this.page.getByRole("link", {
338
- name: "New"
339
- }).click();
340
- await this.page.getByRole("link", {
341
- name: "Application"
342
- }).click();
1284
+ // ── Navigation ───────────────────────────────────────────────────────────
1285
+ async verifySelected() {
1286
+ const pane = this.getPane();
1287
+ await (0, $lE6ZQ$expect)(pane).toBeVisible();
1288
+ await (0, $lE6ZQ$expect)(this.page.locator('.dot-sidebar a[href*="controltasks"], .dot-sidebar .dot-list p', {
1289
+ hasText: 'Control tasks'
1290
+ }).first()).toBeVisible();
343
1291
  }
344
- /* Helps to navigate to the Environments page */ async navigateToEnvironmentsPage() {
345
- const configNode = this.page.locator('span[data-id="Environments"]');
346
- await configNode.hover();
347
- await this.page.locator('i.context-menu-button[data-id="Environments"]').click();
348
- await this.page.getByRole("link", {
349
- name: "New"
350
- }).click();
351
- await this.page.getByRole("link", {
352
- name: "Environment"
353
- }).click();
1292
+ // ── Filters ───────────────────────────────────────────────────────────────
1293
+ async verifyFiltersVisible() {
1294
+ const pane = this.getPane();
1295
+ const filtersPanel = pane.locator('.xl-react-redux-table-filters-panel');
1296
+ await (0, $lE6ZQ$expect)(filtersPanel).toBeVisible();
1297
+ await (0, $lE6ZQ$expect)(pane.locator('.control-task-filter-targets .react-tagsinput-input')).toBeVisible();
1298
+ await (0, $lE6ZQ$expect)(pane.locator('.control-task-filter-task-name input[placeholder="Search"]')).toBeVisible();
1299
+ await (0, $lE6ZQ$expect)(pane.locator('.control-task-id input[placeholder="Search"]')).toBeVisible();
1300
+ await (0, $lE6ZQ$expect)(pane.locator('.control-task-filter-start-date')).toBeVisible();
1301
+ await (0, $lE6ZQ$expect)(pane.locator('.control-task-filter-end-date')).toBeVisible();
1302
+ await (0, $lE6ZQ$expect)(pane.locator('.control-task-filter-worker input[placeholder="Search"]')).toBeVisible();
1303
+ await (0, $lE6ZQ$expect)(pane.locator('.control-task-filter-state .react-tagsinput-input')).toBeVisible();
354
1304
  }
355
- /* Helps to navigate to the Overthere LocalHost page */ async navigateToOverthereLocalHostPage() {
356
- const configNode = this.page.locator('span[data-id="Infrastructure"]');
357
- await configNode.hover();
358
- await this.page.locator('i.context-menu-button[data-id="Infrastructure"]').click();
359
- // await this.page.waitForTimeout(5000);
360
- await this.page.getByRole("link", {
361
- name: "New"
362
- }).click();
363
- await this.page.getByRole("link", {
364
- name: "overthere"
365
- }).click();
366
- await this.page.getByRole("link", {
367
- name: "LocalHost"
368
- }).click();
1305
+ async hideFilters() {
1306
+ const pane = this.getPane();
1307
+ const filtersPanel = pane.locator('.xl-react-redux-table-filters-panel');
1308
+ const hideFiltersButton = pane.getByRole('button', {
1309
+ name: 'Hide filters'
1310
+ });
1311
+ await (0, $lE6ZQ$expect)(filtersPanel).toBeVisible();
1312
+ await hideFiltersButton.click();
1313
+ await (0, $lE6ZQ$expect)(filtersPanel).toBeHidden();
369
1314
  }
370
- }
371
-
372
-
373
-
374
-
375
- class $c5e912d43cd579b2$export$f14c0e3f98d164c0 extends (0, $7d546dcaafadc158$export$2b65d1d97338f32b) {
376
- /* Login with username and password*/ async login(userName, password) {
377
- await this.page.goto("/#/login");
378
- await (0, $lE6ZQ$expect)(this.page).toHaveTitle("Digital.ai Deploy");
379
- await this.page.getByPlaceholder("user").fill(userName, {
380
- timeout: 1000
1315
+ async showFilters() {
1316
+ const pane = this.getPane();
1317
+ const filtersPanel = pane.locator('.xl-react-redux-table-filters-panel');
1318
+ const showFiltersButton = pane.getByRole('button', {
1319
+ name: 'Show filters'
381
1320
  });
382
- await this.page.getByPlaceholder("Password").fill(password, {
1321
+ if (await filtersPanel.isVisible()) return;
1322
+ for(let attempt = 0; attempt < 3; attempt += 1){
1323
+ if (await showFiltersButton.isVisible()) await showFiltersButton.click({
1324
+ force: true
1325
+ });
1326
+ if (await filtersPanel.isVisible()) return;
1327
+ await this.page.waitForTimeout(300);
1328
+ }
1329
+ await (0, $lE6ZQ$expect)(filtersPanel).toBeVisible();
1330
+ }
1331
+ async ensureFiltersVisible() {
1332
+ const pane = this.getPane();
1333
+ const filtersPanel = pane.locator('.xl-react-redux-table-filters-panel');
1334
+ if (await filtersPanel.isVisible()) return;
1335
+ const showFiltersButton = pane.getByRole('button', {
1336
+ name: 'Show filters'
1337
+ });
1338
+ if (await showFiltersButton.isVisible()) await showFiltersButton.click({
1339
+ force: true
1340
+ });
1341
+ await (0, $lE6ZQ$expect)(filtersPanel).toBeVisible();
1342
+ }
1343
+ // ── Date filters ─────────────────────────────────────────────────────────
1344
+ async setStartDate(value) {
1345
+ const field = this.getPane().locator('.control-task-filter-start-date');
1346
+ await field.click();
1347
+ await field.fill(value);
1348
+ await this.getLastUpdated().click({
1349
+ force: true
1350
+ });
1351
+ }
1352
+ async setEndDate(value) {
1353
+ const field = this.getPane().locator('.control-task-filter-end-date');
1354
+ await field.click();
1355
+ await field.fill(value);
1356
+ await this.getLastUpdated().click({
1357
+ force: true
1358
+ });
1359
+ }
1360
+ async expectStartDateValue(value) {
1361
+ await (0, $lE6ZQ$expect)(this.getPane().locator('.control-task-filter-start-date')).toHaveValue(value);
1362
+ }
1363
+ async expectEndDateValue(value) {
1364
+ await (0, $lE6ZQ$expect)(this.getPane().locator('.control-task-filter-end-date')).toHaveValue(value);
1365
+ }
1366
+ async checkInvalidStartDateError() {
1367
+ const field = this.getPane().locator('.control-task-filter-start-date');
1368
+ await field.click();
1369
+ await field.press('End');
1370
+ await field.press('a');
1371
+ await this.page.keyboard.press('Escape');
1372
+ await (0, $lE6ZQ$expect)(this.getPane().getByText('Example: Dec 1, 2018').first()).toBeVisible();
1373
+ }
1374
+ async checkInvalidEndDateError() {
1375
+ const field = this.getPane().locator('.control-task-filter-end-date');
1376
+ await field.click();
1377
+ await field.press('End');
1378
+ await field.press('b');
1379
+ await this.page.keyboard.press('Escape');
1380
+ await (0, $lE6ZQ$expect)(this.getPane().getByText('Example: Dec 1, 2018').first()).toBeVisible();
1381
+ }
1382
+ async expectNoStartDateError() {
1383
+ await (0, $lE6ZQ$expect)(this.getPane().getByText('Example: Dec 1, 2018')).toHaveCount(0);
1384
+ }
1385
+ async expectNoEndDateError() {
1386
+ await (0, $lE6ZQ$expect)(this.getPane().getByText('Example: Dec 1, 2018')).toHaveCount(0);
1387
+ }
1388
+ // ── Tag filters ───────────────────────────────────────────────────────────
1389
+ async selectTargetsTagsFilter(text, optionName) {
1390
+ await this.selectTagsFilterFirstSuggestion('.control-task-filter-targets .react-tagsinput', text, optionName);
1391
+ }
1392
+ async clearTargetsTagsFirstTag() {
1393
+ const remove = this.getPane().locator('.control-task-filter-targets .react-tagsinput-tag:nth-child(1) .react-tagsinput-remove');
1394
+ if (await remove.count()) await remove.click();
1395
+ }
1396
+ async selectStatesTagsFilter(text, optionName) {
1397
+ await this.selectTagsFilterFirstSuggestion('.control-task-filter-state .react-tagsinput', text, optionName);
1398
+ }
1399
+ async clearStatesTagsFirstTag() {
1400
+ const remove = this.getPane().locator('.control-task-filter-state .react-tagsinput-tag:nth-child(1) .react-tagsinput-remove');
1401
+ if (await remove.count()) await remove.click();
1402
+ }
1403
+ // ── Text filters ──────────────────────────────────────────────────────────
1404
+ async filterByTaskName(name) {
1405
+ await this.getPane().locator('.control-task-filter-task-name input[placeholder="Search"]').fill(name);
1406
+ }
1407
+ async clearTaskName() {
1408
+ await this.filterByTaskName('');
1409
+ }
1410
+ async filterByTaskId(id) {
1411
+ await this.getPane().locator('.control-task-id input[placeholder="Search"]').fill(id);
1412
+ }
1413
+ async clearTaskId() {
1414
+ await this.filterByTaskId('');
1415
+ }
1416
+ async filterByWorker(worker) {
1417
+ await this.getPane().locator('.control-task-filter-worker input[placeholder="Search"]').fill(worker);
1418
+ }
1419
+ async clearWorkerFilter() {
1420
+ await this.filterByWorker('');
1421
+ }
1422
+ // ── Tasks toggle ──────────────────────────────────────────────────────────
1423
+ async clickMyTasks() {
1424
+ await this.getPane().getByRole('button', {
1425
+ name: 'My tasks'
1426
+ }).click();
1427
+ }
1428
+ async clickAllTasks() {
1429
+ await this.getPane().getByRole('button', {
1430
+ name: 'All tasks'
1431
+ }).click();
1432
+ }
1433
+ // ── Toolbar ───────────────────────────────────────────────────────────────
1434
+ async clickRefresh() {
1435
+ await this.getPane().getByRole('button', {
1436
+ name: 'Refresh'
1437
+ }).click();
1438
+ }
1439
+ async verifyLastUpdatedAndRefresh() {
1440
+ const lastUpdated = this.getLastUpdated();
1441
+ await (0, $lE6ZQ$expect)(lastUpdated).toBeVisible();
1442
+ await (0, $lE6ZQ$expect)(lastUpdated).not.toHaveText('');
1443
+ await this.getPane().getByRole('button', {
1444
+ name: 'Refresh'
1445
+ }).click();
1446
+ await (0, $lE6ZQ$expect)(lastUpdated).toBeVisible();
1447
+ }
1448
+ // ── Table assertions ──────────────────────────────────────────────────────
1449
+ async verifyTableHasRowsOrEmpty() {
1450
+ const pane = this.getPane();
1451
+ const table = pane.locator('table.table-striped');
1452
+ await (0, $lE6ZQ$expect)(table).toBeVisible();
1453
+ const rows = this.getTableBody().locator('tr');
1454
+ const noDataCell = this.getTableBody().locator('td.react-bs-table-no-data');
1455
+ const emptyState = pane.getByText(/No report data available/i);
1456
+ await (0, $lE6ZQ$expect)(async ()=>{
1457
+ if (await rows.count() > 0) return true;
1458
+ if (await noDataCell.count() > 0 && await noDataCell.first().isVisible()) return true;
1459
+ if (await emptyState.count() > 0 && await emptyState.first().isVisible()) return true;
1460
+ return false;
1461
+ }).toBeTruthy();
1462
+ }
1463
+ async verifyTableColumns() {
1464
+ const headers = this.getPane().locator('.react-bootstrap-table thead th');
1465
+ await (0, $lE6ZQ$expect)(headers.filter({
1466
+ hasText: 'Control task name'
1467
+ })).toBeVisible();
1468
+ await (0, $lE6ZQ$expect)(headers.filter({
1469
+ hasText: 'Target CI'
1470
+ })).toBeVisible();
1471
+ await (0, $lE6ZQ$expect)(headers.filter({
1472
+ hasText: 'Description'
1473
+ })).toBeVisible();
1474
+ await (0, $lE6ZQ$expect)(headers.filter({
1475
+ hasText: 'User'
1476
+ })).toBeVisible();
1477
+ await (0, $lE6ZQ$expect)(headers.filter({
1478
+ hasText: 'State'
1479
+ })).toBeVisible();
1480
+ await (0, $lE6ZQ$expect)(headers.filter({
1481
+ hasText: 'Start date'
1482
+ })).toBeVisible();
1483
+ await (0, $lE6ZQ$expect)(headers.filter({
1484
+ hasText: 'End date'
1485
+ })).toBeVisible();
1486
+ await (0, $lE6ZQ$expect)(headers.filter({
1487
+ hasText: 'Worker'
1488
+ })).toBeVisible();
1489
+ }
1490
+ async waitForTableReady() {
1491
+ await (0, $lE6ZQ$expect)(async ()=>{
1492
+ const loading = await this.getPane().getByText('Data loading').count();
1493
+ (0, $lE6ZQ$expect)(loading).toBe(0);
1494
+ const table = this.getPane().locator('table.table-striped');
1495
+ (0, $lE6ZQ$expect)(await table.count()).toBeGreaterThan(0);
1496
+ }).toPass({
1497
+ timeout: 20000
1498
+ });
1499
+ }
1500
+ async expectNumberOfRows(count) {
1501
+ await this.waitForTableReady();
1502
+ await (0, $lE6ZQ$expect)(this.getTableBody().locator('tr')).toHaveCount(count);
1503
+ }
1504
+ async expectAtLeastNumberOfRows(count) {
1505
+ await this.waitForTableReady();
1506
+ await (0, $lE6ZQ$expect)(async ()=>{
1507
+ const total = await this.getTableBody().locator('tr').count();
1508
+ (0, $lE6ZQ$expect)(total).toBeGreaterThanOrEqual(count);
1509
+ }).toPass({
1510
+ timeout: 30000
1511
+ });
1512
+ }
1513
+ async expectTotal(total) {
1514
+ await (0, $lE6ZQ$expect)(this.getPagination().locator('> div').filter({
1515
+ hasText: 'Total:'
1516
+ })).toContainText(`Total: ${total}`);
1517
+ }
1518
+ async expectAtLeastTotal(count) {
1519
+ await this.waitForTableReady();
1520
+ await (0, $lE6ZQ$expect)(async ()=>{
1521
+ const text = await this.getPagination().locator('> div').filter({
1522
+ hasText: 'Total:'
1523
+ }).textContent();
1524
+ const match = text?.match(/Total:\s*(\d+)/);
1525
+ const total = match ? Number(match[1]) : 0;
1526
+ (0, $lE6ZQ$expect)(total).toBeGreaterThanOrEqual(count);
1527
+ }).toPass();
1528
+ }
1529
+ async getTotalCount() {
1530
+ await this.waitForTableReady();
1531
+ const text = await this.getPagination().locator('> div').filter({
1532
+ hasText: 'Total:'
1533
+ }).textContent();
1534
+ const match = text?.match(/Total:\s*(\d+)/);
1535
+ return match ? Number(match[1]) : 0;
1536
+ }
1537
+ async expectValue(row, column, expected) {
1538
+ const cell = this.getTableBody().locator(`tr:nth-child(${row}) td.report-table-${column}`);
1539
+ await (0, $lE6ZQ$expect)(cell).toHaveText(expected);
1540
+ }
1541
+ async expectValueContains(row, column, expected) {
1542
+ const cell = this.getTableBody().locator(`tr:nth-child(${row}) td.report-table-${column}`);
1543
+ await (0, $lE6ZQ$expect)(cell).toContainText(expected);
1544
+ }
1545
+ async shouldHaveScrollBar() {
1546
+ await this.waitForTableReady();
1547
+ const container = this.getPane().locator('div.report');
1548
+ const overflowX = await container.evaluate((el)=>window.getComputedStyle(el).overflowX);
1549
+ (0, $lE6ZQ$expect)([
1550
+ 'auto',
1551
+ 'scroll'
1552
+ ]).toContain(overflowX);
1553
+ }
1554
+ // ── Sorting ───────────────────────────────────────────────────────────────
1555
+ async sortBy(column) {
1556
+ await this.getPane().locator(`.react-bootstrap-table thead th.report-table-${column}`).click();
1557
+ }
1558
+ async verifyIsSorted(column) {
1559
+ const sortOrder = this.getPane().locator(`.react-bootstrap-table thead th.report-table-${column} .react-bootstrap-table-sort-order`);
1560
+ await (0, $lE6ZQ$expect)(sortOrder).toBeVisible();
1561
+ }
1562
+ async getColumnValues(column) {
1563
+ await this.waitForTableReady();
1564
+ const cells = this.getTableBody().locator(`tr td.report-table-${column}`);
1565
+ const count = await cells.count();
1566
+ const values = [];
1567
+ for(let i = 0; i < count; i += 1)values.push((await cells.nth(i).textContent())?.trim() ?? '');
1568
+ return values;
1569
+ }
1570
+ // ── Pagination ────────────────────────────────────────────────────────────
1571
+ async getLastPageNumber() {
1572
+ await this.waitForTableReady();
1573
+ const links = this.getPagination().getByRole('list').getByRole('link');
1574
+ const count = await links.count();
1575
+ if (count < 2) return 1;
1576
+ const text = await links.nth(count - 2).textContent();
1577
+ const num = Number(text?.trim());
1578
+ return Number.isFinite(num) && num > 0 ? num : 1;
1579
+ }
1580
+ async goToPage(page) {
1581
+ await this.getPagination().getByRole('link', {
1582
+ name: page.toString(),
1583
+ exact: true
1584
+ }).click();
1585
+ }
1586
+ async goToFirstPage() {
1587
+ const firstLink = this.getPagination().getByRole('link', {
1588
+ name: '<<'
1589
+ });
1590
+ if (await firstLink.count()) await firstLink.click();
1591
+ else await this.getPagination().getByRole('link', {
1592
+ name: '1',
1593
+ exact: true
1594
+ }).click();
1595
+ }
1596
+ async goToLastPage() {
1597
+ const lastLink = this.getPagination().getByRole('link', {
1598
+ name: '>>'
1599
+ });
1600
+ if (await lastLink.count()) await lastLink.click();
1601
+ else {
1602
+ const links = this.getPagination().getByRole('list').getByRole('link');
1603
+ const count = await links.count();
1604
+ await links.nth(count - 2).click();
1605
+ }
1606
+ }
1607
+ async goToPreviousPage() {
1608
+ await this.getPagination().getByRole('link', {
1609
+ name: '<',
1610
+ exact: true
1611
+ }).click();
1612
+ }
1613
+ async goToNextPage() {
1614
+ await this.getPagination().getByRole('link', {
1615
+ name: '>',
1616
+ exact: true
1617
+ }).click();
1618
+ }
1619
+ async expectPage(page) {
1620
+ await (0, $lE6ZQ$expect)(async ()=>{
1621
+ const pagination = this.getPagination();
1622
+ const activeLink = pagination.locator('li.active').getByRole('link', {
1623
+ name: page.toString(),
1624
+ exact: true
1625
+ });
1626
+ if (await activeLink.count() > 0) return;
1627
+ const ariaCurrent = pagination.locator('[aria-current="page"]').filter({
1628
+ hasText: page.toString()
1629
+ });
1630
+ if (await ariaCurrent.count() > 0) return;
1631
+ // When there is only 1 page, the pagination may not render page links at all.
1632
+ // In that case page 1 is implicitly active.
1633
+ if (page === 1) {
1634
+ const nextLink = pagination.getByRole('link', {
1635
+ name: '>',
1636
+ exact: true
1637
+ });
1638
+ const pageLinks = pagination.getByRole('link').filter({
1639
+ hasText: /^\d+$/
1640
+ });
1641
+ if (await nextLink.count() === 0 && await pageLinks.count() === 0) return;
1642
+ }
1643
+ throw new Error(`Page ${page} not active`);
1644
+ }).toPass({
1645
+ timeout: 30000
1646
+ });
1647
+ }
1648
+ async expectPageLinkVisible(pageNumber) {
1649
+ await (0, $lE6ZQ$expect)(this.getPagination().getByRole('link', {
1650
+ name: pageNumber.toString(),
1651
+ exact: true
1652
+ })).toBeVisible();
1653
+ }
1654
+ async expectPaginationLinksVisible() {
1655
+ await (0, $lE6ZQ$expect)(this.getPagination().getByRole('link', {
1656
+ name: '>',
1657
+ exact: true
1658
+ })).toBeVisible();
1659
+ }
1660
+ async expectPaginationLinksHidden() {
1661
+ await (0, $lE6ZQ$expect)(this.getPagination().getByRole('link', {
1662
+ name: '>',
1663
+ exact: true
1664
+ })).toHaveCount(0);
1665
+ }
1666
+ async setPageSize(size) {
1667
+ await this.openPageSizeMenu();
1668
+ await this.getPagination().getByRole('menu').getByRole('menuitem', {
1669
+ name: size.toString(),
1670
+ exact: true
1671
+ }).click();
1672
+ await this.waitForTableReady();
1673
+ }
1674
+ async expectPageSize(size) {
1675
+ await (0, $lE6ZQ$expect)(this.getPagination().getByRole('button', {
1676
+ name: size.toString(),
1677
+ exact: true
1678
+ })).toBeVisible();
1679
+ }
1680
+ async expectPageSizes(sizes) {
1681
+ await this.openPageSizeMenu();
1682
+ const menu = this.getPagination().getByRole('menu');
1683
+ await (0, $lE6ZQ$expect)(menu.getByRole('menuitem')).toHaveCount(sizes.length);
1684
+ for (const size of sizes)await (0, $lE6ZQ$expect)(menu.getByRole('menuitem', {
1685
+ name: size.toString(),
1686
+ exact: true
1687
+ })).toBeVisible();
1688
+ await this.closePageSizeMenu();
1689
+ }
1690
+ // ── Private helpers ───────────────────────────────────────────────────────
1691
+ async openPageSizeMenu() {
1692
+ const toggle = this.getPagination().locator('.dropdown-toggle');
1693
+ await toggle.click();
1694
+ await this.getPagination().getByRole('menu').waitFor({
1695
+ state: 'visible'
1696
+ });
1697
+ }
1698
+ async closePageSizeMenu() {
1699
+ const menu = this.getPagination().getByRole('menu');
1700
+ if (await menu.isVisible()) await this.getPagination().locator('.dropdown-toggle').click();
1701
+ }
1702
+ async expectTagAdded(tagTitle) {
1703
+ const tags = this.getPane().locator('.xl-react-widget-tags .react-tagsinput-tag');
1704
+ const byTitle = tags.locator(`[title='${tagTitle}']`);
1705
+ const byContainsTitle = tags.filter({
1706
+ hasText: tagTitle.split('/').pop() ?? tagTitle
1707
+ });
1708
+ if (await byTitle.count() > 0) await (0, $lE6ZQ$expect)(byTitle.first()).toBeVisible();
1709
+ else await (0, $lE6ZQ$expect)(byContainsTitle.first()).toBeVisible();
1710
+ }
1711
+ async selectTagsFilterFirstSuggestion(filterSelector, text, optionName) {
1712
+ const pane = this.getPane();
1713
+ const filter = pane.locator(filterSelector);
1714
+ const input = filter.locator('.xl-react-widget-autocomplete .react-tagsinput-input');
1715
+ await input.click({
1716
+ force: true
1717
+ });
1718
+ await input.fill(text);
1719
+ const suggestionList = pane.locator('.xl-react-autocomplete-suggestion-list');
1720
+ await (0, $lE6ZQ$expect)(suggestionList).toBeVisible();
1721
+ const optionByTitle = suggestionList.locator(`.yt-option[title="${optionName}"]`);
1722
+ const optionByText = suggestionList.locator('.yt-option', {
1723
+ hasText: optionName
1724
+ });
1725
+ const gridOption = suggestionList.getByRole('rowgroup').getByText(optionName, {
1726
+ exact: false
1727
+ });
1728
+ let option;
1729
+ if (await optionByTitle.count()) option = optionByTitle.first();
1730
+ else if (await optionByText.count()) option = optionByText.first();
1731
+ else option = gridOption.first();
1732
+ await (0, $lE6ZQ$expect)(option).toBeVisible();
1733
+ const iconCheckbox = option.locator('i.xl-icon.icon-s.checkbox');
1734
+ if (await iconCheckbox.count()) await iconCheckbox.click();
1735
+ else await option.click();
1736
+ await this.page.locator('body').click({
1737
+ position: {
1738
+ x: 10,
1739
+ y: 10
1740
+ }
1741
+ });
1742
+ await this.expectTagAdded(optionName);
1743
+ }
1744
+ }
1745
+
1746
+
1747
+
1748
+
1749
+ class $7e0dd2c52b1925ce$export$a3e02ac2d0adbb20 extends (0, $7d546dcaafadc158$export$2b65d1d97338f32b) {
1750
+ async downloadReport() {
1751
+ const pane = this.page.locator('#pane-DashboardTab');
1752
+ const exportButton = pane.locator('button.export-audit-report');
1753
+ const fallbackButton = pane.locator('button:has-text("Export")');
1754
+ const downloadPromise = this.page.waitForEvent('download', {
1755
+ timeout: 20000
1756
+ });
1757
+ if (await exportButton.isVisible()) await exportButton.click();
1758
+ else await fallbackButton.first().click();
1759
+ return downloadPromise;
1760
+ }
1761
+ async downloadDashboardExport() {
1762
+ return this.downloadReport();
1763
+ }
1764
+ async verifySummarySection() {
1765
+ const pane = this.page.locator('#pane-DashboardTab');
1766
+ const summary = pane.locator('.statistics-block');
1767
+ await (0, $lE6ZQ$expect)(pane.getByText('Usage summary for current month', {
1768
+ exact: false
1769
+ })).toBeVisible();
1770
+ await (0, $lE6ZQ$expect)(pane.locator('button:has-text("Export")')).toBeVisible();
1771
+ await (0, $lE6ZQ$expect)(summary.locator('.tile-title[title="Successful deployments"]')).toBeVisible();
1772
+ await (0, $lE6ZQ$expect)(summary.locator('.tile-title[title="Retried deployments"]')).toBeVisible();
1773
+ await (0, $lE6ZQ$expect)(summary.locator('.tile-title[title="Rollback deployments"]')).toBeVisible();
1774
+ await (0, $lE6ZQ$expect)(summary.locator('.tile-title[title="Aborted deployments"]')).toBeVisible();
1775
+ await (0, $lE6ZQ$expect)(pane.getByText('Deployment status overview', {
1776
+ exact: true
1777
+ })).toBeVisible();
1778
+ }
1779
+ async verifyLast30DaysSection() {
1780
+ const pane = this.page.locator('#pane-DashboardTab');
1781
+ await (0, $lE6ZQ$expect)(pane.locator('h1.time-period-text', {
1782
+ hasText: /Last 30 days/i
1783
+ })).toBeVisible();
1784
+ const successCard = pane.getByText('Top 10 successful deployments', {
1785
+ exact: true
1786
+ }).first().locator('..');
1787
+ const retriedCard = pane.getByText('Top 10 retried deployments', {
1788
+ exact: true
1789
+ }).first().locator('..');
1790
+ const longestCard = pane.getByText('Top 10 longest deployments', {
1791
+ exact: true
1792
+ }).first().locator('..');
1793
+ await this.expectCardHasDataOrEmpty(successCard);
1794
+ await this.expectCardHasDataOrEmpty(retriedCard);
1795
+ await this.expectCardHasDataOrEmpty(longestCard);
1796
+ }
1797
+ async verifySelected() {
1798
+ const pane = this.page.locator('#pane-DashboardTab');
1799
+ await (0, $lE6ZQ$expect)(pane).toBeVisible();
1800
+ await (0, $lE6ZQ$expect)(this.page.getByText('Dashboard', {
1801
+ exact: true
1802
+ })).toBeVisible();
1803
+ }
1804
+ async verifyLastUpdatedAndRefresh() {
1805
+ const pane = this.page.locator('#pane-DashboardTab');
1806
+ const lastUpdated = pane.locator('.last-updated-component');
1807
+ await (0, $lE6ZQ$expect)(lastUpdated).toBeVisible();
1808
+ await (0, $lE6ZQ$expect)(lastUpdated).not.toHaveText('');
1809
+ const refreshButton = pane.getByRole('button', {
1810
+ name: 'Refresh'
1811
+ });
1812
+ await refreshButton.click();
1813
+ await (0, $lE6ZQ$expect)(lastUpdated).toBeVisible();
1814
+ }
1815
+ async verifyDateRangeDefault() {
1816
+ const pane = this.page.locator('#pane-DashboardTab');
1817
+ const dateRangeInput = pane.locator('#date-range-input');
1818
+ await (0, $lE6ZQ$expect)(dateRangeInput).toHaveValue('Current month');
1819
+ }
1820
+ async selectDateRange(optionLabel) {
1821
+ const pane = this.page.locator('#pane-DashboardTab');
1822
+ const dateRangeInput = pane.locator('#date-range-input');
1823
+ try {
1824
+ await dateRangeInput.selectOption({
1825
+ label: optionLabel
1826
+ });
1827
+ return;
1828
+ } catch {
1829
+ // Fall back to clicking the open dropdown list.
1830
+ }
1831
+ await dateRangeInput.click();
1832
+ const optionRole = this.page.getByRole('option', {
1833
+ name: optionLabel
1834
+ });
1835
+ const menuItemRole = this.page.getByRole('menuitem', {
1836
+ name: optionLabel
1837
+ });
1838
+ const fallbackOption = this.page.locator('li', {
1839
+ hasText: optionLabel
1840
+ });
1841
+ if (await optionRole.isVisible()) {
1842
+ await optionRole.click();
1843
+ return;
1844
+ }
1845
+ if (await menuItemRole.isVisible()) {
1846
+ await menuItemRole.click();
1847
+ return;
1848
+ }
1849
+ await fallbackOption.first().click();
1850
+ }
1851
+ async verifyDateRangeHeaderContains(label) {
1852
+ const pane = this.page.locator('#pane-DashboardTab');
1853
+ await (0, $lE6ZQ$expect)(pane.locator('.title-header', {
1854
+ hasText: label
1855
+ })).toBeVisible();
1856
+ }
1857
+ async verifyOverviewChartsOrEmpty() {
1858
+ const pane = this.page.locator('#pane-DashboardTab');
1859
+ const statusOverview = pane.getByText('Deployment status overview', {
1860
+ exact: true
1861
+ }).first().locator('..');
1862
+ await this.expectWidgetHasChartOrEmpty(statusOverview);
1863
+ const numberOfDeployments = pane.getByText('Number of deployments over time', {
1864
+ exact: true
1865
+ }).first().locator('..');
1866
+ await this.expectWidgetHasChartOrEmpty(numberOfDeployments);
1867
+ const averageDuration = pane.getByText('Average deployment duration over time', {
1868
+ exact: true
1869
+ }).first().locator('..');
1870
+ await this.expectWidgetHasChartOrEmpty(averageDuration);
1871
+ }
1872
+ async verifyDeploymentStatusLegend() {
1873
+ const pane = this.page.locator('#pane-DashboardTab');
1874
+ const tile = pane.locator('.deployment-status-overview');
1875
+ await (0, $lE6ZQ$expect)(tile).toBeVisible();
1876
+ const legendItems = tile.locator('.recharts-legend-item-text');
1877
+ if (await legendItems.count()) {
1878
+ await (0, $lE6ZQ$expect)(legendItems.filter({
1879
+ hasText: 'Successful'
1880
+ }).first()).toBeVisible();
1881
+ await (0, $lE6ZQ$expect)(legendItems.filter({
1882
+ hasText: 'Retried'
1883
+ }).first()).toBeVisible();
1884
+ await (0, $lE6ZQ$expect)(legendItems.filter({
1885
+ hasText: 'Rollback'
1886
+ }).first()).toBeVisible();
1887
+ await (0, $lE6ZQ$expect)(legendItems.filter({
1888
+ hasText: 'Aborted'
1889
+ }).first()).toBeVisible();
1890
+ return;
1891
+ }
1892
+ // No-data state: chart, canvas, or no-data widget must be visible
1893
+ const chartOrNoData = tile.locator('svg, canvas, .no-data-widget');
1894
+ await (0, $lE6ZQ$expect)(chartOrNoData.first()).toBeVisible();
1895
+ }
1896
+ async verifyButtonsFocusable() {
1897
+ const pane = this.page.locator('#pane-DashboardTab');
1898
+ const exportButton = pane.getByRole('button', {
1899
+ name: 'Export'
1900
+ });
1901
+ const refreshButton = pane.getByRole('button', {
1902
+ name: 'Refresh'
1903
+ });
1904
+ await exportButton.focus();
1905
+ await (0, $lE6ZQ$expect)(exportButton).toBeFocused();
1906
+ await refreshButton.focus();
1907
+ await (0, $lE6ZQ$expect)(refreshButton).toBeFocused();
1908
+ }
1909
+ async verifyDateRangeOptions() {
1910
+ const pane = this.page.locator('#pane-DashboardTab');
1911
+ const select = pane.locator('#date-range-input');
1912
+ const expectedOptions = [
1913
+ 'Current month',
1914
+ 'Last 30 days',
1915
+ 'Last 90 days',
1916
+ 'Last 180 days',
1917
+ 'Last 360 days',
1918
+ 'Custom date range'
1919
+ ];
1920
+ for (const option of expectedOptions)await (0, $lE6ZQ$expect)(select.locator(`option:has-text("${option}")`)).toBeAttached();
1921
+ }
1922
+ async verifyLast6MonthsSection() {
1923
+ const pane = this.page.locator('#pane-DashboardTab');
1924
+ const trendBlock = pane.locator('.time-period-section.trend-block');
1925
+ await (0, $lE6ZQ$expect)(trendBlock).toBeVisible();
1926
+ await (0, $lE6ZQ$expect)(trendBlock.locator('h1.time-period-text')).toContainText('Last 6 months');
1927
+ const numDeployments = trendBlock.locator('.number-of-deployments-over-time');
1928
+ const avgDuration = trendBlock.locator('.average-deployment-duration-over-time');
1929
+ await (0, $lE6ZQ$expect)(numDeployments).toBeVisible();
1930
+ await (0, $lE6ZQ$expect)(avgDuration).toBeVisible();
1931
+ }
1932
+ async verifyKpiTileNumbers() {
1933
+ const pane = this.page.locator('#pane-DashboardTab');
1934
+ const tiles = [
1935
+ pane.locator('.successful.text-widget'),
1936
+ pane.locator('.retried.text-widget'),
1937
+ pane.locator('.rollback.text-widget'),
1938
+ pane.locator('.aborted.text-widget')
1939
+ ];
1940
+ for (const tile of tiles){
1941
+ await (0, $lE6ZQ$expect)(tile).toBeVisible();
1942
+ await (0, $lE6ZQ$expect)(tile.locator('.number')).toBeVisible();
1943
+ }
1944
+ }
1945
+ async verifyCustomDateRangeInputs() {
1946
+ const pane = this.page.locator('#pane-DashboardTab');
1947
+ await pane.locator('#date-range-input').selectOption({
1948
+ label: 'Custom date range'
1949
+ });
1950
+ await (0, $lE6ZQ$expect)(pane.locator('.custom-date-range')).toBeVisible();
1951
+ await (0, $lE6ZQ$expect)(pane.locator('#custom-range-start-date')).toBeVisible();
1952
+ await (0, $lE6ZQ$expect)(pane.locator('#custom-range-end-date')).toBeVisible();
1953
+ // Restore default
1954
+ await pane.locator('#date-range-input').selectOption({
1955
+ label: 'Current month'
1956
+ });
1957
+ }
1958
+ async expectCardHasDataOrEmpty(card) {
1959
+ const tableRows = card.locator('table tbody tr');
1960
+ if (await tableRows.count()) {
1961
+ await (0, $lE6ZQ$expect)(tableRows.first()).toBeVisible();
1962
+ return;
1963
+ }
1964
+ const rowData = card.locator('.row-data');
1965
+ if (await rowData.count()) {
1966
+ await (0, $lE6ZQ$expect)(rowData.first()).toBeAttached();
1967
+ return;
1968
+ }
1969
+ await (0, $lE6ZQ$expect)(card.getByText('No data available for the current period', {
1970
+ exact: true
1971
+ })).toBeVisible();
1972
+ }
1973
+ async expectWidgetHasChartOrEmpty(widget) {
1974
+ const chart = widget.locator('svg, canvas');
1975
+ const noData = widget.getByText('No data available for the current period', {
1976
+ exact: true
1977
+ });
1978
+ const chartVisible = await chart.first().isVisible();
1979
+ const noDataVisible = await noData.isVisible();
1980
+ (0, $lE6ZQ$expect)(chartVisible || noDataVisible).toBeTruthy();
1981
+ }
1982
+ }
1983
+
1984
+
1985
+
1986
+
1987
+ class $48379bea92ea9e64$export$41a993d086bafffd extends (0, $7d546dcaafadc158$export$2b65d1d97338f32b) {
1988
+ getPane() {
1989
+ return this.page.locator('#pane-DeploymentsTab');
1990
+ }
1991
+ getPagination() {
1992
+ return this.getPane().locator('.react-bootstrap-table-pagination');
1993
+ }
1994
+ getTableBody() {
1995
+ return this.getPane().locator('.react-bootstrap-table tbody');
1996
+ }
1997
+ getLastUpdated() {
1998
+ return this.getPane().locator('.last-updated-component');
1999
+ }
2000
+ async resolveDateField(containerSelector) {
2001
+ const container = this.getPane().locator(containerSelector);
2002
+ const input = container.locator('input');
2003
+ if (await input.count()) return input.first();
2004
+ return container;
2005
+ }
2006
+ async verifySelected() {
2007
+ const pane = this.getPane();
2008
+ await (0, $lE6ZQ$expect)(pane).toBeVisible();
2009
+ await (0, $lE6ZQ$expect)(this.page.getByText('Deployments', {
2010
+ exact: true
2011
+ })).toBeVisible();
2012
+ }
2013
+ async verifyFiltersVisible() {
2014
+ const pane = this.getPane();
2015
+ const filtersPanel = pane.locator('.xl-react-redux-table-filters-panel');
2016
+ await (0, $lE6ZQ$expect)(filtersPanel).toBeVisible();
2017
+ await (0, $lE6ZQ$expect)(pane.locator('.deployment-task-filter-start-date')).toBeVisible();
2018
+ await (0, $lE6ZQ$expect)(pane.locator('.deployment-task-filter-end-date')).toBeVisible();
2019
+ await (0, $lE6ZQ$expect)(pane.locator('.deployment-task-filter-task-id input[placeholder="Search"]')).toBeVisible();
2020
+ await (0, $lE6ZQ$expect)(pane.locator('.deployment-task-filter-worker input[placeholder="Search"]')).toBeVisible();
2021
+ await (0, $lE6ZQ$expect)(pane.locator('.deployment-task-filter-applications .react-tagsinput-input')).toBeVisible();
2022
+ await (0, $lE6ZQ$expect)(pane.locator('.deployment-task-filter-environments .react-tagsinput-input')).toBeVisible();
2023
+ await (0, $lE6ZQ$expect)(pane.locator('.deployment-task-filter-state .react-tagsinput-input')).toBeVisible();
2024
+ await (0, $lE6ZQ$expect)(pane.locator('.deployment-task-filter-types .react-tagsinput-input')).toBeVisible();
2025
+ const tasksFilterInput = pane.locator('.deployment-task-filter-tasks .react-tagsinput-input');
2026
+ if (await tasksFilterInput.count()) await (0, $lE6ZQ$expect)(tasksFilterInput).toBeVisible();
2027
+ }
2028
+ async verifyLastUpdatedAndRefresh() {
2029
+ const pane = this.getPane();
2030
+ const lastUpdated = this.getLastUpdated();
2031
+ await (0, $lE6ZQ$expect)(lastUpdated).toBeVisible();
2032
+ await (0, $lE6ZQ$expect)(lastUpdated).not.toHaveText('');
2033
+ const refreshButton = pane.getByRole('button', {
2034
+ name: 'Refresh'
2035
+ });
2036
+ await refreshButton.click();
2037
+ await (0, $lE6ZQ$expect)(lastUpdated).toBeVisible();
2038
+ }
2039
+ async verifyTableHasRowsOrEmpty() {
2040
+ const pane = this.getPane();
2041
+ const table = pane.locator('table.table-striped');
2042
+ await (0, $lE6ZQ$expect)(table).toBeVisible();
2043
+ const rows = this.getTableBody().locator('tr');
2044
+ const noDataCell = this.getTableBody().locator('tr td.react-bs-table-no-data');
2045
+ const emptyState = pane.getByText(/No data/i);
2046
+ await (0, $lE6ZQ$expect)(async ()=>{
2047
+ if (await rows.count()) return true;
2048
+ if (await noDataCell.count() > 0 && await noDataCell.first().isVisible()) return true;
2049
+ if (await emptyState.count() > 0 && await emptyState.first().isVisible()) return true;
2050
+ return false;
2051
+ }).toBeTruthy();
2052
+ }
2053
+ async hideFilters() {
2054
+ const pane = this.getPane();
2055
+ const filtersPanel = pane.locator('.xl-react-redux-table-filters-panel');
2056
+ const hideFiltersButton = pane.getByRole('button', {
2057
+ name: 'Hide filters'
2058
+ });
2059
+ await (0, $lE6ZQ$expect)(filtersPanel).toBeVisible();
2060
+ await hideFiltersButton.click();
2061
+ await (0, $lE6ZQ$expect)(filtersPanel).toBeHidden();
2062
+ }
2063
+ async showFilters() {
2064
+ const pane = this.getPane();
2065
+ const filtersPanel = pane.locator('.xl-react-redux-table-filters-panel');
2066
+ const showFiltersButton = pane.getByRole('button', {
2067
+ name: 'Show filters'
2068
+ });
2069
+ if (await filtersPanel.isVisible()) return;
2070
+ for(let attempt = 0; attempt < 3; attempt += 1){
2071
+ if (await showFiltersButton.isVisible()) await showFiltersButton.click({
2072
+ force: true
2073
+ });
2074
+ if (await filtersPanel.isVisible()) return;
2075
+ await this.page.waitForTimeout(300);
2076
+ }
2077
+ await (0, $lE6ZQ$expect)(filtersPanel).toBeVisible();
2078
+ }
2079
+ async ensureFiltersVisible() {
2080
+ const pane = this.getPane();
2081
+ const filtersPanel = pane.locator('.xl-react-redux-table-filters-panel');
2082
+ if (await filtersPanel.isVisible()) return;
2083
+ const showFiltersButton = pane.getByRole('button', {
2084
+ name: 'Show filters'
2085
+ });
2086
+ if (await showFiltersButton.isVisible()) await showFiltersButton.click({
2087
+ force: true
2088
+ });
2089
+ await (0, $lE6ZQ$expect)(filtersPanel).toBeVisible();
2090
+ }
2091
+ async clickRefresh() {
2092
+ const pane = this.getPane();
2093
+ await pane.getByRole('button', {
2094
+ name: 'Refresh'
2095
+ }).click();
2096
+ }
2097
+ async expectTotal(total) {
2098
+ await (0, $lE6ZQ$expect)(this.getPagination().locator('> div').filter({
2099
+ hasText: 'Total:'
2100
+ })).toContainText(`Total: ${total}`);
2101
+ }
2102
+ async expectNumberOfRows(count) {
2103
+ await this.waitForTableReady();
2104
+ await (0, $lE6ZQ$expect)(this.getTableBody().locator('tr')).toHaveCount(count);
2105
+ }
2106
+ async expectAtLeastNumberOfRows(count) {
2107
+ await this.waitForTableReady();
2108
+ await (0, $lE6ZQ$expect)(async ()=>{
2109
+ const total = await this.getTableBody().locator('tr').count();
2110
+ (0, $lE6ZQ$expect)(total).toBeGreaterThanOrEqual(count);
2111
+ }).toPass({
2112
+ timeout: 30000
2113
+ });
2114
+ }
2115
+ async expectAtLeastTotal(count) {
2116
+ await this.waitForTableReady();
2117
+ await (0, $lE6ZQ$expect)(async ()=>{
2118
+ const text = await this.getPagination().locator('> div').filter({
2119
+ hasText: 'Total:'
2120
+ }).textContent();
2121
+ const match = text?.match(/Total:\s*(\d+)/);
2122
+ const total = match ? Number(match[1]) : 0;
2123
+ (0, $lE6ZQ$expect)(total).toBeGreaterThanOrEqual(count);
2124
+ }).toPass();
2125
+ }
2126
+ async expectValue(row, column, expected) {
2127
+ const cell = this.getTableBody().locator(`tr:nth-child(${row}) td.report-table-${column}`);
2128
+ await (0, $lE6ZQ$expect)(cell).toHaveText(expected);
2129
+ }
2130
+ async expectValueContains(row, column, expected) {
2131
+ const cell = this.getTableBody().locator(`tr:nth-child(${row}) td.report-table-${column}`);
2132
+ await (0, $lE6ZQ$expect)(cell).toContainText(expected);
2133
+ }
2134
+ async sortBy(column) {
2135
+ const header = this.getPane().locator(`.react-bootstrap-table thead th.report-table-${column}`);
2136
+ await header.click();
2137
+ }
2138
+ async isAscendingSorted(column) {
2139
+ const sortOrder = this.getPane().locator(`.react-bootstrap-table thead th.report-table-${column} .react-bootstrap-table-sort-order`);
2140
+ await (0, $lE6ZQ$expect)(sortOrder).toBeVisible();
2141
+ }
2142
+ async getColumnValues(column) {
2143
+ await this.waitForTableReady();
2144
+ const cells = this.getTableBody().locator(`tr td.report-table-${column}`);
2145
+ const count = await cells.count();
2146
+ const values = [];
2147
+ for(let i = 0; i < count; i += 1)values.push((await cells.nth(i).textContent())?.trim() ?? '');
2148
+ return values;
2149
+ }
2150
+ async getLastPageNumber() {
2151
+ await this.waitForTableReady();
2152
+ const links = this.getPagination().getByRole('list').getByRole('link');
2153
+ const count = await links.count();
2154
+ if (count < 2) return 1;
2155
+ // links order on page 1: [1, 2, ..., n, >] — last numeric is nth(count-2)
2156
+ const text = await links.nth(count - 2).textContent();
2157
+ const num = Number(text?.trim());
2158
+ return Number.isFinite(num) && num > 0 ? num : 1;
2159
+ }
2160
+ async getTotalCount() {
2161
+ await this.waitForTableReady();
2162
+ const text = await this.getPagination().locator('> div').filter({
2163
+ hasText: 'Total:'
2164
+ }).textContent();
2165
+ const match = text?.match(/Total:\s*(\d+)/);
2166
+ return match ? Number(match[1]) : 0;
2167
+ }
2168
+ async expectPage(page) {
2169
+ await (0, $lE6ZQ$expect)(async ()=>{
2170
+ const pagination = this.getPagination();
2171
+ // primary: react-bootstrap li.active with child link
2172
+ const activeLink = pagination.locator('li.active').getByRole('link', {
2173
+ name: page.toString(),
2174
+ exact: true
2175
+ });
2176
+ if (await activeLink.count() > 0) return;
2177
+ // fallback: aria-current="page"
2178
+ const ariaCurrent = pagination.locator('[aria-current="page"]').filter({
2179
+ hasText: page.toString()
2180
+ });
2181
+ if (await ariaCurrent.count() > 0) return;
2182
+ throw new Error(`Page ${page} not active`);
2183
+ }).toPass({
2184
+ timeout: 30000
2185
+ });
2186
+ }
2187
+ async goToPage(page) {
2188
+ await this.getPagination().getByRole('link', {
2189
+ name: page.toString()
2190
+ }).click();
2191
+ }
2192
+ async goToFirstPage() {
2193
+ const firstLink = this.getPagination().getByRole('link', {
2194
+ name: '<<'
2195
+ });
2196
+ if (await firstLink.count()) await firstLink.click();
2197
+ else await this.getPagination().getByRole('link', {
2198
+ name: '1',
2199
+ exact: true
2200
+ }).click();
2201
+ }
2202
+ async goToLastPage() {
2203
+ const lastLink = this.getPagination().getByRole('link', {
2204
+ name: '>>'
2205
+ });
2206
+ if (await lastLink.count()) await lastLink.click();
2207
+ else {
2208
+ const links = this.getPagination().getByRole('list').getByRole('link');
2209
+ const count = await links.count();
2210
+ // last numeric link is second-to-last (last is '>')
2211
+ await links.nth(count - 2).click();
2212
+ }
2213
+ }
2214
+ async goToPreviousPage() {
2215
+ await this.getPagination().getByRole('link', {
2216
+ name: '<',
2217
+ exact: true
2218
+ }).click();
2219
+ }
2220
+ async goToNextPage() {
2221
+ await this.getPagination().getByRole('link', {
2222
+ name: '>',
2223
+ exact: true
2224
+ }).click();
2225
+ }
2226
+ async expectPageLinkVisible(pageNumber) {
2227
+ await (0, $lE6ZQ$expect)(this.getPagination().getByRole('link', {
2228
+ name: pageNumber.toString(),
2229
+ exact: true
2230
+ })).toBeVisible();
2231
+ }
2232
+ async expectPaginationLinksVisible() {
2233
+ await (0, $lE6ZQ$expect)(this.getPagination().getByRole('link', {
2234
+ name: '>',
2235
+ exact: true
2236
+ })).toBeVisible();
2237
+ }
2238
+ async expectPaginationLinksHidden() {
2239
+ await (0, $lE6ZQ$expect)(this.getPagination().getByRole('link', {
2240
+ name: '>',
2241
+ exact: true
2242
+ })).toHaveCount(0);
2243
+ }
2244
+ async expectPageSize(size) {
2245
+ await (0, $lE6ZQ$expect)(this.getPagination().getByRole('button', {
2246
+ name: size.toString(),
2247
+ exact: true
2248
+ })).toBeVisible();
2249
+ }
2250
+ async expectPageSizes(sizes) {
2251
+ await this.openPageSizeMenu();
2252
+ const menu = this.getPagination().getByRole('menu');
2253
+ await (0, $lE6ZQ$expect)(menu.getByRole('menuitem')).toHaveCount(sizes.length);
2254
+ for (const size of sizes)await (0, $lE6ZQ$expect)(menu.getByRole('menuitem', {
2255
+ name: size.toString(),
2256
+ exact: true
2257
+ })).toBeVisible();
2258
+ await this.closePageSizeMenu();
2259
+ }
2260
+ async setPageSize(size) {
2261
+ await this.openPageSizeMenu();
2262
+ await this.getPagination().getByRole('menu').getByRole('menuitem', {
2263
+ name: size.toString(),
2264
+ exact: true
2265
+ }).click();
2266
+ await this.waitForTableReady();
2267
+ }
2268
+ async shouldHaveScrollBar() {
2269
+ await this.waitForTableReady();
2270
+ const container = this.getPane().locator('div.report');
2271
+ const overflowX = await container.evaluate((el)=>window.getComputedStyle(el).overflowX);
2272
+ (0, $lE6ZQ$expect)([
2273
+ 'auto',
2274
+ 'scroll'
2275
+ ]).toContain(overflowX);
2276
+ }
2277
+ async setStartDate(value) {
2278
+ const field = await this.resolveDateField('.deployment-task-filter-start-date');
2279
+ await field.click();
2280
+ await field.fill(value);
2281
+ await this.getLastUpdated().click({
2282
+ force: true
2283
+ });
2284
+ }
2285
+ async setEndDate(value) {
2286
+ const field = await this.resolveDateField('.deployment-task-filter-end-date');
2287
+ await field.click();
2288
+ await field.fill(value);
2289
+ await this.getLastUpdated().click({
2290
+ force: true
2291
+ });
2292
+ }
2293
+ async expectStartDateValue(value) {
2294
+ await this.expectDateFieldValue('.deployment-task-filter-start-date', value);
2295
+ }
2296
+ async expectEndDateValue(value) {
2297
+ await this.expectDateFieldValue('.deployment-task-filter-end-date', value);
2298
+ }
2299
+ async checkInvalidStartDateError() {
2300
+ const field = await this.resolveDateField('.deployment-task-filter-start-date');
2301
+ await field.click(); // opens calendar
2302
+ await field.press('End');
2303
+ await field.press('a'); // append invalid char
2304
+ await this.page.keyboard.press('Escape'); // close calendar → error appears below field
2305
+ await (0, $lE6ZQ$expect)(this.getPane().getByText('Example: Dec 1, 2018').first()).toBeVisible();
2306
+ }
2307
+ async checkInvalidEndDateError() {
2308
+ const field = await this.resolveDateField('.deployment-task-filter-end-date');
2309
+ await field.click(); // opens calendar
2310
+ await field.press('End');
2311
+ await field.press('b'); // append invalid char
2312
+ await this.page.keyboard.press('Escape'); // close calendar → error appears below field
2313
+ await (0, $lE6ZQ$expect)(this.getPane().getByText('Example: Dec 1, 2018').first()).toBeVisible();
2314
+ }
2315
+ async expectNoStartDateError() {
2316
+ await (0, $lE6ZQ$expect)(this.getPane().getByText('Example: Dec 1, 2018')).toHaveCount(0);
2317
+ }
2318
+ async expectNoEndDateError() {
2319
+ await (0, $lE6ZQ$expect)(this.getPane().getByText('Example: Dec 1, 2018')).toHaveCount(0);
2320
+ }
2321
+ async selectRadioFilter(label) {
2322
+ await this.ensureFiltersVisible();
2323
+ const pane = this.getPane();
2324
+ const radioGroup = pane.locator('.xl-react-widget-radio-group');
2325
+ const labelLocator = radioGroup.locator(`label[data='${label}']`);
2326
+ if (await labelLocator.count()) {
2327
+ await labelLocator.click();
2328
+ return;
2329
+ }
2330
+ const fallbackByText = radioGroup.getByText(label, {
2331
+ exact: true
2332
+ });
2333
+ if (await fallbackByText.count()) {
2334
+ await fallbackByText.click();
2335
+ return;
2336
+ }
2337
+ const ariaRadio = pane.locator('[role="radio"]', {
2338
+ hasText: label
2339
+ });
2340
+ if (await ariaRadio.count()) await ariaRadio.first().click();
2341
+ }
2342
+ async expectApplicationsRadioSelected() {
2343
+ const radio = this.getPane().locator('.xl-react-widget-radio-group label[data="Application(s)"]');
2344
+ if (await radio.count() === 0) return;
2345
+ await (0, $lE6ZQ$expect)(radio).toHaveAttribute('style', /background-color/);
2346
+ }
2347
+ async selectTagsFilterApplications(text, optionName) {
2348
+ await this.selectTagsFilterFirstSuggestion('.deployment-task-filter-applications .react-tagsinput', text, optionName);
2349
+ }
2350
+ async selectTagsFilterEnvironments(text, optionName) {
2351
+ await this.selectTagsFilterFirstSuggestion('.deployment-task-filter-environments .react-tagsinput', text, optionName);
2352
+ }
2353
+ async selectStatesTagsFilterFirstSuggestion(text, optionName) {
2354
+ await this.selectTagsFilterFirstSuggestion('.deployment-task-filter-state .react-tagsinput', text, optionName);
2355
+ }
2356
+ async clearStatesTagsFirstTag() {
2357
+ const remove = this.getPane().locator('.deployment-task-filter-state .react-tagsinput-tag:nth-child(1) .react-tagsinput-remove');
2358
+ if (await remove.count()) await remove.click();
2359
+ }
2360
+ async clearApplicationsTagsFirstTag() {
2361
+ const remove = this.getPane().locator('.deployment-task-filter-applications .react-tagsinput-tag:nth-child(1) .react-tagsinput-remove');
2362
+ if (await remove.count()) await remove.click();
2363
+ }
2364
+ async clearEnvironmentsTagsFirstTag() {
2365
+ const remove = this.getPane().locator('.deployment-task-filter-environments .react-tagsinput-tag:nth-child(1) .react-tagsinput-remove');
2366
+ if (await remove.count()) await remove.click();
2367
+ }
2368
+ async setTaskId(taskId) {
2369
+ const input = this.getPane().locator('.deployment-task-filter-task-id input');
2370
+ await input.fill(taskId);
2371
+ await (0, $lE6ZQ$expect)(input).toHaveValue(taskId);
2372
+ }
2373
+ async setWorkerName(workerName) {
2374
+ const input = this.getPane().locator('.deployment-task-filter-worker input');
2375
+ await input.fill(workerName);
2376
+ await (0, $lE6ZQ$expect)(input).toHaveValue(workerName);
2377
+ }
2378
+ async clearWorkerName() {
2379
+ await this.setWorkerName('');
2380
+ }
2381
+ async expectTagAdded(tagTitle) {
2382
+ const tags = this.getPane().locator('.xl-react-widget-tags .react-tagsinput-tag');
2383
+ const byTitle = tags.locator(`[title='${tagTitle}']`);
2384
+ const byContainsTitle = tags.filter({
2385
+ hasText: tagTitle.split('/').pop() ?? tagTitle
2386
+ });
2387
+ const count = await byTitle.count();
2388
+ if (count > 0) await (0, $lE6ZQ$expect)(byTitle.first()).toBeVisible();
2389
+ else await (0, $lE6ZQ$expect)(byContainsTitle.first()).toBeVisible();
2390
+ }
2391
+ async selectTagsFilterFirstSuggestion(filterSelector, text, optionName) {
2392
+ const pane = this.getPane();
2393
+ const filter = pane.locator(filterSelector);
2394
+ const input = filter.locator('.xl-react-widget-autocomplete .react-tagsinput-input');
2395
+ await input.click({
2396
+ force: true
2397
+ });
2398
+ await input.fill(text);
2399
+ const suggestionList = pane.locator('.xl-react-autocomplete-suggestion-list');
2400
+ await (0, $lE6ZQ$expect)(suggestionList).toBeVisible();
2401
+ // Try .yt-option first (State/Type filters), then aria grid row (Application/Environment filters)
2402
+ const optionByTitle = suggestionList.locator(`.yt-option[title="${optionName}"]`);
2403
+ const optionByText = suggestionList.locator('.yt-option', {
2404
+ hasText: optionName
2405
+ });
2406
+ const gridOption = suggestionList.getByRole('rowgroup').getByText(optionName, {
2407
+ exact: false
2408
+ });
2409
+ let option;
2410
+ if (await optionByTitle.count()) option = optionByTitle.first();
2411
+ else if (await optionByText.count()) option = optionByText.first();
2412
+ else option = gridOption.first();
2413
+ await (0, $lE6ZQ$expect)(option).toBeVisible();
2414
+ const iconCheckbox = option.locator('i.xl-icon.icon-s.checkbox');
2415
+ if (await iconCheckbox.count()) await iconCheckbox.click();
2416
+ else await option.click();
2417
+ await this.page.locator('body').click({
2418
+ position: {
2419
+ x: 10,
2420
+ y: 10
2421
+ }
2422
+ });
2423
+ await this.expectTagAdded(optionName);
2424
+ }
2425
+ async waitForTableReady() {
2426
+ // Poll until loading indicator is gone AND table content (rows or empty state) is present
2427
+ await (0, $lE6ZQ$expect)(async ()=>{
2428
+ const loading = await this.getPane().getByText('Data loading').count();
2429
+ if (loading > 0) throw new Error('Still loading');
2430
+ const rows = await this.getTableBody().locator('tr').count();
2431
+ const noData = await this.getTableBody().locator('td.react-bs-table-no-data').count();
2432
+ if (rows === 0 && noData === 0) throw new Error('No table content yet');
2433
+ }).toPass({
2434
+ timeout: 60000
2435
+ });
2436
+ }
2437
+ async openPageSizeMenu() {
2438
+ const btn = this.getPagination().getByRole('toolbar').getByRole('button');
2439
+ const expanded = await btn.getAttribute('aria-expanded');
2440
+ if (expanded !== 'true') {
2441
+ await btn.click();
2442
+ await (0, $lE6ZQ$expect)(this.getPagination().getByRole('menu')).toBeVisible();
2443
+ }
2444
+ }
2445
+ async closePageSizeMenu() {
2446
+ const btn = this.getPagination().getByRole('toolbar').getByRole('button');
2447
+ const expanded = await btn.getAttribute('aria-expanded');
2448
+ if (expanded === 'true') {
2449
+ await btn.click();
2450
+ await (0, $lE6ZQ$expect)(this.getPagination().getByRole('menu')).toBeHidden();
2451
+ }
2452
+ }
2453
+ async expectDateFieldValue(containerSelector, value) {
2454
+ const container = this.getPane().locator(containerSelector);
2455
+ const input = container.locator('input');
2456
+ if (await input.count() > 0) {
2457
+ await (0, $lE6ZQ$expect)(input.first()).toHaveValue(value);
2458
+ return;
2459
+ }
2460
+ await (0, $lE6ZQ$expect)(container).toHaveValue(value);
2461
+ }
2462
+ }
2463
+
2464
+
2465
+
2466
+ class $801d6ccd71155137$export$e37b272c81a10693 extends (0, $6480ad852470b7ac$export$cb21416f3c2fd176) {
2467
+ /* Navigates to the Infrastructure Edit Permissions page via the tree context menu */ async navigateToPage() {
2468
+ await this.openRootContextMenu('Infrastructure');
2469
+ await this.page.getByRole('link', {
2470
+ name: 'Edit Permissions'
2471
+ }).click();
2472
+ }
2473
+ async navigateToInfraEditPermissionPage() {
2474
+ await this.navigateToPage();
2475
+ }
2476
+ /* Gives the permissions to a role */ async givePermissionsToRole(roleName) {
2477
+ const filter = this.page.getByPlaceholder('Filter by roles').first();
2478
+ await filter.waitFor({
2479
+ state: 'visible'
2480
+ });
2481
+ await filter.scrollIntoViewIfNeeded();
2482
+ await filter.fill(roleName);
2483
+ const roleRow = this.page.locator('table.table-striped tbody tr').first();
2484
+ const checkboxes = roleRow.locator('input[type="checkbox"]');
2485
+ const count = await checkboxes.count();
2486
+ for(let i = 0; i < count; i += 1){
2487
+ const checkbox = checkboxes.nth(i);
2488
+ if (!await checkbox.isChecked()) await checkbox.check();
2489
+ }
2490
+ await this.page.getByRole('button', {
2491
+ name: 'Save and close'
2492
+ }).click();
2493
+ await this.handleSaveToastOrAlreadyExists();
2494
+ }
2495
+ }
2496
+
2497
+
2498
+
2499
+ class $0c1804a88a0b5036$export$c919546f4bf88f35 extends (0, $6480ad852470b7ac$export$cb21416f3c2fd176) {
2500
+ /* Navigates to the Environments Edit Permissions page via the tree context menu */ async navigateToPage() {
2501
+ await this.openRootContextMenu('Environments');
2502
+ await this.page.getByRole('link', {
2503
+ name: 'Edit Permissions'
2504
+ }).click();
2505
+ }
2506
+ async navigateToEnvEditPermissionPage() {
2507
+ await this.navigateToPage();
2508
+ }
2509
+ /* Gives the permissions to a role */ async givePermissionsToRole(roleName) {
2510
+ const filter = this.page.getByPlaceholder('Filter by roles').first();
2511
+ await filter.waitFor({
2512
+ state: 'visible'
2513
+ });
2514
+ await filter.scrollIntoViewIfNeeded();
2515
+ await filter.fill(roleName);
2516
+ const roleRow = this.page.locator('table.table-striped tbody tr').first();
2517
+ const labels = [
2518
+ 'deploy initial',
2519
+ 'read',
2520
+ 'repo edit'
2521
+ ];
2522
+ const headers = this.page.locator('table.table-striped thead th');
2523
+ const headerCount = await headers.count();
2524
+ const headerTexts = [];
2525
+ for(let i = 0; i < headerCount; i += 1)headerTexts.push((await headers.nth(i).innerText()).trim().toLowerCase());
2526
+ for (const label of labels){
2527
+ const colIndex = headerTexts.findIndex((text)=>text.includes(label));
2528
+ if (colIndex === -1) throw new Error(`Permission column not found: ${label}`);
2529
+ const checkbox = roleRow.locator('td').nth(colIndex).locator('input[type="checkbox"]');
2530
+ if (!await checkbox.isChecked()) await checkbox.check();
2531
+ }
2532
+ await this.page.getByRole('button', {
2533
+ name: 'Save and close'
2534
+ }).click();
2535
+ await this.handleSaveToastOrAlreadyExists();
2536
+ }
2537
+ }
2538
+
2539
+
2540
+
2541
+ class $e3cbc2135fe6aa40$export$ecd8b3e50e92d781 extends (0, $6480ad852470b7ac$export$cb21416f3c2fd176) {
2542
+ /* Navigates to the Applications Edit Permissions page via the tree context menu */ async navigateToPage() {
2543
+ await this.openRootContextMenu('Applications');
2544
+ await this.page.getByRole('link', {
2545
+ name: 'Edit Permissions'
2546
+ }).click();
2547
+ }
2548
+ async navigateToAppEditPermissionPage() {
2549
+ await this.navigateToPage();
2550
+ }
2551
+ /* Gives the permissions to a role */ async givePermissionsToRole(roleName) {
2552
+ const filter = this.page.getByPlaceholder('Filter by roles').first();
2553
+ await filter.waitFor({
2554
+ state: 'visible'
2555
+ });
2556
+ await filter.scrollIntoViewIfNeeded();
2557
+ await filter.fill(roleName);
2558
+ const roleRow = this.page.locator('table.table-striped tbody tr').first();
2559
+ const labels = [
2560
+ 'read',
2561
+ 'repo edit'
2562
+ ];
2563
+ const headers = this.page.locator('table.table-striped thead th');
2564
+ const headerCount = await headers.count();
2565
+ const headerTexts = [];
2566
+ for(let i = 0; i < headerCount; i += 1)headerTexts.push((await headers.nth(i).innerText()).trim().toLowerCase());
2567
+ for (const label of labels){
2568
+ const colIndex = headerTexts.findIndex((text)=>text.includes(label));
2569
+ if (colIndex === -1) throw new Error(`Permission column not found: ${label}`);
2570
+ const checkbox = roleRow.locator('td').nth(colIndex).locator('input[type="checkbox"]');
2571
+ if (!await checkbox.isChecked()) await checkbox.check();
2572
+ }
2573
+ await this.page.getByRole('button', {
2574
+ name: 'Save and close'
2575
+ }).click();
2576
+ await this.handleSaveToastOrAlreadyExists();
2577
+ }
2578
+ }
2579
+
2580
+
2581
+
2582
+ class $9c5904ab27d13841$export$170f2cb42585788e extends (0, $6480ad852470b7ac$export$cb21416f3c2fd176) {
2583
+ /* Navigates to the Configuration Edit Permissions page via the tree context menu */ async navigateToPage() {
2584
+ await this.openRootContextMenu('Configuration');
2585
+ await this.page.getByRole('link', {
2586
+ name: 'Edit Permissions'
2587
+ }).click();
2588
+ }
2589
+ async navigateToConfigurationEditPermissionsPage() {
2590
+ await this.navigateToPage();
2591
+ }
2592
+ /* Gives the permissions to a role */ async givePermissionsToRole(roleName) {
2593
+ const filter = this.page.getByPlaceholder('Filter by roles').first();
2594
+ await filter.waitFor({
2595
+ state: 'visible'
2596
+ });
2597
+ await filter.scrollIntoViewIfNeeded();
2598
+ await filter.fill(roleName);
2599
+ const roleRow = this.page.locator('table.table-striped tbody tr').first();
2600
+ const checkboxes = roleRow.locator('input[type="checkbox"]');
2601
+ const count = await checkboxes.count();
2602
+ for(let i = 0; i < count; i += 1){
2603
+ const checkbox = checkboxes.nth(i);
2604
+ if (!await checkbox.isChecked()) await checkbox.check();
2605
+ }
2606
+ await this.page.getByRole('button', {
2607
+ name: 'Save and close'
2608
+ }).click();
2609
+ await this.handleSaveToastOrAlreadyExists();
2610
+ }
2611
+ }
2612
+
2613
+
2614
+ class $95d5ebc9765b570f$export$b8a61e5c71402559 extends (0, $6480ad852470b7ac$export$cb21416f3c2fd176) {
2615
+ constructor(page){
2616
+ super(page);
2617
+ this.homePage = new (0, $e18c8d3707c8c74c$export$36d69433c4f81145)(page);
2618
+ this.userPage = new (0, $ca2721b1aeb903c5$export$ecdc3cf9d1cfe143)(page);
2619
+ this.overthereLocalHostPage = new (0, $a4d71fd851704781$export$c88e1d16f82516d)(page);
2620
+ this.environmentsPage = new (0, $a63f1342e8823465$export$12530425267834a9)(page);
2621
+ this.applicationsPage = new (0, $3fb4750cbb53e5e6$export$1533b625ec0c75e2)(page);
2622
+ this.reportsPage = new (0, $5eb37a606d823774$export$b8a443164510a1b4)(page);
2623
+ this.reportsControlTasksPage = new (0, $9a7d1625454209b8$export$5c1198389e139c11)(page);
2624
+ this.reportsDashboardPage = new (0, $7e0dd2c52b1925ce$export$a3e02ac2d0adbb20)(page);
2625
+ this.reportsDeploymentsPage = new (0, $48379bea92ea9e64$export$41a993d086bafffd)(page);
2626
+ this.infrastructureEditPermissionsPage = new (0, $801d6ccd71155137$export$e37b272c81a10693)(page);
2627
+ this.environmentEditPermissionsPage = new (0, $0c1804a88a0b5036$export$c919546f4bf88f35)(page);
2628
+ this.applicationEditPermissionsPage = new (0, $e3cbc2135fe6aa40$export$ecd8b3e50e92d781)(page);
2629
+ this.configurationEditPermissionsPage = new (0, $9c5904ab27d13841$export$170f2cb42585788e)(page);
2630
+ this.gitopsConfigurationPage = new (0, $fe9360dc1f965c8f$export$95a11cbd2815051e)(page);
2631
+ }
2632
+ async navigateToHomePage() {
2633
+ await this.page.goto('/home');
2634
+ }
2635
+ async navigateToUserPage() {
2636
+ await this.page.locator('p.MuiTypography-root', {
2637
+ hasText: 'User management'
2638
+ }).click();
2639
+ }
2640
+ async clickCollapseSideView() {
2641
+ const collapseButton = this.page.getByTestId('back-button');
2642
+ await collapseButton.click();
2643
+ }
2644
+ }
2645
+
2646
+
2647
+
2648
+
2649
+ class $c5e912d43cd579b2$export$f14c0e3f98d164c0 extends (0, $7d546dcaafadc158$export$2b65d1d97338f32b) {
2650
+ /* Login with username and password*/ async login(userName, password, pageOverride) {
2651
+ const p = pageOverride ?? this.page;
2652
+ await p.goto('/#/login');
2653
+ await (0, $lE6ZQ$expect)(p).toHaveTitle('Digital.ai Deploy');
2654
+ await p.getByPlaceholder('user').fill(userName, {
2655
+ timeout: 10000
2656
+ });
2657
+ await p.getByPlaceholder('Password').fill(password, {
383
2658
  timeout: 10000
384
2659
  });
385
- await this.page.getByRole("button", {
386
- name: "Log in"
2660
+ await p.getByRole('button', {
2661
+ name: 'Log in'
387
2662
  }).click({
388
2663
  timeout: 10000
389
2664
  });
390
2665
  }
391
2666
  /* Verify invalid password message */ async verifyInvalidPasswordMessage() {
392
- const errorMessage = this.page.getByText("The username and/or password you have entered is incorrect.");
2667
+ const errorMessage = this.page.getByText('The username and/or password you have entered is incorrect.');
2668
+ await (0, $lE6ZQ$expect)(errorMessage).toBeVisible();
2669
+ }
2670
+ /* Verify the error message shown when a disabled user attempts to log in */ async verifyDisabledUserLoginError(pageOverride) {
2671
+ const p = pageOverride ?? this.page;
2672
+ const errorMessage = p.getByText('Your account is currently disabled. Please contact your Deploy administrator for further assistance.');
393
2673
  await (0, $lE6ZQ$expect)(errorMessage).toBeVisible();
394
2674
  }
2675
+ /* Verify the error message shown when a user without login permission attempts to log in */ async verifyNoLoginPermissionError(pageOverride) {
2676
+ const p = pageOverride ?? this.page;
2677
+ const errorMessage = p.locator('div.error-message.permission-error');
2678
+ await (0, $lE6ZQ$expect)(errorMessage).toBeVisible({
2679
+ timeout: 20000
2680
+ });
2681
+ }
395
2682
  /* Logout as authenticated user */ async logout() {
396
- await this.page.locator("button.dot-avatar").click();
397
- await this.page.getByText("Log out", {
2683
+ await this.page.locator('button.dot-avatar').click();
2684
+ await this.page.getByText('Log out', {
398
2685
  exact: true
399
2686
  }).click();
400
- await (0, $lE6ZQ$expect)(this.page.getByText("Log in").first()).toBeVisible();
2687
+ await this.page.waitForURL('**/#/login', {
2688
+ timeout: 15000
2689
+ });
2690
+ await this.page.reload();
2691
+ await this.page.waitForLoadState('networkidle');
2692
+ await this.page.waitForURL('**/#/login', {
2693
+ timeout: 15000
2694
+ });
2695
+ await this.page.getByPlaceholder('user').waitFor({
2696
+ state: 'visible',
2697
+ timeout: 15000
2698
+ });
401
2699
  }
402
2700
  }
403
2701
 
404
2702
 
405
2703
  const $114b0b206b8d644f$export$e0969da9b8fb378d = (0, $lE6ZQ$test).extend({
406
- fixtures: async ({ page: page }, use)=>{
2704
+ fixtures: async ({ page: page }, use)=>{
407
2705
  const fixtures = new $114b0b206b8d644f$var$Fixtures(page);
408
2706
  await use(fixtures);
409
2707
  return fixtures;
410
2708
  },
411
- loginPage: async ({ page: page }, use)=>{
2709
+ loginPage: async ({ page: page }, use)=>{
412
2710
  const loginPage = new (0, $c5e912d43cd579b2$export$f14c0e3f98d164c0)(page);
413
2711
  await use(loginPage);
414
2712
  return loginPage;
415
2713
  },
416
- navigation: async ({ page: page }, use)=>{
2714
+ navigation: async ({ page: page }, use)=>{
417
2715
  const navigationPage = new (0, $95d5ebc9765b570f$export$b8a61e5c71402559)(page);
418
2716
  await use(navigationPage);
419
2717
  return navigationPage;