@digital-ai/devops-page-object-release 0.0.50 → 0.0.51

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,13 @@
1
1
  # @digital-ai/devops-page-object-release
2
2
 
3
+ ## 0.0.51
4
+
5
+ ### Patch Changes
6
+
7
+ - d94c47c: S-118969: Migrated facet scenario in playwright
8
+ - 412c737: S-119455: Migrated task-blackout-scenario in playwright
9
+ - 39c1832: S-118969: Added facet fixture
10
+
3
11
  ## 0.0.50
4
12
 
5
13
  ### Patch Changes
package/dist/main.js CHANGED
@@ -1815,19 +1815,44 @@ class $6e382f24d680cc9b$export$a87b4660f21fba58 extends (0, $f8721861c660dd88$ex
1815
1815
  await this.page.getByRole("combobox", {
1816
1816
  name: labelName
1817
1817
  }).click();
1818
+ await this.page.getByRole("combobox", {
1819
+ name: labelName
1820
+ }).clear();
1818
1821
  await this.page.getByRole("combobox", {
1819
1822
  name: labelName
1820
1823
  }).fill(value);
1821
1824
  await this.page.getByRole("option", {
1822
- name: "value"
1825
+ name: value,
1826
+ exact: true
1823
1827
  }).click();
1824
1828
  }
1825
1829
  async saveAttributes() {
1830
+ await this.page.locator(".task-attribute-edit-buttons").click();
1826
1831
  await this.page.getByTestId("save-btn").click();
1827
1832
  }
1828
1833
  async cancelAttribute() {
1829
1834
  await this.page.getByTestId("cancel-btn").click();
1830
1835
  }
1836
+ async setInputTextField(fieldId, value) {
1837
+ await this.page.locator(`input[id="${fieldId}"]`).focus();
1838
+ await this.page.locator(`input[id="${fieldId}"]`).fill(value);
1839
+ }
1840
+ async expectFacetCountToBe(count) {
1841
+ await (0, $kKeXs$playwrighttest.expect)(this.page.locator(".task-attribute-item")).toHaveCount(count);
1842
+ }
1843
+ async expectFieldValueToBe(fieldId, value) {
1844
+ await (0, $kKeXs$playwrighttest.expect)(this.page.locator('input[id="' + fieldId + '"]')).toHaveValue(value);
1845
+ }
1846
+ async clickEditExistingFacet(facetName) {
1847
+ await this.page.locator(".task-attribute-item").filter({
1848
+ hasText: facetName
1849
+ }).getByTestId("edit-btn").click();
1850
+ }
1851
+ async deleteFacet(faceName) {
1852
+ await this.page.locator(".task-attribute-item").filter({
1853
+ hasText: faceName
1854
+ }).getByTestId("delete-btn").click();
1855
+ }
1831
1856
  }
1832
1857
 
1833
1858
 
@@ -2741,6 +2766,11 @@ class $1fbdec5dc9cde599$export$e3515314c13bc477 extends (0, $f8721861c660dd88$ex
2741
2766
  hasText: "Start Date"
2742
2767
  }).locator(".task-date-view-content")).toBeVisible();
2743
2768
  }
2769
+ async expectStartDateToBe(date) {
2770
+ (0, $kKeXs$playwrighttest.expect)(await this.page.locator(".flex-section.column").filter({
2771
+ hasText: "Start Date"
2772
+ }).locator(".task-date-view-content").getAttribute("aria-label")).toContain(date);
2773
+ }
2744
2774
  async expectEndDateToBeDisplayed() {
2745
2775
  await (0, $kKeXs$playwrighttest.expect)(this.page.locator(".flex-section.column").filter({
2746
2776
  hasText: "End Date"
@@ -2822,6 +2852,22 @@ class $1fbdec5dc9cde599$export$e3515314c13bc477 extends (0, $f8721861c660dd88$ex
2822
2852
  exact: true
2823
2853
  }).first().click();
2824
2854
  }
2855
+ async checkDelayDuringBlackoutPeriod() {
2856
+ await this.page.locator(".task-wait-switch").filter({
2857
+ hasText: "blackout"
2858
+ }).locator(".PrivateSwitchBase-input").check();
2859
+ }
2860
+ async unCheckDelayDuringBlackoutPeriod() {
2861
+ await this.page.getByTestId("blackout").locator(".PrivateSwitchBase-input").uncheck();
2862
+ }
2863
+ async checkEnvironmentAvailability() {
2864
+ await this.page.locator(".task-wait-switch").filter({
2865
+ hasText: "environment"
2866
+ }).locator(".PrivateSwitchBase-input").check();
2867
+ }
2868
+ async unCheckEnvironmentAvailability() {
2869
+ await this.page.getByTestId("environment").locator(".PrivateSwitchBase-input").uncheck();
2870
+ }
2825
2871
  }
2826
2872
 
2827
2873
 
@@ -3976,6 +4022,11 @@ class $9b9a8c3da392d020$export$f43492e8ac3c566 extends (0, $f8721861c660dd88$exp
3976
4022
  async expectRiskFlagOnTaskCard() {
3977
4023
  await (0, $kKeXs$playwrighttest.expect)(this.page.locator(".risk-flag-icon")).toBeVisible();
3978
4024
  }
4025
+ async expectBlackoutIconOnTaskCard(taskTitle) {
4026
+ await (0, $kKeXs$playwrighttest.expect)(this.page.locator(".task").filter({
4027
+ hasText: taskTitle
4028
+ }).locator(".circle-minus-icon")).toBeVisible();
4029
+ }
3979
4030
  async expectFlagOnCompletedTaskCard() {
3980
4031
  await (0, $kKeXs$playwrighttest.expect)(this.page.locator(".flag-count")).toBeVisible();
3981
4032
  }
@@ -6195,6 +6246,7 @@ class $a642d735048996f9$export$922081b54f2ab994 extends (0, $f8721861c660dd88$ex
6195
6246
 
6196
6247
 
6197
6248
 
6249
+
6198
6250
  class $a8855257f8bb2b12$export$43682cddead1dd78 extends (0, $f8721861c660dd88$export$2b65d1d97338f32b) {
6199
6251
  async openReleaseCalendarPage() {
6200
6252
  await this.page.goto("./#/releases/calendar");
@@ -6410,6 +6462,62 @@ class $a8855257f8bb2b12$export$43682cddead1dd78 extends (0, $f8721861c660dd88$ex
6410
6462
  await this.page.locator(".release-modal-container").locator(".xl-icon.calendar-icon").click();
6411
6463
  return downloadCount;
6412
6464
  }
6465
+ async openBlackoutPeriod(date) {
6466
+ return new $a8855257f8bb2b12$export$61be9a231bfbe7b9(date, this.page);
6467
+ }
6468
+ }
6469
+ class $a8855257f8bb2b12$export$61be9a231bfbe7b9 extends (0, $f8721861c660dd88$export$2b65d1d97338f32b) {
6470
+ constructor(date, page){
6471
+ super(page);
6472
+ this.dateField = date;
6473
+ }
6474
+ async edit() {
6475
+ await this.findBlackout();
6476
+ await this.page.locator(".blackout-popover .blackout-popover-footer .edit-icon").click();
6477
+ return this;
6478
+ }
6479
+ async delete() {
6480
+ await this.findBlackout();
6481
+ await this.page.locator(".blackout-popover .blackout-popover-footer .delete-icon").click({
6482
+ force: true
6483
+ });
6484
+ await this.page.getByRole("button", {
6485
+ name: "Delete"
6486
+ }).click({
6487
+ force: true
6488
+ });
6489
+ return this;
6490
+ }
6491
+ async findBlackout() {
6492
+ await (0, $kKeXs$playwrighttest.expect)(async ()=>{
6493
+ await this.page.locator(`.tl-blackout-start[data-test-date="${this.dateField}"]`).click({
6494
+ force: true,
6495
+ position: {
6496
+ x: 4,
6497
+ y: 4
6498
+ }
6499
+ });
6500
+ await (0, $kKeXs$playwrighttest.expect)(this.page.locator(".blackout-popover-container")).toBeVisible({
6501
+ timeout: 1000
6502
+ });
6503
+ }).toPass();
6504
+ }
6505
+ // Have to revisit here fix the date selection for different months
6506
+ async setEndDate(date) {
6507
+ const cDate = (0, ($parcel$interopDefault($kKeXs$moment)))(date).format("D");
6508
+ const month = (0, ($parcel$interopDefault($kKeXs$moment)))(date).format("MMMM").toLocaleLowerCase();
6509
+ await this.page.locator(".widget-datetime").filter({
6510
+ hasText: "End date"
6511
+ }).locator(".xl-react-widget-date input").click();
6512
+ await this.page.getByLabel(`${month} ${cDate}`).click();
6513
+ return this;
6514
+ }
6515
+ async save() {
6516
+ await this.page.getByRole("button", {
6517
+ name: "Save"
6518
+ }).click();
6519
+ return this;
6520
+ }
6413
6521
  }
6414
6522
 
6415
6523
 
@@ -9503,9 +9611,12 @@ const $6998c6a53a9eb4fa$export$e0969da9b8fb378d = (0, $kKeXs$playwrighttest.test
9503
9611
  }
9504
9612
  });
9505
9613
  class $6998c6a53a9eb4fa$var$Fixtures {
9614
+ applicationIds = [];
9506
9615
  archivedReleaseIds = [];
9616
+ environmentIds = [];
9507
9617
  releaseIds = [];
9508
9618
  riskProfiles = [];
9619
+ reservationIds = [];
9509
9620
  triggerIds = [];
9510
9621
  configurationIds = [];
9511
9622
  globalVariableIds = [];
@@ -9721,9 +9832,42 @@ class $6998c6a53a9eb4fa$var$Fixtures {
9721
9832
  createDelivery(delivery) {
9722
9833
  return this.doPost("fixtures/deliveries", delivery);
9723
9834
  }
9835
+ async facet(facet) {
9836
+ return this.doPost("fixtures/facets", facet);
9837
+ }
9838
+ async application(application) {
9839
+ const response = await this.doPost("fixtures/application", application);
9840
+ const json = await response.json();
9841
+ this.applicationIds.push(json.id);
9842
+ return json;
9843
+ }
9844
+ async environment(environment) {
9845
+ const response = await this.doPost("fixtures/environment", environment);
9846
+ const json = await response.json();
9847
+ this.environmentIds.push(json.id);
9848
+ return json;
9849
+ }
9850
+ async reservation(reservation) {
9851
+ const response = await this.doPost("fixtures/reservation", reservation);
9852
+ const json = await response.json();
9853
+ this.reservationIds.push(json.id);
9854
+ return json.body;
9855
+ }
9724
9856
  deleteDelivery(delivery) {
9725
9857
  return this.doDelete(`fixtures/deliveries/${delivery}`);
9726
9858
  }
9859
+ async deleteApplication(applicationId) {
9860
+ return this.doDelete(`api/v1/applications/${applicationId}`);
9861
+ }
9862
+ async deleteEnvironment(environmentId) {
9863
+ return this.doDelete(`fixtures/environment/${environmentId}`);
9864
+ }
9865
+ async clearCalendar() {
9866
+ return this.doDelete("fixtures/calendar");
9867
+ }
9868
+ async deleteReservation(id) {
9869
+ return this.doDelete(`fixtures/reservation/${id}`);
9870
+ }
9727
9871
  async cleanAll() {
9728
9872
  for (const username of this.usernames){
9729
9873
  await this.deleteUser(username);
@@ -9735,11 +9879,17 @@ class $6998c6a53a9eb4fa$var$Fixtures {
9735
9879
  for (const confId of this.configurationIds)await this.deleteConfiguration(confId);
9736
9880
  for (const folderId of this.folderIds.reverse())await this.deleteFolder(folderId);
9737
9881
  for (const globalVariableId of this.globalVariableIds)await this.deleteGlobalVariable(globalVariableId);
9882
+ for (const environmentId of this.environmentIds)await this.deleteEnvironment(environmentId);
9883
+ for (const applicationId of this.applicationIds)await this.deleteApplication(applicationId);
9884
+ for (const reservationId of this.reservationIds)await this.deleteReservation(reservationId);
9885
+ this.applicationIds = [];
9886
+ this.configurationIds = [];
9887
+ this.environmentIds = [];
9738
9888
  this.globalVariableIds = [];
9739
9889
  this.folderIds = [];
9740
9890
  this.releaseIds = [];
9891
+ this.reservationIds = [];
9741
9892
  this.triggerIds = [];
9742
- this.configurationIds = [];
9743
9893
  this.usernames = [];
9744
9894
  this.userProfiles = [];
9745
9895
  }
@@ -9767,6 +9917,15 @@ class $6998c6a53a9eb4fa$var$Fixtures {
9767
9917
  const json = await response.json();
9768
9918
  return json.key;
9769
9919
  }
9920
+ async addBlackout(name, from, to) {
9921
+ return this.doPost("calendar/blackouts", {
9922
+ label: name,
9923
+ startDate: from,
9924
+ endDate: to,
9925
+ type: "xlrelease.Blackout",
9926
+ id: null
9927
+ });
9928
+ }
9770
9929
  async addUser(username, password) {
9771
9930
  this.usernames.push(username);
9772
9931
  await this.doPost("fixtures/user", {