@digital-ai/devops-page-object-release 0.0.68 → 0.0.69

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,12 @@
1
1
  # @digital-ai/devops-page-object-release
2
2
 
3
+ ## 0.0.69
4
+
5
+ ### Patch Changes
6
+
7
+ - 8a33ccd: S-122054: page-objects updated for delivery-flow-stage-scenario
8
+ - cc89660: S-122814: Migrated create from scratch scenarios in playwright
9
+
3
10
  ## 0.0.68
4
11
 
5
12
  ### Patch Changes
package/dist/main.js CHANGED
@@ -984,6 +984,10 @@ class $3d3f3946c54f5897$export$34addcca3f0ae43f extends (0, $f8721861c660dd88$ex
984
984
  exact: true
985
985
  }).click();
986
986
  }
987
+ async setOwner(ownerName) {
988
+ await this.page.locator(".release-owner").click();
989
+ await this.page.locator('input[name="owner"]').fill(ownerName);
990
+ }
987
991
  async create() {
988
992
  await this.page.getByRole("button", {
989
993
  name: "Create"
@@ -1116,6 +1120,10 @@ class $87643f2d97b0644e$export$a678525e79c4ccc4 extends (0, $f8721861c660dd88$ex
1116
1120
  });
1117
1121
  await (0, $kKeXs$playwrighttest.expect)(releaseStatus).toBeVisible();
1118
1122
  }
1123
+ async expectRedirectToReleasesList() {
1124
+ await (0, $kKeXs$playwrighttest.expect)(this.page.getByLabel("breadcrumb").getByText("Releases")).toBeVisible();
1125
+ await (0, $kKeXs$playwrighttest.expect)(this.page.locator(".release-list")).toBeVisible();
1126
+ }
1119
1127
  async filterReleaseByAllStatus() {
1120
1128
  await this.page.locator(".ci-status .remaining-tags").getByText("more").click();
1121
1129
  await this.page.locator(".ci-status .xl-react-link").getByText("Select all").click();
@@ -1165,6 +1173,12 @@ class $87643f2d97b0644e$export$a678525e79c4ccc4 extends (0, $f8721861c660dd88$ex
1165
1173
  await this.releaseCreatePage.create();
1166
1174
  await (0, $kKeXs$playwrighttest.expect)(this.page.getByLabel("breadcrumb").getByText("Flow")).toBeVisible();
1167
1175
  }
1176
+ async createNewReleaseWithOwner(releaseName, description, ownerName) {
1177
+ await this.releaseCreatePage.setName(releaseName);
1178
+ await this.releaseCreatePage.setDescription(description);
1179
+ await this.releaseCreatePage.setOwner(ownerName);
1180
+ await this.releaseCreatePage.create();
1181
+ }
1168
1182
  async gotoListView() {
1169
1183
  await this.page.getByRole("tab", {
1170
1184
  name: "release icon List"
@@ -3778,6 +3792,10 @@ class $d330a7d6f7926d53$export$3bc3e140e0dcb075 extends (0, $f8721861c660dd88$ex
3778
3792
  async expectSaveButtonDisabled() {
3779
3793
  (0, $kKeXs$playwrighttest.expect)(this.saveButton).toBeDisabled();
3780
3794
  }
3795
+ async expectTeamExists(teamName) {
3796
+ const teamLocator = this.page.getByText(teamName).first();
3797
+ await (0, $kKeXs$playwrighttest.expect)(teamLocator).toBeVisible();
3798
+ }
3781
3799
  }
3782
3800
 
3783
3801
 
@@ -5078,6 +5096,99 @@ class $b2d8d8d82fc8146c$export$eace2be4de1d3377 extends (0, $f8721861c660dd88$ex
5078
5096
  async expectDeliveryDisplayed(deliveryName) {
5079
5097
  (0, $kKeXs$playwrighttest.expect)(await this.page.locator(".fc-list-item-title").textContent()).toContain(deliveryName);
5080
5098
  }
5099
+ async openDeliveries() {
5100
+ await this.page.goto("./#/deliveries");
5101
+ return;
5102
+ }
5103
+ async resetFilter() {
5104
+ await Promise.all([
5105
+ this.page.waitForResponse((r)=>r.url().includes("/api/v1/deliveries/search")),
5106
+ this.page.locator("navigation-sidebar, .navigation-sidebar").locator("li", {
5107
+ hasText: "Deliveries"
5108
+ }).click()
5109
+ ]);
5110
+ const clearAllLink = this.page.locator('a.xl-react-link:has-text("Clear all")');
5111
+ if (await clearAllLink.isVisible() && !await clearAllLink.isDisabled()) await Promise.all([
5112
+ this.page.waitForResponse((r)=>r.url().includes("/api/v1/deliveries/search")),
5113
+ clearAllLink.click()
5114
+ ]);
5115
+ await this.page.locator(".xl-react-components-input-full:visible").first().click();
5116
+ const input = this.page.locator(".react-tagsinput-input");
5117
+ await input.fill("In progress");
5118
+ const inputCheckbox = this.page.locator('[title="In progress"] input[type="checkbox"]');
5119
+ if (!await inputCheckbox.isChecked()) await Promise.all([
5120
+ this.page.waitForResponse((r)=>r.url().includes("/api/v1/deliveries/search")),
5121
+ this.page.locator('[title="In progress"] .checkbox').click()
5122
+ ]);
5123
+ await this.setOrderBy("Start date");
5124
+ await this.page.waitForSelector(".fc-list-loaded", {
5125
+ state: "visible"
5126
+ });
5127
+ }
5128
+ async setOrderBy(orderBy) {
5129
+ await this.page.locator(".order-by-filter .btn:first-child").click();
5130
+ await this.page.locator(`.order-by-filter .bootstrap-link`, {
5131
+ hasText: orderBy
5132
+ }).click();
5133
+ await this.page.locator(".order-by-filter .btn:first-child").click();
5134
+ await this.page.waitForSelector(".fc-list-loaded", {
5135
+ state: "visible"
5136
+ });
5137
+ }
5138
+ async openDeliveryFlow(title) {
5139
+ await this.filterDeliveryByName(title);
5140
+ await this.page.locator("xlr-delivery-row, .delivery-row").filter({
5141
+ hasText: title
5142
+ }).getByRole("link").first().click();
5143
+ }
5144
+ async completeStage(stageTitle, trackedItems = []) {
5145
+ const popup = this.page.locator(`[data-cy='popup-${stageTitle}']`);
5146
+ await popup.click();
5147
+ const popover = this.page.locator(".ant-popover:not(.ant-popover-hidden)");
5148
+ const completeOption = popover.locator('a:text("Complete")');
5149
+ await completeOption.click();
5150
+ if (trackedItems.length > 0) {
5151
+ const trackedRows = this.page.locator(".tracked-item-row");
5152
+ await (0, $kKeXs$playwrighttest.expect)(trackedRows).toHaveCount(trackedItems.length);
5153
+ for (const item of trackedItems)await (0, $kKeXs$playwrighttest.expect)(this.page.locator(`.tracked-item-row:has-text("${item}")`)).toBeVisible();
5154
+ }
5155
+ const confirmButton = this.page.locator('.confirmation-dialog button:text("Complete")');
5156
+ await confirmButton.click();
5157
+ await (0, $kKeXs$playwrighttest.expect)(this.page.locator(`.label-completed:has-text("Completed")`)).toBeVisible();
5158
+ return this;
5159
+ }
5160
+ async reopenStage(stageTitle) {
5161
+ const popup = this.page.locator(`[data-cy='popup-${stageTitle}']`);
5162
+ await popup.click();
5163
+ const popover = this.page.locator(".ant-popover:not(.ant-popover-hidden)");
5164
+ await popover.locator('a:text("Reopen")').click();
5165
+ await this.page.locator('.confirmation-dialog button:text("Reopen")').click();
5166
+ await (0, $kKeXs$playwrighttest.expect)(this.page.locator('.label-completed:has-text("Completed")')).not.toBeVisible();
5167
+ return this;
5168
+ }
5169
+ async verifyStageContextMenuIsPresent(titles) {
5170
+ for (const title of titles){
5171
+ const locator = this.page.locator(`[data-cy='popup-${title}']`);
5172
+ await (0, $kKeXs$playwrighttest.expect)(locator).toHaveCount(1);
5173
+ }
5174
+ return;
5175
+ }
5176
+ async openFolderPath(folderPath) {
5177
+ await this.page.goto(`./#/folders/${encodeURIComponent(folderPath)}/releases`);
5178
+ await this.page.waitForSelector(".folder-content, .folder-view", {
5179
+ state: "visible"
5180
+ });
5181
+ return;
5182
+ }
5183
+ async openDeliveryFromFolder(title) {
5184
+ await this.page.locator("xlr-delivery-row, .release-row").filter({
5185
+ hasText: title
5186
+ }).getByRole("link").first().click();
5187
+ await this.page.waitForSelector(".delivery-flow, .flow-container", {
5188
+ state: "visible"
5189
+ });
5190
+ return;
5191
+ }
5081
5192
  }
5082
5193
 
5083
5194
 
@@ -6380,8 +6491,12 @@ class $3ceab7c613cabfd6$export$107317390f5aa598 extends (0, $f8721861c660dd88$ex
6380
6491
  async sortByColumn(columnName, columnIndex) {
6381
6492
  const table = this.page.getByTestId("users-table");
6382
6493
  const column = table.locator(`th[title="${columnName}"]`);
6383
- const originalData = await table.locator(`td:nth-child(${columnIndex})`).allTextContents();
6384
- await column.click();
6494
+ const columnClick = this.page.getByRole("button", {
6495
+ name: columnName,
6496
+ exact: true
6497
+ });
6498
+ const originalData = await table.locator(`tr td:nth-child(${columnIndex})`).allTextContents();
6499
+ await columnClick.click();
6385
6500
  const sort = await column.getAttribute("aria-sort");
6386
6501
  if (sort == "ascending") {
6387
6502
  const data = await table.locator(`td:nth-child(${columnIndex})`).allTextContents();
@@ -6390,7 +6505,9 @@ class $3ceab7c613cabfd6$export$107317390f5aa598 extends (0, $f8721861c660dd88$ex
6390
6505
  }
6391
6506
  if (sort == "descending") {
6392
6507
  const data = await table.locator(`td:nth-child(${columnIndex})`).allTextContents();
6393
- (0, $kKeXs$playwrighttest.expect)(data).toEqual(data.sort((a, b)=>a.localeCompare(b)));
6508
+ (0, $kKeXs$playwrighttest.expect)(data).toEqual([
6509
+ ...data
6510
+ ].sort((a, b)=>a.localeCompare(b)));
6394
6511
  }
6395
6512
  return this;
6396
6513
  }