@digital-ai/devops-page-object-release 0.0.63 → 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/dist/module.js CHANGED
@@ -5153,7 +5153,9 @@ class $21185a378c23589e$export$e2e2e1ffdce20c30 extends (0, $9626bc9256ce31f7$ex
5153
5153
  this.email = page.locator("#email");
5154
5154
  this.password = page.locator("#password");
5155
5155
  this.cnfPassword = page.locator("#confirmPassword");
5156
- this.saveButton = page.getByTestId("save-btn");
5156
+ this.saveButton = page.getByRole("button", {
5157
+ name: "Save"
5158
+ });
5157
5159
  this.cancelButton = page.getByRole("button", {
5158
5160
  name: "Cancel"
5159
5161
  });
@@ -5173,6 +5175,11 @@ class $21185a378c23589e$export$e2e2e1ffdce20c30 extends (0, $9626bc9256ce31f7$ex
5173
5175
  async setPassword(password) {
5174
5176
  return await this.password.fill(password);
5175
5177
  }
5178
+ async setCurrentPassword(password) {
5179
+ const currentPasswordField = this.page.locator("#previousPassword");
5180
+ await currentPasswordField.fill(password);
5181
+ await (0, $hOLA6$expect)(currentPasswordField).toHaveValue(password);
5182
+ }
5176
5183
  async setConfirmPassword(cnfPassword) {
5177
5184
  return await this.cnfPassword.fill(cnfPassword);
5178
5185
  }
@@ -5188,6 +5195,24 @@ class $21185a378c23589e$export$e2e2e1ffdce20c30 extends (0, $9626bc9256ce31f7$ex
5188
5195
  async delete() {
5189
5196
  await this.deleteButton.click();
5190
5197
  }
5198
+ async expectSaveButtonEnabled() {
5199
+ await (0, $hOLA6$expect)(this.saveButton).toBeEnabled();
5200
+ }
5201
+ async expectSaveButtonDisabled() {
5202
+ await (0, $hOLA6$expect)(this.saveButton).toBeDisabled();
5203
+ }
5204
+ async expectErrorMessage(errorMsg) {
5205
+ await (0, $hOLA6$expect)(this.page.locator('.dot-dialog-content [role="alert"]')).toContainText(errorMsg);
5206
+ }
5207
+ async expectNewPasswordBoxDisabled() {
5208
+ await (0, $hOLA6$expect)(this.page.locator("#password")).toBeDisabled();
5209
+ return this;
5210
+ }
5211
+ async expectConfirmPasswordHelperText(text) {
5212
+ const helperText = this.page.locator("#confirmPassword-helper-text");
5213
+ await (0, $hOLA6$expect)(helperText).toBeVisible();
5214
+ await (0, $hOLA6$expect)(helperText).toHaveText(text);
5215
+ }
5191
5216
  }
5192
5217
 
5193
5218
 
@@ -5214,6 +5239,7 @@ class $2cb6a6ac6b17e85f$export$107317390f5aa598 extends (0, $9626bc9256ce31f7$ex
5214
5239
  }
5215
5240
  async addUser() {
5216
5241
  await this.page.locator(".new-user-btn").click();
5242
+ return this.modal;
5217
5243
  }
5218
5244
  async createUser(username, password) {
5219
5245
  await this.modal.setUserName(username);
@@ -5252,6 +5278,75 @@ class $2cb6a6ac6b17e85f$export$107317390f5aa598 extends (0, $9626bc9256ce31f7$ex
5252
5278
  await this.util.openSideNavMenu("Task access");
5253
5279
  await (0, $hOLA6$expect)(this.page.getByLabel("breadcrumb").getByText("Task access")).toBeVisible();
5254
5280
  }
5281
+ async expectUsers(users) {
5282
+ for (const user of users){
5283
+ await this.filterUser(user.name);
5284
+ const type = user.external ? "External" : "Internal";
5285
+ (0, $hOLA6$expect)(await this.page.locator(`tr`).filter({
5286
+ hasText: user.name
5287
+ }).count()).toBeGreaterThan(0);
5288
+ (0, $hOLA6$expect)(await this.page.locator(`tr`).filter({
5289
+ hasText: user.name
5290
+ }).locator(`td`).filter({
5291
+ hasText: type
5292
+ }).count()).toBeGreaterThan(0);
5293
+ if (user.email) (0, $hOLA6$expect)(await this.page.locator(`tr`).filter({
5294
+ hasText: user.name
5295
+ }).locator(`td`).filter({
5296
+ hasText: user.email
5297
+ }).count()).toBeGreaterThan(0);
5298
+ if (user.fullName) (0, $hOLA6$expect)(await this.page.locator(`tr`).filter({
5299
+ hasText: user.name
5300
+ }).locator(`td`).filter({
5301
+ hasText: user.fullName
5302
+ }).count()).toBeGreaterThan(0);
5303
+ if (user.externalId) (0, $hOLA6$expect)(await this.page.locator(`tr`).filter({
5304
+ hasText: user.name
5305
+ }).locator(`td`).filter({
5306
+ hasText: user.externalId
5307
+ }).count()).toBeGreaterThan(0);
5308
+ (0, $hOLA6$expect)(await this.page.locator(`tr`).filter({
5309
+ hasText: user.name
5310
+ }).locator(`td .icon-delete`).count()).toBeGreaterThan(0);
5311
+ }
5312
+ }
5313
+ async expectNoUser(username) {
5314
+ await this.filterUser(username);
5315
+ await (0, $hOLA6$expect)(this.page.locator(`p[aria-label=${username}]`)).not.toBeVisible();
5316
+ }
5317
+ async updateUser(username) {
5318
+ await this.filterUser(username);
5319
+ await this.page.getByRole("row", {
5320
+ name: "" + username + ""
5321
+ }).locator(".icon-edit").click();
5322
+ return this.modal;
5323
+ }
5324
+ async sortByColumn(columnName, columnIndex) {
5325
+ const table = this.page.getByTestId("users-table");
5326
+ const column = table.locator(`th[title="${columnName}"]`);
5327
+ const originalData = await table.locator(`td:nth-child(${columnIndex})`).allTextContents();
5328
+ await column.click();
5329
+ const sort = await column.getAttribute("aria-sort");
5330
+ if (sort == "ascending") {
5331
+ const data = await table.locator(`td:nth-child(${columnIndex})`).allTextContents();
5332
+ originalData.sort();
5333
+ (0, $hOLA6$expect)(data).toEqual(originalData);
5334
+ }
5335
+ if (sort == "descending") {
5336
+ const data = await table.locator(`td:nth-child(${columnIndex})`).allTextContents();
5337
+ (0, $hOLA6$expect)(data).toEqual(data.sort((a, b)=>a.localeCompare(b)));
5338
+ }
5339
+ return this;
5340
+ }
5341
+ async expectColumnVisible(column, visible = true) {
5342
+ if (visible) await (0, $hOLA6$expect)(this.page.locator(`thead th`).filter({
5343
+ hasText: column
5344
+ })).toBeVisible();
5345
+ else await (0, $hOLA6$expect)(this.page.locator(`thead th`).filter({
5346
+ hasText: column
5347
+ })).toHaveCount(0);
5348
+ return this;
5349
+ }
5255
5350
  }
5256
5351
 
5257
5352
 
@@ -7383,6 +7478,7 @@ class $a4ba753fcd18eb4a$export$539d82a5d70c4909 extends (0, $9626bc9256ce31f7$ex
7383
7478
  await (0, $hOLA6$expect)(this.page.locator(".success").filter({
7384
7479
  hasText: "Risk Profile Created Successfully"
7385
7480
  })).toBeVisible();
7481
+ await this.closeNotificationBanner();
7386
7482
  }
7387
7483
  async copyRiskProfile(title) {
7388
7484
  await this.page.locator(".risk-profile .data-row").filter({
@@ -7399,6 +7495,7 @@ class $a4ba753fcd18eb4a$export$539d82a5d70c4909 extends (0, $9626bc9256ce31f7$ex
7399
7495
  await (0, $hOLA6$expect)(this.page.locator(".success").filter({
7400
7496
  hasText: "Risk Profile Updated Successfully"
7401
7497
  })).toBeVisible();
7498
+ await this.closeNotificationBanner();
7402
7499
  }
7403
7500
  async filter(filterText) {
7404
7501
  await this.page.locator("#risk-profile-filter").waitFor({
@@ -7418,6 +7515,10 @@ class $a4ba753fcd18eb4a$export$539d82a5d70c4909 extends (0, $9626bc9256ce31f7$ex
7418
7515
  if (present) await (0, $hOLA6$expect)(locator).toBeVisible();
7419
7516
  else await (0, $hOLA6$expect)(locator).not.toBeVisible();
7420
7517
  }
7518
+ async closeNotificationBanner() {
7519
+ const closeIcon = this.page.getByTestId(`CloseIcon`);
7520
+ if (await closeIcon.isVisible()) await closeIcon.click();
7521
+ }
7421
7522
  }
7422
7523
  class $a4ba753fcd18eb4a$var$RisksProfilePage extends (0, $9626bc9256ce31f7$export$2b65d1d97338f32b) {
7423
7524
  async shouldBeEditable(editable) {
@@ -8681,6 +8782,14 @@ class $4444bee76761dfb1$export$f14c0e3f98d164c0 extends (0, $9626bc9256ce31f7$ex
8681
8782
  state: "visible"
8682
8783
  });
8683
8784
  }
8785
+ async expectLoginPage() {
8786
+ await (0, $hOLA6$expect)(this.page).toHaveURL("./#/login");
8787
+ await (0, $hOLA6$expect)(this.page.getByPlaceholder("User")).toBeVisible();
8788
+ await (0, $hOLA6$expect)(this.page.getByPlaceholder("Password")).toBeVisible();
8789
+ await (0, $hOLA6$expect)(this.page.getByRole("button", {
8790
+ name: "Log in"
8791
+ })).toBeVisible();
8792
+ }
8684
8793
  }
8685
8794
 
8686
8795
 
@@ -8853,6 +8962,7 @@ const $80c3ae34677b4324$export$e0969da9b8fb378d = (0, $hOLA6$test).extend({
8853
8962
  class $80c3ae34677b4324$var$Fixtures {
8854
8963
  applicationIds = [];
8855
8964
  archivedReleaseIds = [];
8965
+ ciIds = [];
8856
8966
  environmentIds = [];
8857
8967
  environmentStageIds = [];
8858
8968
  releaseIds = [];
@@ -8891,6 +9001,9 @@ class $80c3ae34677b4324$var$Fixtures {
8891
9001
  ci
8892
9002
  ]);
8893
9003
  }
9004
+ async deleteCI(id) {
9005
+ return this.doDelete(`fixtures/configuration/${id}`);
9006
+ }
8894
9007
  getParentId(id) {
8895
9008
  return id.substring(0, id.lastIndexOf("/"));
8896
9009
  }
@@ -9128,6 +9241,7 @@ class $80c3ae34677b4324$var$Fixtures {
9128
9241
  for (const applicationId of this.applicationIds)await this.deleteApplication(applicationId);
9129
9242
  for (const environmentId of this.environmentIds)await this.deleteEnvironment(environmentId);
9130
9243
  for (const environmentStageId of this.environmentStageIds)await this.deleteEnvironmentStage(environmentStageId);
9244
+ for (const ci of this.ciIds)await this.deleteCI(ci);
9131
9245
  this.applicationIds = [];
9132
9246
  this.configurationIds = [];
9133
9247
  this.environmentIds = [];
@@ -9139,6 +9253,7 @@ class $80c3ae34677b4324$var$Fixtures {
9139
9253
  this.triggerIds = [];
9140
9254
  this.usernames = [];
9141
9255
  this.userProfiles = [];
9256
+ this.ciIds = [];
9142
9257
  }
9143
9258
  async addJiraTask() {
9144
9259
  const data = {
@@ -9188,6 +9303,9 @@ class $80c3ae34677b4324$var$Fixtures {
9188
9303
  this.userProfiles.push(profile.canonicalId);
9189
9304
  await this.doPost("fixtures/userProfile", profile);
9190
9305
  }
9306
+ async resetAdminProfile() {
9307
+ return this.resetUserProfile("admin", "Release Administrator");
9308
+ }
9191
9309
  async resetUserProfile(username, fullName) {
9192
9310
  this.usernames.push(username);
9193
9311
  return this.updateProfile({