@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/dist/module.js CHANGED
@@ -5100,6 +5100,62 @@ class $a5932af323ac015a$export$3cf9c90f870f31bd extends (0, $9626bc9256ce31f7$ex
5100
5100
  async openAccessToken() {
5101
5101
  await this.util.openSideNavMenu("Access tokens");
5102
5102
  }
5103
+ async expectEmailDefined(email) {
5104
+ await (0, $hOLA6$expect)(this.page.locator("#email")).toHaveValue(email);
5105
+ return this;
5106
+ }
5107
+ async expectNoEmailDefined() {
5108
+ return this.expectEmailDefined("");
5109
+ }
5110
+ async expectFullNameDefined(fullName) {
5111
+ await (0, $hOLA6$expect)(this.page.locator("#full-name")).toHaveValue(fullName);
5112
+ return this;
5113
+ }
5114
+ async expectNoFullNameDefined() {
5115
+ return this.expectFullNameDefined("");
5116
+ }
5117
+ async expectPasswordNotToBe(password) {
5118
+ await (0, $hOLA6$expect)(this.page.locator('input[data-test="password-input"]')).not.toHaveValue(password);
5119
+ return this;
5120
+ }
5121
+ async expectDateFormatToBe(dateFormat) {
5122
+ await (0, $hOLA6$expect)(this.page.locator('select[ng-model="$ctrl.profile.dateFormat"]')).toHaveValue(dateFormat);
5123
+ return this;
5124
+ }
5125
+ async expectTimeFormatToBe(timeFormat) {
5126
+ await (0, $hOLA6$expect)(this.page.locator('select[ng-model="$ctrl.profile.timeFormat"]')).toHaveValue(timeFormat);
5127
+ return this;
5128
+ }
5129
+ async expectFirstDayOfWeekToBe(firstDayOfWeek) {
5130
+ await (0, $hOLA6$expect)(this.page.locator('select[ng-model="$ctrl.profile.firstDayOfWeek"]')).toHaveValue(firstDayOfWeek);
5131
+ return this;
5132
+ }
5133
+ async save() {
5134
+ await this.page.locator('action-toolbar button:has-text("Save"):enabled').click();
5135
+ await this.page.locator(".saved-text").waitFor({
5136
+ state: "visible"
5137
+ });
5138
+ return this;
5139
+ }
5140
+ async setEmail(email) {
5141
+ await this.page.locator("#email").fill(email);
5142
+ return this.save();
5143
+ }
5144
+ async setFullName(fullName) {
5145
+ await this.page.locator("#full-name").fill(fullName);
5146
+ return this.save();
5147
+ }
5148
+ async setPassword(previousPassword, password) {
5149
+ await this.page.locator("#previousPassword").fill(previousPassword);
5150
+ await this.page.locator('input[data-test="password-input"]').fill(password);
5151
+ await this.page.locator("#passwordConfirmation").fill(password);
5152
+ return this.save();
5153
+ }
5154
+ async refresh() {
5155
+ await this.page.reload();
5156
+ await this.page.waitForSelector("#profileForm");
5157
+ return this;
5158
+ }
5103
5159
  async editUserProfile(email) {
5104
5160
  await this.page.getByLabel("Email address").click();
5105
5161
  await this.page.getByLabel("Email address").fill(email);
@@ -5153,7 +5209,9 @@ class $21185a378c23589e$export$e2e2e1ffdce20c30 extends (0, $9626bc9256ce31f7$ex
5153
5209
  this.email = page.locator("#email");
5154
5210
  this.password = page.locator("#password");
5155
5211
  this.cnfPassword = page.locator("#confirmPassword");
5156
- this.saveButton = page.getByTestId("save-btn");
5212
+ this.saveButton = page.getByRole("button", {
5213
+ name: "Save"
5214
+ });
5157
5215
  this.cancelButton = page.getByRole("button", {
5158
5216
  name: "Cancel"
5159
5217
  });
@@ -5173,6 +5231,11 @@ class $21185a378c23589e$export$e2e2e1ffdce20c30 extends (0, $9626bc9256ce31f7$ex
5173
5231
  async setPassword(password) {
5174
5232
  return await this.password.fill(password);
5175
5233
  }
5234
+ async setCurrentPassword(password) {
5235
+ const currentPasswordField = this.page.locator("#previousPassword");
5236
+ await currentPasswordField.fill(password);
5237
+ await (0, $hOLA6$expect)(currentPasswordField).toHaveValue(password);
5238
+ }
5176
5239
  async setConfirmPassword(cnfPassword) {
5177
5240
  return await this.cnfPassword.fill(cnfPassword);
5178
5241
  }
@@ -5188,6 +5251,24 @@ class $21185a378c23589e$export$e2e2e1ffdce20c30 extends (0, $9626bc9256ce31f7$ex
5188
5251
  async delete() {
5189
5252
  await this.deleteButton.click();
5190
5253
  }
5254
+ async expectSaveButtonEnabled() {
5255
+ await (0, $hOLA6$expect)(this.saveButton).toBeEnabled();
5256
+ }
5257
+ async expectSaveButtonDisabled() {
5258
+ await (0, $hOLA6$expect)(this.saveButton).toBeDisabled();
5259
+ }
5260
+ async expectErrorMessage(errorMsg) {
5261
+ await (0, $hOLA6$expect)(this.page.locator('.dot-dialog-content [role="alert"]')).toContainText(errorMsg);
5262
+ }
5263
+ async expectNewPasswordBoxDisabled() {
5264
+ await (0, $hOLA6$expect)(this.page.locator("#password")).toBeDisabled();
5265
+ return this;
5266
+ }
5267
+ async expectConfirmPasswordHelperText(text) {
5268
+ const helperText = this.page.locator("#confirmPassword-helper-text");
5269
+ await (0, $hOLA6$expect)(helperText).toBeVisible();
5270
+ await (0, $hOLA6$expect)(helperText).toHaveText(text);
5271
+ }
5191
5272
  }
5192
5273
 
5193
5274
 
@@ -5214,6 +5295,7 @@ class $2cb6a6ac6b17e85f$export$107317390f5aa598 extends (0, $9626bc9256ce31f7$ex
5214
5295
  }
5215
5296
  async addUser() {
5216
5297
  await this.page.locator(".new-user-btn").click();
5298
+ return this.modal;
5217
5299
  }
5218
5300
  async createUser(username, password) {
5219
5301
  await this.modal.setUserName(username);
@@ -5252,6 +5334,75 @@ class $2cb6a6ac6b17e85f$export$107317390f5aa598 extends (0, $9626bc9256ce31f7$ex
5252
5334
  await this.util.openSideNavMenu("Task access");
5253
5335
  await (0, $hOLA6$expect)(this.page.getByLabel("breadcrumb").getByText("Task access")).toBeVisible();
5254
5336
  }
5337
+ async expectUsers(users) {
5338
+ for (const user of users){
5339
+ await this.filterUser(user.name);
5340
+ const type = user.external ? "External" : "Internal";
5341
+ (0, $hOLA6$expect)(await this.page.locator(`tr`).filter({
5342
+ hasText: user.name
5343
+ }).count()).toBeGreaterThan(0);
5344
+ (0, $hOLA6$expect)(await this.page.locator(`tr`).filter({
5345
+ hasText: user.name
5346
+ }).locator(`td`).filter({
5347
+ hasText: type
5348
+ }).count()).toBeGreaterThan(0);
5349
+ if (user.email) (0, $hOLA6$expect)(await this.page.locator(`tr`).filter({
5350
+ hasText: user.name
5351
+ }).locator(`td`).filter({
5352
+ hasText: user.email
5353
+ }).count()).toBeGreaterThan(0);
5354
+ if (user.fullName) (0, $hOLA6$expect)(await this.page.locator(`tr`).filter({
5355
+ hasText: user.name
5356
+ }).locator(`td`).filter({
5357
+ hasText: user.fullName
5358
+ }).count()).toBeGreaterThan(0);
5359
+ if (user.externalId) (0, $hOLA6$expect)(await this.page.locator(`tr`).filter({
5360
+ hasText: user.name
5361
+ }).locator(`td`).filter({
5362
+ hasText: user.externalId
5363
+ }).count()).toBeGreaterThan(0);
5364
+ (0, $hOLA6$expect)(await this.page.locator(`tr`).filter({
5365
+ hasText: user.name
5366
+ }).locator(`td .icon-delete`).count()).toBeGreaterThan(0);
5367
+ }
5368
+ }
5369
+ async expectNoUser(username) {
5370
+ await this.filterUser(username);
5371
+ await (0, $hOLA6$expect)(this.page.locator(`p[aria-label=${username}]`)).not.toBeVisible();
5372
+ }
5373
+ async updateUser(username) {
5374
+ await this.filterUser(username);
5375
+ await this.page.getByRole("row", {
5376
+ name: "" + username + ""
5377
+ }).locator(".icon-edit").click();
5378
+ return this.modal;
5379
+ }
5380
+ async sortByColumn(columnName, columnIndex) {
5381
+ const table = this.page.getByTestId("users-table");
5382
+ const column = table.locator(`th[title="${columnName}"]`);
5383
+ const originalData = await table.locator(`td:nth-child(${columnIndex})`).allTextContents();
5384
+ await column.click();
5385
+ const sort = await column.getAttribute("aria-sort");
5386
+ if (sort == "ascending") {
5387
+ const data = await table.locator(`td:nth-child(${columnIndex})`).allTextContents();
5388
+ originalData.sort();
5389
+ (0, $hOLA6$expect)(data).toEqual(originalData);
5390
+ }
5391
+ if (sort == "descending") {
5392
+ const data = await table.locator(`td:nth-child(${columnIndex})`).allTextContents();
5393
+ (0, $hOLA6$expect)(data).toEqual(data.sort((a, b)=>a.localeCompare(b)));
5394
+ }
5395
+ return this;
5396
+ }
5397
+ async expectColumnVisible(column, visible = true) {
5398
+ if (visible) await (0, $hOLA6$expect)(this.page.locator(`thead th`).filter({
5399
+ hasText: column
5400
+ })).toBeVisible();
5401
+ else await (0, $hOLA6$expect)(this.page.locator(`thead th`).filter({
5402
+ hasText: column
5403
+ })).toHaveCount(0);
5404
+ return this;
5405
+ }
5255
5406
  }
5256
5407
 
5257
5408
 
@@ -7383,6 +7534,7 @@ class $a4ba753fcd18eb4a$export$539d82a5d70c4909 extends (0, $9626bc9256ce31f7$ex
7383
7534
  await (0, $hOLA6$expect)(this.page.locator(".success").filter({
7384
7535
  hasText: "Risk Profile Created Successfully"
7385
7536
  })).toBeVisible();
7537
+ await this.closeNotificationBanner();
7386
7538
  }
7387
7539
  async copyRiskProfile(title) {
7388
7540
  await this.page.locator(".risk-profile .data-row").filter({
@@ -7399,6 +7551,7 @@ class $a4ba753fcd18eb4a$export$539d82a5d70c4909 extends (0, $9626bc9256ce31f7$ex
7399
7551
  await (0, $hOLA6$expect)(this.page.locator(".success").filter({
7400
7552
  hasText: "Risk Profile Updated Successfully"
7401
7553
  })).toBeVisible();
7554
+ await this.closeNotificationBanner();
7402
7555
  }
7403
7556
  async filter(filterText) {
7404
7557
  await this.page.locator("#risk-profile-filter").waitFor({
@@ -7418,6 +7571,10 @@ class $a4ba753fcd18eb4a$export$539d82a5d70c4909 extends (0, $9626bc9256ce31f7$ex
7418
7571
  if (present) await (0, $hOLA6$expect)(locator).toBeVisible();
7419
7572
  else await (0, $hOLA6$expect)(locator).not.toBeVisible();
7420
7573
  }
7574
+ async closeNotificationBanner() {
7575
+ const closeIcon = this.page.getByTestId(`CloseIcon`);
7576
+ if (await closeIcon.isVisible()) await closeIcon.click();
7577
+ }
7421
7578
  }
7422
7579
  class $a4ba753fcd18eb4a$var$RisksProfilePage extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
7423
7580
  async shouldBeEditable(editable) {
@@ -8474,6 +8631,10 @@ class $e72552cbf941ecfa$export$b8a61e5c71402559 {
8474
8631
  await this.page.waitForSelector("#releases-content");
8475
8632
  return new (0, $50c91328c9110668$export$b453f08936c58edb)(this.page);
8476
8633
  }
8634
+ async openProfilePage() {
8635
+ await this.page.goto(`./#/profile`);
8636
+ return new (0, $a5932af323ac015a$export$3cf9c90f870f31bd)(this.page);
8637
+ }
8477
8638
  async openVariablesOnReleasePage(releaseId) {
8478
8639
  await this.page.goto(`./#/releases/${releaseId}/variables`);
8479
8640
  await this.page.waitForSelector("#release-variables");
@@ -8681,6 +8842,14 @@ class $4444bee76761dfb1$export$f14c0e3f98d164c0 extends (0, $9626bc9256ce31f7$ex
8681
8842
  state: "visible"
8682
8843
  });
8683
8844
  }
8845
+ async expectLoginPage() {
8846
+ await (0, $hOLA6$expect)(this.page).toHaveURL("./#/login");
8847
+ await (0, $hOLA6$expect)(this.page.getByPlaceholder("User")).toBeVisible();
8848
+ await (0, $hOLA6$expect)(this.page.getByPlaceholder("Password")).toBeVisible();
8849
+ await (0, $hOLA6$expect)(this.page.getByRole("button", {
8850
+ name: "Log in"
8851
+ })).toBeVisible();
8852
+ }
8684
8853
  }
8685
8854
 
8686
8855
 
@@ -8853,6 +9022,7 @@ const $80c3ae34677b4324$export$e0969da9b8fb378d = (0, $hOLA6$test).extend({
8853
9022
  class $80c3ae34677b4324$var$Fixtures {
8854
9023
  applicationIds = [];
8855
9024
  archivedReleaseIds = [];
9025
+ ciIds = [];
8856
9026
  environmentIds = [];
8857
9027
  environmentStageIds = [];
8858
9028
  releaseIds = [];
@@ -8891,6 +9061,9 @@ class $80c3ae34677b4324$var$Fixtures {
8891
9061
  ci
8892
9062
  ]);
8893
9063
  }
9064
+ async deleteCI(id) {
9065
+ return this.doDelete(`fixtures/configuration/${id}`);
9066
+ }
8894
9067
  getParentId(id) {
8895
9068
  return id.substring(0, id.lastIndexOf("/"));
8896
9069
  }
@@ -9128,6 +9301,7 @@ class $80c3ae34677b4324$var$Fixtures {
9128
9301
  for (const applicationId of this.applicationIds)await this.deleteApplication(applicationId);
9129
9302
  for (const environmentId of this.environmentIds)await this.deleteEnvironment(environmentId);
9130
9303
  for (const environmentStageId of this.environmentStageIds)await this.deleteEnvironmentStage(environmentStageId);
9304
+ for (const ci of this.ciIds)await this.deleteCI(ci);
9131
9305
  this.applicationIds = [];
9132
9306
  this.configurationIds = [];
9133
9307
  this.environmentIds = [];
@@ -9139,6 +9313,7 @@ class $80c3ae34677b4324$var$Fixtures {
9139
9313
  this.triggerIds = [];
9140
9314
  this.usernames = [];
9141
9315
  this.userProfiles = [];
9316
+ this.ciIds = [];
9142
9317
  }
9143
9318
  async addJiraTask() {
9144
9319
  const data = {
@@ -9188,6 +9363,9 @@ class $80c3ae34677b4324$var$Fixtures {
9188
9363
  this.userProfiles.push(profile.canonicalId);
9189
9364
  await this.doPost("fixtures/userProfile", profile);
9190
9365
  }
9366
+ async resetAdminProfile() {
9367
+ return this.resetUserProfile("admin", "Release Administrator");
9368
+ }
9191
9369
  async resetUserProfile(username, fullName) {
9192
9370
  this.usernames.push(username);
9193
9371
  return this.updateProfile({