@digital-ai/devops-page-object-release 0.0.62 → 0.0.64

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,18 @@
1
1
  # @digital-ai/devops-page-object-release
2
2
 
3
+ ## 0.0.64
4
+
5
+ ### Patch Changes
6
+
7
+ - 1671886: S-121054: Migrated users-scenario script in playwright
8
+ - 035522a: Fixed risks Profile page with method to close notification banner
9
+
10
+ ## 0.0.63
11
+
12
+ ### Patch Changes
13
+
14
+ - 79bf2e3: S-120758 On Task copy only append "copy" when copying to same container
15
+
3
16
  ## 0.0.62
4
17
 
5
18
  ### Patch Changes
package/dist/main.js CHANGED
@@ -4723,7 +4723,7 @@ class $9b9a8c3da392d020$var$Phase extends (0, $f8721861c660dd88$export$2b65d1d97
4723
4723
  async duplicateFromContextMenu(taskTitle) {
4724
4724
  await this.openContextMenuForTask(taskTitle);
4725
4725
  await this.page.locator(".dropdown-menu li").getByText("Duplicate").click();
4726
- await (0, $kKeXs$playwrighttest.expect)(this.page.locator(".task .task-title").getByText(`${taskTitle} (copy)`)).toBeVisible();
4726
+ await (0, $kKeXs$playwrighttest.expect)(this.page.locator(".task .task-title").getByText(`${taskTitle} copy`)).toBeVisible();
4727
4727
  }
4728
4728
  async expectTemplateLabelNotToBePresent() {
4729
4729
  await (0, $kKeXs$playwrighttest.expect)(this.page.locator(".dot-chip").filter({
@@ -6089,7 +6089,9 @@ class $bb5572a48b31014a$export$e2e2e1ffdce20c30 extends (0, $f8721861c660dd88$ex
6089
6089
  this.email = page.locator("#email");
6090
6090
  this.password = page.locator("#password");
6091
6091
  this.cnfPassword = page.locator("#confirmPassword");
6092
- this.saveButton = page.getByTestId("save-btn");
6092
+ this.saveButton = page.getByRole("button", {
6093
+ name: "Save"
6094
+ });
6093
6095
  this.cancelButton = page.getByRole("button", {
6094
6096
  name: "Cancel"
6095
6097
  });
@@ -6109,6 +6111,11 @@ class $bb5572a48b31014a$export$e2e2e1ffdce20c30 extends (0, $f8721861c660dd88$ex
6109
6111
  async setPassword(password) {
6110
6112
  return await this.password.fill(password);
6111
6113
  }
6114
+ async setCurrentPassword(password) {
6115
+ const currentPasswordField = this.page.locator("#previousPassword");
6116
+ await currentPasswordField.fill(password);
6117
+ await (0, $kKeXs$playwrighttest.expect)(currentPasswordField).toHaveValue(password);
6118
+ }
6112
6119
  async setConfirmPassword(cnfPassword) {
6113
6120
  return await this.cnfPassword.fill(cnfPassword);
6114
6121
  }
@@ -6124,6 +6131,24 @@ class $bb5572a48b31014a$export$e2e2e1ffdce20c30 extends (0, $f8721861c660dd88$ex
6124
6131
  async delete() {
6125
6132
  await this.deleteButton.click();
6126
6133
  }
6134
+ async expectSaveButtonEnabled() {
6135
+ await (0, $kKeXs$playwrighttest.expect)(this.saveButton).toBeEnabled();
6136
+ }
6137
+ async expectSaveButtonDisabled() {
6138
+ await (0, $kKeXs$playwrighttest.expect)(this.saveButton).toBeDisabled();
6139
+ }
6140
+ async expectErrorMessage(errorMsg) {
6141
+ await (0, $kKeXs$playwrighttest.expect)(this.page.locator('.dot-dialog-content [role="alert"]')).toContainText(errorMsg);
6142
+ }
6143
+ async expectNewPasswordBoxDisabled() {
6144
+ await (0, $kKeXs$playwrighttest.expect)(this.page.locator("#password")).toBeDisabled();
6145
+ return this;
6146
+ }
6147
+ async expectConfirmPasswordHelperText(text) {
6148
+ const helperText = this.page.locator("#confirmPassword-helper-text");
6149
+ await (0, $kKeXs$playwrighttest.expect)(helperText).toBeVisible();
6150
+ await (0, $kKeXs$playwrighttest.expect)(helperText).toHaveText(text);
6151
+ }
6127
6152
  }
6128
6153
 
6129
6154
 
@@ -6150,6 +6175,7 @@ class $3ceab7c613cabfd6$export$107317390f5aa598 extends (0, $f8721861c660dd88$ex
6150
6175
  }
6151
6176
  async addUser() {
6152
6177
  await this.page.locator(".new-user-btn").click();
6178
+ return this.modal;
6153
6179
  }
6154
6180
  async createUser(username, password) {
6155
6181
  await this.modal.setUserName(username);
@@ -6188,6 +6214,75 @@ class $3ceab7c613cabfd6$export$107317390f5aa598 extends (0, $f8721861c660dd88$ex
6188
6214
  await this.util.openSideNavMenu("Task access");
6189
6215
  await (0, $kKeXs$playwrighttest.expect)(this.page.getByLabel("breadcrumb").getByText("Task access")).toBeVisible();
6190
6216
  }
6217
+ async expectUsers(users) {
6218
+ for (const user of users){
6219
+ await this.filterUser(user.name);
6220
+ const type = user.external ? "External" : "Internal";
6221
+ (0, $kKeXs$playwrighttest.expect)(await this.page.locator(`tr`).filter({
6222
+ hasText: user.name
6223
+ }).count()).toBeGreaterThan(0);
6224
+ (0, $kKeXs$playwrighttest.expect)(await this.page.locator(`tr`).filter({
6225
+ hasText: user.name
6226
+ }).locator(`td`).filter({
6227
+ hasText: type
6228
+ }).count()).toBeGreaterThan(0);
6229
+ if (user.email) (0, $kKeXs$playwrighttest.expect)(await this.page.locator(`tr`).filter({
6230
+ hasText: user.name
6231
+ }).locator(`td`).filter({
6232
+ hasText: user.email
6233
+ }).count()).toBeGreaterThan(0);
6234
+ if (user.fullName) (0, $kKeXs$playwrighttest.expect)(await this.page.locator(`tr`).filter({
6235
+ hasText: user.name
6236
+ }).locator(`td`).filter({
6237
+ hasText: user.fullName
6238
+ }).count()).toBeGreaterThan(0);
6239
+ if (user.externalId) (0, $kKeXs$playwrighttest.expect)(await this.page.locator(`tr`).filter({
6240
+ hasText: user.name
6241
+ }).locator(`td`).filter({
6242
+ hasText: user.externalId
6243
+ }).count()).toBeGreaterThan(0);
6244
+ (0, $kKeXs$playwrighttest.expect)(await this.page.locator(`tr`).filter({
6245
+ hasText: user.name
6246
+ }).locator(`td .icon-delete`).count()).toBeGreaterThan(0);
6247
+ }
6248
+ }
6249
+ async expectNoUser(username) {
6250
+ await this.filterUser(username);
6251
+ await (0, $kKeXs$playwrighttest.expect)(this.page.locator(`p[aria-label=${username}]`)).not.toBeVisible();
6252
+ }
6253
+ async updateUser(username) {
6254
+ await this.filterUser(username);
6255
+ await this.page.getByRole("row", {
6256
+ name: "" + username + ""
6257
+ }).locator(".icon-edit").click();
6258
+ return this.modal;
6259
+ }
6260
+ async sortByColumn(columnName, columnIndex) {
6261
+ const table = this.page.getByTestId("users-table");
6262
+ const column = table.locator(`th[title="${columnName}"]`);
6263
+ const originalData = await table.locator(`td:nth-child(${columnIndex})`).allTextContents();
6264
+ await column.click();
6265
+ const sort = await column.getAttribute("aria-sort");
6266
+ if (sort == "ascending") {
6267
+ const data = await table.locator(`td:nth-child(${columnIndex})`).allTextContents();
6268
+ originalData.sort();
6269
+ (0, $kKeXs$playwrighttest.expect)(data).toEqual(originalData);
6270
+ }
6271
+ if (sort == "descending") {
6272
+ const data = await table.locator(`td:nth-child(${columnIndex})`).allTextContents();
6273
+ (0, $kKeXs$playwrighttest.expect)(data).toEqual(data.sort((a, b)=>a.localeCompare(b)));
6274
+ }
6275
+ return this;
6276
+ }
6277
+ async expectColumnVisible(column, visible = true) {
6278
+ if (visible) await (0, $kKeXs$playwrighttest.expect)(this.page.locator(`thead th`).filter({
6279
+ hasText: column
6280
+ })).toBeVisible();
6281
+ else await (0, $kKeXs$playwrighttest.expect)(this.page.locator(`thead th`).filter({
6282
+ hasText: column
6283
+ })).toHaveCount(0);
6284
+ return this;
6285
+ }
6191
6286
  }
6192
6287
 
6193
6288
 
@@ -8319,6 +8414,7 @@ class $ea5452748687c9a2$export$539d82a5d70c4909 extends (0, $f8721861c660dd88$ex
8319
8414
  await (0, $kKeXs$playwrighttest.expect)(this.page.locator(".success").filter({
8320
8415
  hasText: "Risk Profile Created Successfully"
8321
8416
  })).toBeVisible();
8417
+ await this.closeNotificationBanner();
8322
8418
  }
8323
8419
  async copyRiskProfile(title) {
8324
8420
  await this.page.locator(".risk-profile .data-row").filter({
@@ -8335,6 +8431,7 @@ class $ea5452748687c9a2$export$539d82a5d70c4909 extends (0, $f8721861c660dd88$ex
8335
8431
  await (0, $kKeXs$playwrighttest.expect)(this.page.locator(".success").filter({
8336
8432
  hasText: "Risk Profile Updated Successfully"
8337
8433
  })).toBeVisible();
8434
+ await this.closeNotificationBanner();
8338
8435
  }
8339
8436
  async filter(filterText) {
8340
8437
  await this.page.locator("#risk-profile-filter").waitFor({
@@ -8354,6 +8451,10 @@ class $ea5452748687c9a2$export$539d82a5d70c4909 extends (0, $f8721861c660dd88$ex
8354
8451
  if (present) await (0, $kKeXs$playwrighttest.expect)(locator).toBeVisible();
8355
8452
  else await (0, $kKeXs$playwrighttest.expect)(locator).not.toBeVisible();
8356
8453
  }
8454
+ async closeNotificationBanner() {
8455
+ const closeIcon = this.page.getByTestId(`CloseIcon`);
8456
+ if (await closeIcon.isVisible()) await closeIcon.click();
8457
+ }
8357
8458
  }
8358
8459
  class $ea5452748687c9a2$var$RisksProfilePage extends (0, $f8721861c660dd88$export$2b65d1d97338f32b) {
8359
8460
  async shouldBeEditable(editable) {
@@ -9617,6 +9718,14 @@ class $258749e0671c845a$export$f14c0e3f98d164c0 extends (0, $f8721861c660dd88$ex
9617
9718
  state: "visible"
9618
9719
  });
9619
9720
  }
9721
+ async expectLoginPage() {
9722
+ await (0, $kKeXs$playwrighttest.expect)(this.page).toHaveURL("./#/login");
9723
+ await (0, $kKeXs$playwrighttest.expect)(this.page.getByPlaceholder("User")).toBeVisible();
9724
+ await (0, $kKeXs$playwrighttest.expect)(this.page.getByPlaceholder("Password")).toBeVisible();
9725
+ await (0, $kKeXs$playwrighttest.expect)(this.page.getByRole("button", {
9726
+ name: "Log in"
9727
+ })).toBeVisible();
9728
+ }
9620
9729
  }
9621
9730
 
9622
9731
 
@@ -10463,6 +10572,7 @@ const $6998c6a53a9eb4fa$export$e0969da9b8fb378d = (0, $kKeXs$playwrighttest.test
10463
10572
  class $6998c6a53a9eb4fa$var$Fixtures {
10464
10573
  applicationIds = [];
10465
10574
  archivedReleaseIds = [];
10575
+ ciIds = [];
10466
10576
  environmentIds = [];
10467
10577
  environmentStageIds = [];
10468
10578
  releaseIds = [];
@@ -10501,6 +10611,9 @@ class $6998c6a53a9eb4fa$var$Fixtures {
10501
10611
  ci
10502
10612
  ]);
10503
10613
  }
10614
+ async deleteCI(id) {
10615
+ return this.doDelete(`fixtures/configuration/${id}`);
10616
+ }
10504
10617
  getParentId(id) {
10505
10618
  return id.substring(0, id.lastIndexOf("/"));
10506
10619
  }
@@ -10738,6 +10851,7 @@ class $6998c6a53a9eb4fa$var$Fixtures {
10738
10851
  for (const applicationId of this.applicationIds)await this.deleteApplication(applicationId);
10739
10852
  for (const environmentId of this.environmentIds)await this.deleteEnvironment(environmentId);
10740
10853
  for (const environmentStageId of this.environmentStageIds)await this.deleteEnvironmentStage(environmentStageId);
10854
+ for (const ci of this.ciIds)await this.deleteCI(ci);
10741
10855
  this.applicationIds = [];
10742
10856
  this.configurationIds = [];
10743
10857
  this.environmentIds = [];
@@ -10749,6 +10863,7 @@ class $6998c6a53a9eb4fa$var$Fixtures {
10749
10863
  this.triggerIds = [];
10750
10864
  this.usernames = [];
10751
10865
  this.userProfiles = [];
10866
+ this.ciIds = [];
10752
10867
  }
10753
10868
  async addJiraTask() {
10754
10869
  const data = {
@@ -10798,6 +10913,9 @@ class $6998c6a53a9eb4fa$var$Fixtures {
10798
10913
  this.userProfiles.push(profile.canonicalId);
10799
10914
  await this.doPost("fixtures/userProfile", profile);
10800
10915
  }
10916
+ async resetAdminProfile() {
10917
+ return this.resetUserProfile("admin", "Release Administrator");
10918
+ }
10801
10919
  async resetUserProfile(username, fullName) {
10802
10920
  this.usernames.push(username);
10803
10921
  return this.updateProfile({