@digital-ai/devops-page-object-release 0.0.39 → 0.0.40

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
@@ -161,6 +161,22 @@ class $5359280e98d97ff9$export$a678525e79c4ccc4 extends (0, $9626bc9256ce31f7$ex
161
161
  });
162
162
  await (0, $hOLA6$expect)(releaseStatus).toBeVisible();
163
163
  }
164
+ async expectReleaseFailing(releaseTitle) {
165
+ const releaseStatus = this.page.locator(".release").filter({
166
+ hasText: releaseTitle
167
+ }).locator(".release-status").filter({
168
+ hasText: "Failing"
169
+ });
170
+ await (0, $hOLA6$expect)(releaseStatus).toBeVisible();
171
+ }
172
+ async expectReleaseCompleted(releaseTitle) {
173
+ const releaseStatus = this.page.locator(".release").filter({
174
+ hasText: releaseTitle
175
+ }).locator(".release-status").filter({
176
+ hasText: "Completed"
177
+ });
178
+ await (0, $hOLA6$expect)(releaseStatus).toBeVisible();
179
+ }
164
180
  async filterReleaseByAllStatus() {
165
181
  await this.page.locator(".ci-status .remaining-tags").getByText("more").click();
166
182
  await this.page.locator(".ci-status .xl-react-link").getByText("Select all").click();
@@ -621,16 +637,25 @@ class $dfc4ce40cbd0eb71$var$VariableModal extends (0, $9626bc9256ce31f7$export$2
621
637
  }
622
638
  async createPossibleValuesVariable(variableName) {
623
639
  await this.page.locator(".variable-toggle button").click();
624
- await this.page.locator(".ui-autocomplete-input").fill(variableName);
625
- const check = await this.page.locator(".ui-menu-item-wrapper").getByText("${" + variableName + "}", {
626
- exact: true
627
- }).isVisible();
628
- if (check) await this.page.locator(".ui-menu-item-wrapper").getByText("${" + variableName + "}", {
629
- exact: true
630
- }).click();
631
- else await this.page.locator(".ui-menu-item-wrapper").filter({
632
- hasText: `${variableName}`
633
- }).click();
640
+ await (0, $hOLA6$expect)(async ()=>{
641
+ await this.page.locator(".ui-autocomplete-input").clear();
642
+ await this.page.locator(".ui-autocomplete-input").fill(variableName);
643
+ const check = await this.page.locator(".ui-menu-item-wrapper").getByText("${" + variableName + "}", {
644
+ exact: true
645
+ }).isVisible({
646
+ timeout: 1000
647
+ });
648
+ if (check) await this.page.locator(".ui-menu-item-wrapper").getByText("${" + variableName + "}", {
649
+ exact: true
650
+ }).click({
651
+ timeout: 1000
652
+ });
653
+ else await this.page.locator(".ui-menu-item-wrapper").filter({
654
+ hasText: `${variableName}`
655
+ }).click({
656
+ timeout: 1000
657
+ });
658
+ }).toPass();
634
659
  }
635
660
  async expectVariableValueToBe(value) {
636
661
  (0, $hOLA6$expect)(await this.page.locator('.variable-value select option[selected="selected"]').textContent()).toBe(value);
@@ -1100,6 +1125,11 @@ class $90bb70a7e909e500$export$519356f6c50361f7 extends (0, $9626bc9256ce31f7$ex
1100
1125
  await (0, $hOLA6$expect)(this.page.locator(`[data-test-id="${propertyName}"]`).getByText(value)).toBeVisible();
1101
1126
  return this;
1102
1127
  }
1128
+ async expectDisabledInputField(propertyName) {
1129
+ const inputField = this.railLocator.locator(`.task-input-property input[id="${propertyName}"]`);
1130
+ if (await inputField.isVisible()) await (0, $hOLA6$expect)(inputField).toHaveAttribute("readonly", "");
1131
+ return this;
1132
+ }
1103
1133
  async expectRiskProfileValue(value) {
1104
1134
  await (0, $hOLA6$expect)(this.railLocator.locator("#riskProfileId")).toHaveValue(value);
1105
1135
  }
@@ -2522,6 +2552,8 @@ class $19b7e7e46cfe3be0$export$649fde34d823ece7 extends (0, $9626bc9256ce31f7$ex
2522
2552
  constructor(page){
2523
2553
  super(page);
2524
2554
  this.commentBox = this.page.locator(`.input-block-level`);
2555
+ this.contextMenuButton = this.page.locator("#context-menu-container li");
2556
+ this.completeButton = this.page.getByTestId("release-grid-complete-btn");
2525
2557
  this.dateUtil = new (0, $71075ce65fcede1d$export$9b575f14aa5e09a1)(page);
2526
2558
  this.refreshButton = this.page.getByTestId("refresh-btn");
2527
2559
  this.taskDrawer = new (0, $8e39246218b802fc$export$e946776eae644790)(page);
@@ -2533,8 +2565,12 @@ class $19b7e7e46cfe3be0$export$649fde34d823ece7 extends (0, $9626bc9256ce31f7$ex
2533
2565
  }
2534
2566
  // eslint-disable-next-line max-params
2535
2567
  async callMenuOptionsForTask(taskTitle, option, taskGroup, taskType) {
2536
- await this.openContextMenuForTask(taskTitle);
2537
- await this.page.locator(".dropdown-menu li").getByText(option).click();
2568
+ await (0, $hOLA6$expect)(async ()=>{
2569
+ await this.openContextMenuForTask(taskTitle);
2570
+ await this.page.locator(".dropdown-menu li").getByText(option).click({
2571
+ timeout: 1000
2572
+ });
2573
+ }).toPass();
2538
2574
  if (await this.commentBox.isVisible()) await this.commentBox.fill(" Automation Test Comment");
2539
2575
  else if (await this.page.getByRole("heading", {
2540
2576
  name: "Change task type"
@@ -2668,7 +2704,7 @@ class $19b7e7e46cfe3be0$export$649fde34d823ece7 extends (0, $9626bc9256ce31f7$ex
2668
2704
  return this;
2669
2705
  }
2670
2706
  async completeSelectedTasks(comment) {
2671
- await this.page.getByTestId("release-grid-complete-btn").click();
2707
+ await this.completeButton.click();
2672
2708
  await this.page.getByPlaceholder("Give feedback or place a").fill(comment);
2673
2709
  await this.page.locator(".modal-footer").getByRole("button", {
2674
2710
  name: "Complete"
@@ -2725,6 +2761,47 @@ class $19b7e7e46cfe3be0$export$649fde34d823ece7 extends (0, $9626bc9256ce31f7$ex
2725
2761
  await this.page.keyboard.up("Shift");
2726
2762
  return this;
2727
2763
  }
2764
+ async isContextualMenuItemEnabled(menuName, taskTitle) {
2765
+ await this.openContextMenuForTask(taskTitle);
2766
+ await (0, $hOLA6$expect)(this.contextMenuButton.filter({
2767
+ hasText: menuName
2768
+ })).not.toHaveClass(/disabled/);
2769
+ await (0, $hOLA6$expect)(this.contextMenuButton.filter({
2770
+ hasText: menuName
2771
+ }).locator("a")).not.toBeDisabled();
2772
+ await this.closeContextMenu();
2773
+ }
2774
+ async isContextualMenuItemDisabled(menuName, taskTitle) {
2775
+ await this.openContextMenuForTask(taskTitle);
2776
+ const menuItem = this.contextMenuButton.filter({
2777
+ hasText: menuName
2778
+ });
2779
+ await (0, $hOLA6$expect)(menuItem).toHaveClass(/disabled/);
2780
+ const anchorTag = menuItem.locator("a");
2781
+ const disabledAttribute = await anchorTag.getAttribute("disabled");
2782
+ (0, $hOLA6$expect)(disabledAttribute).not.toBeNull();
2783
+ await this.closeContextMenu();
2784
+ }
2785
+ async closeContextMenu() {
2786
+ await this.page.locator("#release-header").click();
2787
+ }
2788
+ async expectDisabledActions(actionName) {
2789
+ await (0, $hOLA6$expect)(this.page.getByTestId(`release-grid-${actionName}-btn`)).toBeDisabled();
2790
+ return this;
2791
+ }
2792
+ async expectDisabledActionsOnMoreActionsMenu(menuItem) {
2793
+ await this.page.getByTestId("release-grid-dropdown-btn").click();
2794
+ if (menuItem instanceof Array) for (const val of menuItem)await (0, $hOLA6$expect)(this.page.getByRole("button", {
2795
+ name: val,
2796
+ exact: true
2797
+ })).toBeDisabled();
2798
+ else await (0, $hOLA6$expect)(this.page.getByRole("button", {
2799
+ name: menuItem,
2800
+ exact: true
2801
+ })).toBeDisabled();
2802
+ await this.closeContextMenu();
2803
+ return this;
2804
+ }
2728
2805
  }
2729
2806
 
2730
2807
 
@@ -3172,12 +3249,12 @@ class $43cbcdfccb6c2a76$export$f43492e8ac3c566 extends (0, $9626bc9256ce31f7$exp
3172
3249
  await downloadPromise;
3173
3250
  }
3174
3251
  async expectTaskToBePresent(taskName) {
3175
- await (0, $hOLA6$expect)(this.page.locator(".task").filter({
3252
+ await (0, $hOLA6$expect)(this.page.locator(".task .task-title").filter({
3176
3253
  hasText: taskName
3177
3254
  })).toBeVisible();
3178
3255
  }
3179
3256
  async expectTaskNotToBePresent(taskName) {
3180
- await (0, $hOLA6$expect)(this.page.locator(".task").filter({
3257
+ await (0, $hOLA6$expect)(this.page.locator(".task .task-title").filter({
3181
3258
  hasText: taskName
3182
3259
  })).not.toBeVisible();
3183
3260
  }
@@ -3215,6 +3292,12 @@ class $43cbcdfccb6c2a76$export$f43492e8ac3c566 extends (0, $9626bc9256ce31f7$exp
3215
3292
  async expectAddTaskNotVisible() {
3216
3293
  await (0, $hOLA6$expect)(this.page.locator(".add-task.link")).not.toBeVisible();
3217
3294
  }
3295
+ async expectTaskCount(count) {
3296
+ (0, $hOLA6$expect)(await this.page.locator(".task-container").count()).toBe(count);
3297
+ }
3298
+ async expectCurrentTaskCount(count) {
3299
+ (0, $hOLA6$expect)(await this.page.locator(".task.active").count()).toBe(count);
3300
+ }
3218
3301
  }
3219
3302
  class $43cbcdfccb6c2a76$var$Phase extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
3220
3303
  constructor(page, phaseName){
@@ -3232,8 +3315,8 @@ class $43cbcdfccb6c2a76$var$Phase extends (0, $9626bc9256ce31f7$export$2b65d1d97
3232
3315
  await this.phaseLocator.locator(".phase-header input").fill(title);
3233
3316
  await this.phaseLocator.locator(".phase-header input").blur();
3234
3317
  }
3235
- async isMenuItemEnabled(menuName, taskTitle) {
3236
- await this.openContextMenuForTask(taskTitle);
3318
+ async isMenuItemEnabled(menuName, taskTitle, group = false) {
3319
+ await this.openContextMenuForTask(taskTitle, group);
3237
3320
  await (0, $hOLA6$expect)(this.contextMenuButton.filter({
3238
3321
  hasText: menuName
3239
3322
  })).not.toHaveClass(/disabled/);
@@ -3242,8 +3325,8 @@ class $43cbcdfccb6c2a76$var$Phase extends (0, $9626bc9256ce31f7$export$2b65d1d97
3242
3325
  }).locator("a")).not.toBeDisabled();
3243
3326
  await this.closeContextMenu();
3244
3327
  }
3245
- async isMenuItemDisabled(menuName, taskTitle) {
3246
- await this.openContextMenuForTask(taskTitle);
3328
+ async isMenuItemDisabled(menuName, taskTitle, group = false) {
3329
+ await this.openContextMenuForTask(taskTitle, group);
3247
3330
  const menuItem = this.contextMenuButton.filter({
3248
3331
  hasText: menuName
3249
3332
  });
@@ -3296,8 +3379,11 @@ class $43cbcdfccb6c2a76$var$Phase extends (0, $9626bc9256ce31f7$export$2b65d1d97
3296
3379
  async expectToHaveTitle(phaseTitle) {
3297
3380
  await (0, $hOLA6$expect)(this.phaseLocator.locator(".phase-title")).toContainText(phaseTitle);
3298
3381
  }
3299
- async openContextMenuForTask(taskTitle) {
3300
- await this.phaseLocator.locator(".task").filter({
3382
+ async openContextMenuForTask(taskTitle, group = false) {
3383
+ if (!group) await this.phaseLocator.locator(".task").filter({
3384
+ hasText: taskTitle
3385
+ }).locator(".context-menu-button").click();
3386
+ else await this.phaseLocator.locator(".task-group .task").filter({
3301
3387
  hasText: taskTitle
3302
3388
  }).locator(".context-menu-button").click();
3303
3389
  }
@@ -3329,6 +3415,16 @@ class $43cbcdfccb6c2a76$var$Phase extends (0, $9626bc9256ce31f7$export$2b65d1d97
3329
3415
  }).click();
3330
3416
  return this;
3331
3417
  }
3418
+ async unlockFromContextMenu(taskTitle, group = false) {
3419
+ await this.openContextMenuForTask(taskTitle, group);
3420
+ await this.page.locator(".dropdown-menu li").getByText("Unlock").click();
3421
+ await this.expectLockCheckMark(taskTitle, false);
3422
+ }
3423
+ async lockFromContextMenu(taskTitle, group = false) {
3424
+ await this.openContextMenuForTask(taskTitle, group);
3425
+ await this.page.locator(".dropdown-menu li").getByText("Lock").click();
3426
+ await this.expectLockCheckMark(taskTitle, true);
3427
+ }
3332
3428
  async expectChangeTypeContextMenuDisabled(taskTitle, taskGroup, taskType) {
3333
3429
  await this.openContextMenuForTask(taskTitle);
3334
3430
  await this.page.locator(".dropdown-menu li").getByText("Change type").click();
@@ -3346,6 +3442,15 @@ class $43cbcdfccb6c2a76$var$Phase extends (0, $9626bc9256ce31f7$export$2b65d1d97
3346
3442
  await (0, $hOLA6$expect)(this.page.locator(".task-type-gatetask .marker-check-icon")).toBeVisible();
3347
3443
  return this;
3348
3444
  }
3445
+ async expectLockCheckMark(taskTitle, isVisible = true) {
3446
+ if (isVisible) await (0, $hOLA6$expect)(this.page.locator(".task-header").filter({
3447
+ hasText: taskTitle
3448
+ }).locator(".lock-icon")).toBeVisible();
3449
+ else await (0, $hOLA6$expect)(this.page.locator(".task-header").filter({
3450
+ hasText: taskTitle
3451
+ }).locator(".lock-icon")).not.toBeVisible();
3452
+ return this;
3453
+ }
3349
3454
  async expectFailureHandlerCheckMar(taskTitle, isVisible = true) {
3350
3455
  if (isVisible) await (0, $hOLA6$expect)(this.page.locator(".task").filter({
3351
3456
  hasText: taskTitle
@@ -3458,10 +3563,10 @@ class $43cbcdfccb6c2a76$var$Phase extends (0, $9626bc9256ce31f7$export$2b65d1d97
3458
3563
  await this.page.getByText("View all completed phases").click();
3459
3564
  }
3460
3565
  async expectTaskToBePresent(taskName, visible = true) {
3461
- if (visible) await (0, $hOLA6$expect)(this.phaseLocator.locator(".task").filter({
3566
+ if (visible) await (0, $hOLA6$expect)(this.phaseLocator.locator(".task .task-title").filter({
3462
3567
  hasText: taskName
3463
3568
  })).toBeVisible();
3464
- else await (0, $hOLA6$expect)(this.phaseLocator.locator(".task").filter({
3569
+ else await (0, $hOLA6$expect)(this.phaseLocator.locator(".task .task-title").filter({
3465
3570
  hasText: taskName
3466
3571
  })).not.toBeVisible();
3467
3572
  }
@@ -3535,6 +3640,21 @@ class $43cbcdfccb6c2a76$var$Phase extends (0, $9626bc9256ce31f7$export$2b65d1d97
3535
3640
  hasText: "Your request has been rejected, your permissions may have been revoked."
3536
3641
  })).toBeVisible();
3537
3642
  }
3643
+ async expectCurrentTaskCount(count) {
3644
+ (0, $hOLA6$expect)(await this.phaseLocator.locator(".task.active").count()).toBe(count);
3645
+ }
3646
+ async expectCompletedTaskCount(count) {
3647
+ (0, $hOLA6$expect)(await this.phaseLocator.locator(".task.completed").count()).toBe(count);
3648
+ }
3649
+ async expectFailedTaskCount(count) {
3650
+ (0, $hOLA6$expect)(await this.phaseLocator.locator(".task.failed").count()).toBe(count);
3651
+ }
3652
+ async expectFailingTaskCount(count) {
3653
+ (0, $hOLA6$expect)(await this.phaseLocator.locator(".task.failing").count()).toBe(count);
3654
+ }
3655
+ async expectSkippedTaskCount(count) {
3656
+ (0, $hOLA6$expect)(await this.phaseLocator.locator(".task.skipped").count()).toBe(count);
3657
+ }
3538
3658
  }
3539
3659
  class $43cbcdfccb6c2a76$var$RestartPhaseModel extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
3540
3660
  constructor(page){