@digital-ai/devops-page-object-release 0.0.63 → 0.0.65

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.65
4
+
5
+ ### Patch Changes
6
+
7
+ - 9a0bc64: S-121552: page-objects updated for user-profile-scenario
8
+
9
+ ## 0.0.64
10
+
11
+ ### Patch Changes
12
+
13
+ - 1671886: S-121054: Migrated users-scenario script in playwright
14
+ - 035522a: Fixed risks Profile page with method to close notification banner
15
+
3
16
  ## 0.0.63
4
17
 
5
18
  ### Patch Changes
package/dist/main.js CHANGED
@@ -6036,6 +6036,62 @@ class $010122e1d9b28b80$export$3cf9c90f870f31bd extends (0, $f8721861c660dd88$ex
6036
6036
  async openAccessToken() {
6037
6037
  await this.util.openSideNavMenu("Access tokens");
6038
6038
  }
6039
+ async expectEmailDefined(email) {
6040
+ await (0, $kKeXs$playwrighttest.expect)(this.page.locator("#email")).toHaveValue(email);
6041
+ return this;
6042
+ }
6043
+ async expectNoEmailDefined() {
6044
+ return this.expectEmailDefined("");
6045
+ }
6046
+ async expectFullNameDefined(fullName) {
6047
+ await (0, $kKeXs$playwrighttest.expect)(this.page.locator("#full-name")).toHaveValue(fullName);
6048
+ return this;
6049
+ }
6050
+ async expectNoFullNameDefined() {
6051
+ return this.expectFullNameDefined("");
6052
+ }
6053
+ async expectPasswordNotToBe(password) {
6054
+ await (0, $kKeXs$playwrighttest.expect)(this.page.locator('input[data-test="password-input"]')).not.toHaveValue(password);
6055
+ return this;
6056
+ }
6057
+ async expectDateFormatToBe(dateFormat) {
6058
+ await (0, $kKeXs$playwrighttest.expect)(this.page.locator('select[ng-model="$ctrl.profile.dateFormat"]')).toHaveValue(dateFormat);
6059
+ return this;
6060
+ }
6061
+ async expectTimeFormatToBe(timeFormat) {
6062
+ await (0, $kKeXs$playwrighttest.expect)(this.page.locator('select[ng-model="$ctrl.profile.timeFormat"]')).toHaveValue(timeFormat);
6063
+ return this;
6064
+ }
6065
+ async expectFirstDayOfWeekToBe(firstDayOfWeek) {
6066
+ await (0, $kKeXs$playwrighttest.expect)(this.page.locator('select[ng-model="$ctrl.profile.firstDayOfWeek"]')).toHaveValue(firstDayOfWeek);
6067
+ return this;
6068
+ }
6069
+ async save() {
6070
+ await this.page.locator('action-toolbar button:has-text("Save"):enabled').click();
6071
+ await this.page.locator(".saved-text").waitFor({
6072
+ state: "visible"
6073
+ });
6074
+ return this;
6075
+ }
6076
+ async setEmail(email) {
6077
+ await this.page.locator("#email").fill(email);
6078
+ return this.save();
6079
+ }
6080
+ async setFullName(fullName) {
6081
+ await this.page.locator("#full-name").fill(fullName);
6082
+ return this.save();
6083
+ }
6084
+ async setPassword(previousPassword, password) {
6085
+ await this.page.locator("#previousPassword").fill(previousPassword);
6086
+ await this.page.locator('input[data-test="password-input"]').fill(password);
6087
+ await this.page.locator("#passwordConfirmation").fill(password);
6088
+ return this.save();
6089
+ }
6090
+ async refresh() {
6091
+ await this.page.reload();
6092
+ await this.page.waitForSelector("#profileForm");
6093
+ return this;
6094
+ }
6039
6095
  async editUserProfile(email) {
6040
6096
  await this.page.getByLabel("Email address").click();
6041
6097
  await this.page.getByLabel("Email address").fill(email);
@@ -6089,7 +6145,9 @@ class $bb5572a48b31014a$export$e2e2e1ffdce20c30 extends (0, $f8721861c660dd88$ex
6089
6145
  this.email = page.locator("#email");
6090
6146
  this.password = page.locator("#password");
6091
6147
  this.cnfPassword = page.locator("#confirmPassword");
6092
- this.saveButton = page.getByTestId("save-btn");
6148
+ this.saveButton = page.getByRole("button", {
6149
+ name: "Save"
6150
+ });
6093
6151
  this.cancelButton = page.getByRole("button", {
6094
6152
  name: "Cancel"
6095
6153
  });
@@ -6109,6 +6167,11 @@ class $bb5572a48b31014a$export$e2e2e1ffdce20c30 extends (0, $f8721861c660dd88$ex
6109
6167
  async setPassword(password) {
6110
6168
  return await this.password.fill(password);
6111
6169
  }
6170
+ async setCurrentPassword(password) {
6171
+ const currentPasswordField = this.page.locator("#previousPassword");
6172
+ await currentPasswordField.fill(password);
6173
+ await (0, $kKeXs$playwrighttest.expect)(currentPasswordField).toHaveValue(password);
6174
+ }
6112
6175
  async setConfirmPassword(cnfPassword) {
6113
6176
  return await this.cnfPassword.fill(cnfPassword);
6114
6177
  }
@@ -6124,6 +6187,24 @@ class $bb5572a48b31014a$export$e2e2e1ffdce20c30 extends (0, $f8721861c660dd88$ex
6124
6187
  async delete() {
6125
6188
  await this.deleteButton.click();
6126
6189
  }
6190
+ async expectSaveButtonEnabled() {
6191
+ await (0, $kKeXs$playwrighttest.expect)(this.saveButton).toBeEnabled();
6192
+ }
6193
+ async expectSaveButtonDisabled() {
6194
+ await (0, $kKeXs$playwrighttest.expect)(this.saveButton).toBeDisabled();
6195
+ }
6196
+ async expectErrorMessage(errorMsg) {
6197
+ await (0, $kKeXs$playwrighttest.expect)(this.page.locator('.dot-dialog-content [role="alert"]')).toContainText(errorMsg);
6198
+ }
6199
+ async expectNewPasswordBoxDisabled() {
6200
+ await (0, $kKeXs$playwrighttest.expect)(this.page.locator("#password")).toBeDisabled();
6201
+ return this;
6202
+ }
6203
+ async expectConfirmPasswordHelperText(text) {
6204
+ const helperText = this.page.locator("#confirmPassword-helper-text");
6205
+ await (0, $kKeXs$playwrighttest.expect)(helperText).toBeVisible();
6206
+ await (0, $kKeXs$playwrighttest.expect)(helperText).toHaveText(text);
6207
+ }
6127
6208
  }
6128
6209
 
6129
6210
 
@@ -6150,6 +6231,7 @@ class $3ceab7c613cabfd6$export$107317390f5aa598 extends (0, $f8721861c660dd88$ex
6150
6231
  }
6151
6232
  async addUser() {
6152
6233
  await this.page.locator(".new-user-btn").click();
6234
+ return this.modal;
6153
6235
  }
6154
6236
  async createUser(username, password) {
6155
6237
  await this.modal.setUserName(username);
@@ -6188,6 +6270,75 @@ class $3ceab7c613cabfd6$export$107317390f5aa598 extends (0, $f8721861c660dd88$ex
6188
6270
  await this.util.openSideNavMenu("Task access");
6189
6271
  await (0, $kKeXs$playwrighttest.expect)(this.page.getByLabel("breadcrumb").getByText("Task access")).toBeVisible();
6190
6272
  }
6273
+ async expectUsers(users) {
6274
+ for (const user of users){
6275
+ await this.filterUser(user.name);
6276
+ const type = user.external ? "External" : "Internal";
6277
+ (0, $kKeXs$playwrighttest.expect)(await this.page.locator(`tr`).filter({
6278
+ hasText: user.name
6279
+ }).count()).toBeGreaterThan(0);
6280
+ (0, $kKeXs$playwrighttest.expect)(await this.page.locator(`tr`).filter({
6281
+ hasText: user.name
6282
+ }).locator(`td`).filter({
6283
+ hasText: type
6284
+ }).count()).toBeGreaterThan(0);
6285
+ if (user.email) (0, $kKeXs$playwrighttest.expect)(await this.page.locator(`tr`).filter({
6286
+ hasText: user.name
6287
+ }).locator(`td`).filter({
6288
+ hasText: user.email
6289
+ }).count()).toBeGreaterThan(0);
6290
+ if (user.fullName) (0, $kKeXs$playwrighttest.expect)(await this.page.locator(`tr`).filter({
6291
+ hasText: user.name
6292
+ }).locator(`td`).filter({
6293
+ hasText: user.fullName
6294
+ }).count()).toBeGreaterThan(0);
6295
+ if (user.externalId) (0, $kKeXs$playwrighttest.expect)(await this.page.locator(`tr`).filter({
6296
+ hasText: user.name
6297
+ }).locator(`td`).filter({
6298
+ hasText: user.externalId
6299
+ }).count()).toBeGreaterThan(0);
6300
+ (0, $kKeXs$playwrighttest.expect)(await this.page.locator(`tr`).filter({
6301
+ hasText: user.name
6302
+ }).locator(`td .icon-delete`).count()).toBeGreaterThan(0);
6303
+ }
6304
+ }
6305
+ async expectNoUser(username) {
6306
+ await this.filterUser(username);
6307
+ await (0, $kKeXs$playwrighttest.expect)(this.page.locator(`p[aria-label=${username}]`)).not.toBeVisible();
6308
+ }
6309
+ async updateUser(username) {
6310
+ await this.filterUser(username);
6311
+ await this.page.getByRole("row", {
6312
+ name: "" + username + ""
6313
+ }).locator(".icon-edit").click();
6314
+ return this.modal;
6315
+ }
6316
+ async sortByColumn(columnName, columnIndex) {
6317
+ const table = this.page.getByTestId("users-table");
6318
+ const column = table.locator(`th[title="${columnName}"]`);
6319
+ const originalData = await table.locator(`td:nth-child(${columnIndex})`).allTextContents();
6320
+ await column.click();
6321
+ const sort = await column.getAttribute("aria-sort");
6322
+ if (sort == "ascending") {
6323
+ const data = await table.locator(`td:nth-child(${columnIndex})`).allTextContents();
6324
+ originalData.sort();
6325
+ (0, $kKeXs$playwrighttest.expect)(data).toEqual(originalData);
6326
+ }
6327
+ if (sort == "descending") {
6328
+ const data = await table.locator(`td:nth-child(${columnIndex})`).allTextContents();
6329
+ (0, $kKeXs$playwrighttest.expect)(data).toEqual(data.sort((a, b)=>a.localeCompare(b)));
6330
+ }
6331
+ return this;
6332
+ }
6333
+ async expectColumnVisible(column, visible = true) {
6334
+ if (visible) await (0, $kKeXs$playwrighttest.expect)(this.page.locator(`thead th`).filter({
6335
+ hasText: column
6336
+ })).toBeVisible();
6337
+ else await (0, $kKeXs$playwrighttest.expect)(this.page.locator(`thead th`).filter({
6338
+ hasText: column
6339
+ })).toHaveCount(0);
6340
+ return this;
6341
+ }
6191
6342
  }
6192
6343
 
6193
6344
 
@@ -8319,6 +8470,7 @@ class $ea5452748687c9a2$export$539d82a5d70c4909 extends (0, $f8721861c660dd88$ex
8319
8470
  await (0, $kKeXs$playwrighttest.expect)(this.page.locator(".success").filter({
8320
8471
  hasText: "Risk Profile Created Successfully"
8321
8472
  })).toBeVisible();
8473
+ await this.closeNotificationBanner();
8322
8474
  }
8323
8475
  async copyRiskProfile(title) {
8324
8476
  await this.page.locator(".risk-profile .data-row").filter({
@@ -8335,6 +8487,7 @@ class $ea5452748687c9a2$export$539d82a5d70c4909 extends (0, $f8721861c660dd88$ex
8335
8487
  await (0, $kKeXs$playwrighttest.expect)(this.page.locator(".success").filter({
8336
8488
  hasText: "Risk Profile Updated Successfully"
8337
8489
  })).toBeVisible();
8490
+ await this.closeNotificationBanner();
8338
8491
  }
8339
8492
  async filter(filterText) {
8340
8493
  await this.page.locator("#risk-profile-filter").waitFor({
@@ -8354,6 +8507,10 @@ class $ea5452748687c9a2$export$539d82a5d70c4909 extends (0, $f8721861c660dd88$ex
8354
8507
  if (present) await (0, $kKeXs$playwrighttest.expect)(locator).toBeVisible();
8355
8508
  else await (0, $kKeXs$playwrighttest.expect)(locator).not.toBeVisible();
8356
8509
  }
8510
+ async closeNotificationBanner() {
8511
+ const closeIcon = this.page.getByTestId(`CloseIcon`);
8512
+ if (await closeIcon.isVisible()) await closeIcon.click();
8513
+ }
8357
8514
  }
8358
8515
  class $ea5452748687c9a2$var$RisksProfilePage extends (0, $f8721861c660dd88$export$2b65d1d97338f32b) {
8359
8516
  async shouldBeEditable(editable) {
@@ -9410,6 +9567,10 @@ class $4ef41cf96a5fae4c$export$b8a61e5c71402559 {
9410
9567
  await this.page.waitForSelector("#releases-content");
9411
9568
  return new (0, $9058d40a81bdb1f5$export$b453f08936c58edb)(this.page);
9412
9569
  }
9570
+ async openProfilePage() {
9571
+ await this.page.goto(`./#/profile`);
9572
+ return new (0, $010122e1d9b28b80$export$3cf9c90f870f31bd)(this.page);
9573
+ }
9413
9574
  async openVariablesOnReleasePage(releaseId) {
9414
9575
  await this.page.goto(`./#/releases/${releaseId}/variables`);
9415
9576
  await this.page.waitForSelector("#release-variables");
@@ -9617,6 +9778,14 @@ class $258749e0671c845a$export$f14c0e3f98d164c0 extends (0, $f8721861c660dd88$ex
9617
9778
  state: "visible"
9618
9779
  });
9619
9780
  }
9781
+ async expectLoginPage() {
9782
+ await (0, $kKeXs$playwrighttest.expect)(this.page).toHaveURL("./#/login");
9783
+ await (0, $kKeXs$playwrighttest.expect)(this.page.getByPlaceholder("User")).toBeVisible();
9784
+ await (0, $kKeXs$playwrighttest.expect)(this.page.getByPlaceholder("Password")).toBeVisible();
9785
+ await (0, $kKeXs$playwrighttest.expect)(this.page.getByRole("button", {
9786
+ name: "Log in"
9787
+ })).toBeVisible();
9788
+ }
9620
9789
  }
9621
9790
 
9622
9791
 
@@ -10463,6 +10632,7 @@ const $6998c6a53a9eb4fa$export$e0969da9b8fb378d = (0, $kKeXs$playwrighttest.test
10463
10632
  class $6998c6a53a9eb4fa$var$Fixtures {
10464
10633
  applicationIds = [];
10465
10634
  archivedReleaseIds = [];
10635
+ ciIds = [];
10466
10636
  environmentIds = [];
10467
10637
  environmentStageIds = [];
10468
10638
  releaseIds = [];
@@ -10501,6 +10671,9 @@ class $6998c6a53a9eb4fa$var$Fixtures {
10501
10671
  ci
10502
10672
  ]);
10503
10673
  }
10674
+ async deleteCI(id) {
10675
+ return this.doDelete(`fixtures/configuration/${id}`);
10676
+ }
10504
10677
  getParentId(id) {
10505
10678
  return id.substring(0, id.lastIndexOf("/"));
10506
10679
  }
@@ -10738,6 +10911,7 @@ class $6998c6a53a9eb4fa$var$Fixtures {
10738
10911
  for (const applicationId of this.applicationIds)await this.deleteApplication(applicationId);
10739
10912
  for (const environmentId of this.environmentIds)await this.deleteEnvironment(environmentId);
10740
10913
  for (const environmentStageId of this.environmentStageIds)await this.deleteEnvironmentStage(environmentStageId);
10914
+ for (const ci of this.ciIds)await this.deleteCI(ci);
10741
10915
  this.applicationIds = [];
10742
10916
  this.configurationIds = [];
10743
10917
  this.environmentIds = [];
@@ -10749,6 +10923,7 @@ class $6998c6a53a9eb4fa$var$Fixtures {
10749
10923
  this.triggerIds = [];
10750
10924
  this.usernames = [];
10751
10925
  this.userProfiles = [];
10926
+ this.ciIds = [];
10752
10927
  }
10753
10928
  async addJiraTask() {
10754
10929
  const data = {
@@ -10798,6 +10973,9 @@ class $6998c6a53a9eb4fa$var$Fixtures {
10798
10973
  this.userProfiles.push(profile.canonicalId);
10799
10974
  await this.doPost("fixtures/userProfile", profile);
10800
10975
  }
10976
+ async resetAdminProfile() {
10977
+ return this.resetUserProfile("admin", "Release Administrator");
10978
+ }
10801
10979
  async resetUserProfile(username, fullName) {
10802
10980
  this.usernames.push(username);
10803
10981
  return this.updateProfile({