@digital-ai/devops-page-object-release 0.0.15 → 0.0.16

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/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @digital-ai/devops-page-object-release
2
2
 
3
+ ## 0.0.16
4
+
5
+ ### Patch Changes
6
+
7
+ - 92bf617: S-111286: page objects modifications for reopen-task-scenario
8
+ - 63ff9f6: S-111156: page objects modifications for claim-scenario
9
+ - 3747dfc: S-110037: Migrated releaseProperties and ci-properties scenario to
10
+ - 5f07582: + global variable page object creation
11
+ - 28fab68: S-111782: page object modifications for skip-scenario.ts
12
+ - e327dee: S-111571: page object modifications for task-flag-scenario.ts
13
+
3
14
  ## 0.0.15
4
15
 
5
16
  ### Patch Changes
package/dist/main.js CHANGED
@@ -1,8 +1,8 @@
1
1
  var $kKeXs$playwrighttest = require("@playwright/test");
2
2
  var $kKeXs$child_process = require("child_process");
3
3
  var $kKeXs$process = require("process");
4
- var $kKeXs$fs = require("fs");
5
4
  var $kKeXs$moment = require("moment");
5
+ var $kKeXs$fs = require("fs");
6
6
 
7
7
  var $parcel$global =
8
8
  typeof globalThis !== 'undefined'
@@ -1440,13 +1440,18 @@ class $f9016705c1a1eb20$export$aa59788fdecae2f2 extends (0, $f8721861c660dd88$ex
1440
1440
  hasText: fileName
1441
1441
  }).click();
1442
1442
  await this.page.getByLabel("delete file").click();
1443
+ await this.page.getByRole("button", {
1444
+ name: "Delete"
1445
+ }).waitFor({
1446
+ state: "visible"
1447
+ });
1443
1448
  await this.page.getByRole("button", {
1444
1449
  name: "Delete"
1445
1450
  }).click();
1446
1451
  }
1447
1452
  async expectWithNoAttachment(tempFile) {
1448
- const test = await this.page.locator(".task-attachments-grid .file-item-text").isVisible();
1449
- if (test) await (0, $kKeXs$playwrighttest.expect)(this.page.locator(".task-attachments-grid .file-item-text")).not.toContainText(tempFile);
1453
+ const test = await this.page.locator(".task-attachments-grid .file-item-text").count();
1454
+ if (test > 0) await (0, $kKeXs$playwrighttest.expect)(this.page.locator(".task-attachments-grid .file-item-text")).not.toContainText(tempFile);
1450
1455
  else await (0, $kKeXs$playwrighttest.expect)(this.page.locator(".task-attachments-grid .file-item-text")).not.toBeVisible();
1451
1456
  }
1452
1457
  }
@@ -1527,11 +1532,40 @@ class $6a21661eb4695574$export$e946776eae644790 extends (0, $f8721861c660dd88$ex
1527
1532
  await this.page.locator(".icon-fullscreen-exit").click();
1528
1533
  await (0, $kKeXs$playwrighttest.expect)(this.page.locator(".icon-fullscreen-exit")).not.toBeVisible();
1529
1534
  }
1535
+ async expectAssignedTo(username) {
1536
+ await (0, $kKeXs$playwrighttest.expect)(this.page.getByRole("button", {
1537
+ name: username
1538
+ })).toBeVisible();
1539
+ }
1540
+ async assignToMe(userName, existingUsername) {
1541
+ await this.page.getByRole("button", {
1542
+ name: existingUsername
1543
+ }).click();
1544
+ await this.page.getByTestId(`render-option-${userName}`).click();
1545
+ }
1546
+ async setFlag(flagName, flagComment) {
1547
+ await this.page.getByTestId("flag-btn").click();
1548
+ await this.page.getByLabel(flagName).click();
1549
+ await this.page.getByPlaceholder("Set message").click();
1550
+ await this.page.getByPlaceholder("Set message").fill(flagComment);
1551
+ await this.page.getByPlaceholder("Set message").press("Enter");
1552
+ await (0, $kKeXs$playwrighttest.expect)(this.page.getByRole("button", {
1553
+ name: `flag icon ${flagComment}`
1554
+ })).toBeVisible();
1555
+ }
1556
+ async expectFlaggedWith(flagName, flagComment) {
1557
+ await this.page.getByRole("button", {
1558
+ name: "flag icon"
1559
+ }).click();
1560
+ const regexPattern = new RegExp(`${flagComment}.*${flagName}`, "i");
1561
+ await (0, $kKeXs$playwrighttest.expect)(this.page.getByText(regexPattern)).toBeVisible();
1562
+ }
1530
1563
  }
1531
1564
 
1532
1565
 
1533
1566
 
1534
1567
 
1568
+
1535
1569
  class $8681d8a3f46f87b7$export$d1077068a9cc9f17 extends (0, $f8721861c660dd88$export$2b65d1d97338f32b) {
1536
1570
  constructor(page){
1537
1571
  super(page);
@@ -1564,9 +1598,10 @@ class $8681d8a3f46f87b7$export$d1077068a9cc9f17 extends (0, $f8721861c660dd88$ex
1564
1598
  async save() {
1565
1599
  await this.page.getByRole("button", {
1566
1600
  name: "Save"
1567
- }).click({
1568
- timeout: 2000
1569
- });
1601
+ }).waitFor();
1602
+ await this.page.getByRole("button", {
1603
+ name: "Save"
1604
+ }).click();
1570
1605
  await (0, $kKeXs$playwrighttest.expect)(this.page.locator(".form-footer .last-saved")).toBeVisible();
1571
1606
  }
1572
1607
  async reset() {
@@ -1612,6 +1647,98 @@ class $8681d8a3f46f87b7$export$d1077068a9cc9f17 extends (0, $f8721861c660dd88$ex
1612
1647
  }).locator("span").click();
1613
1648
  await this.page.getByText("Remove").click();
1614
1649
  }
1650
+ async expectVariableDisplayed(variable, present) {
1651
+ if (present) await (0, $kKeXs$playwrighttest.expect)(this.page.locator(`#release-properties .form-group`, {
1652
+ hasText: variable
1653
+ })).toHaveCount(1);
1654
+ else await (0, $kKeXs$playwrighttest.expect)(this.page.locator(`#release-properties .form-group`, {
1655
+ hasText: variable
1656
+ })).toHaveCount(0);
1657
+ }
1658
+ async setScheduledStartDate(date, monthYear) {
1659
+ await this.page.locator(`.scheduled-start-date .date`).click();
1660
+ const prev = this.page.locator(".datepicker-days .prev");
1661
+ const next = this.page.locator(".datepicker-days .next");
1662
+ const monYear = this.page.locator(".datepicker-days .datepicker-switch");
1663
+ const thisMonth = (0, ($parcel$interopDefault($kKeXs$moment)))(monthYear, "MMMM YYYY").isBefore();
1664
+ while(await monYear.textContent() != monthYear)if (thisMonth) await prev.click();
1665
+ else await next.click();
1666
+ await this.page.getByRole("cell", {
1667
+ name: "" + date + ""
1668
+ }).first().click();
1669
+ }
1670
+ async setScheduledStartTime(hrs, mins, meridian) {
1671
+ await this.page.locator(".scheduled-start-date .time-picker-holder").click();
1672
+ if (typeof hrs !== "undefined") {
1673
+ await this.page.locator(".bootstrap-timepicker-hour").click();
1674
+ await this.page.locator(".bootstrap-timepicker-hour").clear();
1675
+ await this.page.locator(".bootstrap-timepicker-hour").fill(hrs);
1676
+ }
1677
+ if (typeof mins !== "undefined") {
1678
+ await this.page.locator(".bootstrap-timepicker-minute").click();
1679
+ await this.page.locator(".bootstrap-timepicker-minute").clear();
1680
+ await this.page.locator(".bootstrap-timepicker-minute").fill(mins);
1681
+ }
1682
+ if (typeof meridian !== "undefined") {
1683
+ await this.page.locator(".bootstrap-timepicker-meridian").click();
1684
+ await this.page.locator(".bootstrap-timepicker-meridian").clear();
1685
+ await this.page.locator(".bootstrap-timepicker-meridian").fill(meridian);
1686
+ }
1687
+ await this.page.keyboard.press("Escape");
1688
+ }
1689
+ async setDuration(days, hours, mins) {
1690
+ await this.page.locator(".duration-editor").click();
1691
+ if (typeof days !== "undefined") {
1692
+ await this.page.locator(".days").click();
1693
+ await this.page.locator(".days").clear();
1694
+ await this.page.locator(".days").fill(days);
1695
+ }
1696
+ if (typeof hours !== "undefined") {
1697
+ await this.page.locator(".hours").click();
1698
+ await this.page.locator(".hours").clear();
1699
+ await this.page.locator(".hours").fill(hours);
1700
+ }
1701
+ if (typeof mins !== "undefined") {
1702
+ await this.page.locator(".minutes").click();
1703
+ await this.page.locator(".minutes").clear();
1704
+ await this.page.locator(".minutes").fill(mins);
1705
+ }
1706
+ await this.page.keyboard.press("Escape");
1707
+ }
1708
+ async expectScheduledStartDateToBe(date) {
1709
+ (0, $kKeXs$playwrighttest.expect)(await this.page.locator(`.scheduled-start-date .date input`).getAttribute("value")).toContain(date);
1710
+ }
1711
+ async expectScheduledStartTimeToBe(date) {
1712
+ (0, $kKeXs$playwrighttest.expect)(await this.page.locator(`.scheduled-start-date .time input`).getAttribute("value")).toContain(date);
1713
+ }
1714
+ async expectDueDateToBe(date) {
1715
+ (0, $kKeXs$playwrighttest.expect)(await this.page.locator(".due-date .date input").getAttribute("value")).toContain(date);
1716
+ }
1717
+ async expectedDueDateTime(time) {
1718
+ (0, $kKeXs$playwrighttest.expect)(await this.page.locator(".due-date .time input").getAttribute("value")).toContain(time);
1719
+ }
1720
+ async expectDurationToBe(duration) {
1721
+ (0, $kKeXs$playwrighttest.expect)(await this.page.locator(".duration-editor").textContent()).toBe(duration);
1722
+ }
1723
+ async setDueDate(hrs, min, meridian) {
1724
+ await this.page.locator(".due-date .time-picker-holder").click();
1725
+ if (typeof hrs !== "undefined") {
1726
+ await this.page.locator(".bootstrap-timepicker-widget .bootstrap-timepicker-hour").click();
1727
+ await this.page.locator(".bootstrap-timepicker-widget .bootstrap-timepicker-hour").clear();
1728
+ await this.page.locator(".bootstrap-timepicker-widget .bootstrap-timepicker-hour").fill(hrs);
1729
+ }
1730
+ if (typeof min !== "undefined") {
1731
+ await this.page.locator(".bootstrap-timepicker-widget .bootstrap-timepicker-minute").click();
1732
+ await this.page.locator(".bootstrap-timepicker-widget .bootstrap-timepicker-minute").clear();
1733
+ await this.page.locator(".bootstrap-timepicker-widget .bootstrap-timepicker-minute").fill(min);
1734
+ }
1735
+ if (typeof meridian !== "undefined") {
1736
+ await this.page.locator(".bootstrap-timepicker-widget .bootstrap-timepicker-meridian").click();
1737
+ await this.page.locator(".bootstrap-timepicker-widget .bootstrap-timepicker-meridian").clear();
1738
+ await this.page.locator(".bootstrap-timepicker-widget .bootstrap-timepicker-meridian").fill(meridian);
1739
+ }
1740
+ await this.page.keyboard.press("Escape");
1741
+ }
1615
1742
  }
1616
1743
 
1617
1744
 
@@ -1636,6 +1763,16 @@ class $9b9a8c3da392d020$export$f43492e8ac3c566 extends (0, $f8721861c660dd88$exp
1636
1763
  getPhase(phaseName) {
1637
1764
  return new $9b9a8c3da392d020$var$Phase(this.page, phaseName);
1638
1765
  }
1766
+ async expectNotFlagged() {
1767
+ await (0, $kKeXs$playwrighttest.expect)(this.page.locator(".flag-none-icon")).toBeHidden();
1768
+ }
1769
+ async expectFlagOnTaskCard() {
1770
+ await (0, $kKeXs$playwrighttest.expect)(this.page.locator(".risk-flag-icon")).toBeVisible();
1771
+ }
1772
+ async refresh() {
1773
+ await this.page.reload();
1774
+ await this.page.waitForSelector("#release");
1775
+ }
1639
1776
  async start() {
1640
1777
  await this.page.getByTestId("start-btn").click();
1641
1778
  await this.page.getByRole("button", {
@@ -1689,6 +1826,25 @@ class $9b9a8c3da392d020$export$f43492e8ac3c566 extends (0, $f8721861c660dd88$exp
1689
1826
  timeout: 10000
1690
1827
  });
1691
1828
  }
1829
+ async waitForTaskPlanned(title) {
1830
+ await (0, $kKeXs$playwrighttest.expect)(this.page.locator(`.task:has-text('${title}').planned`)).toBeVisible();
1831
+ }
1832
+ async openManualTaskDetails(title) {
1833
+ await this.page.locator(`text=${title}`).click({
1834
+ force: true
1835
+ });
1836
+ await (0, $kKeXs$playwrighttest.expect)(this.page.locator("div").filter({
1837
+ hasText: title
1838
+ }).first()).toBeVisible();
1839
+ }
1840
+ async reopenTask(comment) {
1841
+ await this.page.locator("div").filter({
1842
+ hasText: /^Reopen$/
1843
+ }).click();
1844
+ await this.page.getByTestId("task-action-comment").click();
1845
+ await this.page.getByTestId("task-action-comment").fill(comment);
1846
+ await this.page.getByTestId("task-action-confirm").click();
1847
+ }
1692
1848
  async openTaskDrawer(taskName) {
1693
1849
  await this.page.locator(".task-header").getByText(taskName, {
1694
1850
  exact: true
@@ -1785,7 +1941,12 @@ class $9b9a8c3da392d020$export$f43492e8ac3c566 extends (0, $f8721861c660dd88$exp
1785
1941
  }
1786
1942
  }
1787
1943
  async expectTitleToBeInBreadcrumbLink(title) {
1788
- (0, $kKeXs$playwrighttest.expect)(this.page.locator(".dot-breadcrumbs a", {
1944
+ await (0, $kKeXs$playwrighttest.expect)(this.page.locator(".dot-breadcrumbs a", {
1945
+ hasText: title
1946
+ })).toBeVisible();
1947
+ }
1948
+ async expectHasPhase(title) {
1949
+ await (0, $kKeXs$playwrighttest.expect)(this.page.locator(`#release-content .phase-title`, {
1789
1950
  hasText: title
1790
1951
  })).toBeVisible();
1791
1952
  }
@@ -2241,7 +2402,23 @@ class $ed2d4739e27d43c1$export$60c3bfa6385e2a10 extends (0, $f8721861c660dd88$ex
2241
2402
  }
2242
2403
  async openTask(taskName) {
2243
2404
  await this.filterTaskByTitle(taskName);
2244
- await this.page.getByText(taskName).click();
2405
+ await this.page.getByText(taskName).first().click();
2406
+ }
2407
+ async skip(taskName, comment) {
2408
+ await this.page.locator(`.row.task-inner`, {
2409
+ hasText: taskName
2410
+ }).locator("span.skip").click();
2411
+ await this.page.getByPlaceholder("Give feedback or place a comment...").click();
2412
+ await this.page.getByPlaceholder("Give feedback or place a comment...").fill(comment);
2413
+ await this.page.getByRole("button", {
2414
+ name: "Skip",
2415
+ exact: true
2416
+ }).click();
2417
+ }
2418
+ async waitForTaskInProgress(taskName) {
2419
+ await (0, $kKeXs$playwrighttest.expect)(this.page.locator(`.row.task-inner`, {
2420
+ hasText: taskName
2421
+ }).getByText("In progress")).toBeVisible();
2245
2422
  }
2246
2423
  async openTaskInReleaseView(taskName) {
2247
2424
  await this.page.locator(`.row.task-inner`, {
@@ -2253,13 +2430,18 @@ class $ed2d4739e27d43c1$export$60c3bfa6385e2a10 extends (0, $f8721861c660dd88$ex
2253
2430
  hasText: taskName
2254
2431
  }).locator(`.calendar-link a`).click();
2255
2432
  }
2433
+ async openTaskDrawer(taskName) {
2434
+ await this.page.locator(`.row.task-inner`, {
2435
+ hasText: taskName
2436
+ }).getByText(taskName).click();
2437
+ }
2256
2438
  async filterTaskByTitle(taskname) {
2257
- await this.page.locator(".toggle-search-filter").click();
2439
+ await this.page.locator(".searchFilter").click();
2258
2440
  await this.page.locator(".searchFilter").fill(taskname);
2259
2441
  await this.page.locator(".searchFilter").press("Enter");
2260
2442
  await (0, $kKeXs$playwrighttest.expect)(this.page.locator("//div[@data-task-title]").filter({
2261
2443
  hasText: taskname
2262
- })).toBeVisible();
2444
+ }).first()).toBeVisible();
2263
2445
  }
2264
2446
  async filterTasksByTag(tag, taskTitleForValidation) {
2265
2447
  await this.page.locator(".toggle-search-filter").click();
@@ -2294,6 +2476,24 @@ class $ed2d4739e27d43c1$export$60c3bfa6385e2a10 extends (0, $f8721861c660dd88$ex
2294
2476
  await (0, $kKeXs$playwrighttest.expect)(this.page.locator(".view-in-release")).not.toBeVisible();
2295
2477
  }
2296
2478
  }
2479
+ async openTaskList() {
2480
+ await this.page.goto("./#/tasks");
2481
+ }
2482
+ async clickOnAssigneeButton(title) {
2483
+ await this.page.locator(`.btn-group-filter.btn-group button.btn.btn-flat[title="${title}"]`).click();
2484
+ }
2485
+ async assignTaskToMe(title) {
2486
+ await this.page.locator(`.task-line`).filter({
2487
+ hasText: title
2488
+ }).locator(`.assign-to-me`).click();
2489
+ await this.page.locator('.modal:visible >> text="Assign to me"').click();
2490
+ }
2491
+ async expectTaskAssignedToMe(title) {
2492
+ await this.expectTaskAssignedTo(title, "me");
2493
+ }
2494
+ async expectTaskAssignedTo(title, user) {
2495
+ await (0, $kKeXs$playwrighttest.expect)(this.page.locator(`.task-line:has-text("${title}") >> text="${user}"`).first()).toHaveCount(1);
2496
+ }
2297
2497
  async expectTaskTitle(taskTitle) {
2298
2498
  (0, $kKeXs$playwrighttest.expect)(await this.page.locator("#tasks0").innerText()).toContain(taskTitle);
2299
2499
  }
@@ -2953,6 +3153,7 @@ class $258749e0671c845a$export$f14c0e3f98d164c0 extends (0, $f8721861c660dd88$ex
2953
3153
  timeout: 10000
2954
3154
  });
2955
3155
  await this.page.waitForTimeout(1000);
3156
+ await this.closePendoModalWindow();
2956
3157
  }
2957
3158
  /**
2958
3159
  * Logout as authenticated user
@@ -2975,6 +3176,10 @@ class $258749e0671c845a$export$f14c0e3f98d164c0 extends (0, $f8721861c660dd88$ex
2975
3176
  const val = await this.page.locator("top-toolbar .avatar-wrapper span.dot-tooltip").getAttribute("aria-label");
2976
3177
  (0, $kKeXs$playwrighttest.expect)(val).toContain(username);
2977
3178
  }
3179
+ async closePendoModalWindow() {
3180
+ await this.page.waitForTimeout(1000);
3181
+ if (await this.page.locator("._pendo-close-guide").count() > 0) await this.page.locator("._pendo-close-guide").click();
3182
+ }
2978
3183
  }
2979
3184
 
2980
3185