@digital-ai/devops-page-object-release 0.0.0-snapshot-20251216091120 → 0.0.0-snapshot-20260114095354

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
@@ -1,3 +1,4 @@
1
+ import {Buffer as $hOLA6$Buffer} from "buffer";
1
2
  import {test as $hOLA6$test, expect as $hOLA6$expect} from "@playwright/test";
2
3
  import {execFile as $hOLA6$execFile} from "child_process";
3
4
  import $hOLA6$lodashisNil from "lodash/isNil";
@@ -1129,6 +1130,9 @@ class $3fa741329d8067d5$export$d4865631ba74f3e2 extends (0, $9626bc9256ce31f7$ex
1129
1130
  this.preconditionToggle = page.getByLabel("Enable precondition");
1130
1131
  this.textEditor = page.locator("textarea");
1131
1132
  this.saveButton = page.getByTestId("save-btn");
1133
+ this.selectEL = page.getByRole("textbox", {
1134
+ name: "Precondition type"
1135
+ }).getByLabel("Precondition type");
1132
1136
  }
1133
1137
  async enablePrecondition() {
1134
1138
  (0, $hOLA6$expect)(await this.preconditionToggle.isChecked()).toBe(false);
@@ -1144,6 +1148,15 @@ class $3fa741329d8067d5$export$d4865631ba74f3e2 extends (0, $9626bc9256ce31f7$ex
1144
1148
  await this.saveButton.dblclick();
1145
1149
  await this.page.waitForTimeout(1000);
1146
1150
  }
1151
+ async setPreconditionToEL(script) {
1152
+ await this.enablePrecondition();
1153
+ await this.selectEL.click();
1154
+ await this.selectEL.selectOption("EL");
1155
+ await this.page.locator(".ace_content").click();
1156
+ await this.textEditor.fill(script);
1157
+ await this.saveButton.dblclick();
1158
+ await this.page.waitForTimeout(1000);
1159
+ }
1147
1160
  async expectPreconditionEditable(editable) {
1148
1161
  if (editable) await (0, $hOLA6$expect)(this.textEditor).toBeEditable();
1149
1162
  else await (0, $hOLA6$expect)(this.textEditor).not.toBeEditable();
@@ -5035,52 +5048,6 @@ class $112122b844be02a3$export$e2613a7eee3a1b1b extends (0, $9626bc9256ce31f7$ex
5035
5048
  });
5036
5049
  await tag.locator(".close-icon").click();
5037
5050
  }
5038
- async expectPermissionReadOnly(permission, team, readOnly) {
5039
- const rowLocator = this.page.locator(`table tr:has-text("${permission}")`);
5040
- const tagLocator = rowLocator.locator(`.tag-label:has-text("${team}")`);
5041
- if (readOnly) await (0, $hOLA6$expect)(tagLocator).toBeVisible();
5042
- else {
5043
- const closeIconLocator = tagLocator.locator(".. >> .tag-close");
5044
- await (0, $hOLA6$expect)(closeIconLocator).toBeVisible();
5045
- }
5046
- }
5047
- async expectTeamsNotToExist(teams, readOnly) {
5048
- for (const team of teams){
5049
- const teamRow = this.page.locator(`tr:has-text("${team}")`);
5050
- if (readOnly) await (0, $hOLA6$expect)(teamRow.getByTitle("Delete")).toHaveCount(0);
5051
- else await (0, $hOLA6$expect)(teamRow.getByTitle("Delete")).toBeVisible();
5052
- }
5053
- }
5054
- async expectInheritTeamsDisabled() {
5055
- const inheritCheckbox = this.page.locator(".inherit-checkbox input");
5056
- await (0, $hOLA6$expect)(inheritCheckbox).toBeVisible();
5057
- await (0, $hOLA6$expect)(inheritCheckbox).toBeDisabled();
5058
- }
5059
- async expectNewTeamButtonDisabled() {
5060
- const addTeamButton = this.page.locator(".button-add-team");
5061
- await (0, $hOLA6$expect)(addTeamButton).toBeDisabled();
5062
- }
5063
- async expectRemoveTeamButtonNotToExist() {
5064
- await (0, $hOLA6$expect)(this.page.locator("#teams-permissions-table table tr .action-label")).toHaveCount(0);
5065
- return this;
5066
- }
5067
- async expectSaveButtonDisabled() {
5068
- const saveButton = this.page.getByRole("button", {
5069
- name: "Save"
5070
- });
5071
- await (0, $hOLA6$expect)(saveButton).toBeVisible();
5072
- await (0, $hOLA6$expect)(saveButton).toBeDisabled();
5073
- return this;
5074
- }
5075
- async expectTeamsReadOnly(teams, readOnly) {
5076
- for (const team of teams){
5077
- const teamRow = this.page.locator("table").first().locator("tr", {
5078
- hasText: team
5079
- });
5080
- await (0, $hOLA6$expect)(teamRow.locator(".tag-label + .tag-close")).toHaveCount(readOnly ? 0 : 1);
5081
- }
5082
- return this;
5083
- }
5084
5051
  async expectPermissionNotToExist(permission, team) {
5085
5052
  const row = this.page.locator("table tr", {
5086
5053
  hasText: permission
@@ -5975,7 +5942,9 @@ class $2cb6a6ac6b17e85f$export$107317390f5aa598 extends (0, $9626bc9256ce31f7$ex
5975
5942
  }).getByRole("checkbox")).toBeChecked();
5976
5943
  }
5977
5944
  async deleteUser(username) {
5978
- await this.page.getByTestId(`delete-btn-${username}`).click();
5945
+ await this.page.getByTestId(`user-actions-btn-${username}`).click();
5946
+ await (0, $hOLA6$expect)(this.page.locator(".icon-delete")).toBeVisible();
5947
+ await this.page.locator(".icon-delete").click();
5979
5948
  await this.modal.delete();
5980
5949
  }
5981
5950
  async openRoles() {
@@ -6020,9 +5989,7 @@ class $2cb6a6ac6b17e85f$export$107317390f5aa598 extends (0, $9626bc9256ce31f7$ex
6020
5989
  }).locator(`td`).filter({
6021
5990
  hasText: user.externalId
6022
5991
  }).count()).toBeGreaterThan(0);
6023
- (0, $hOLA6$expect)(await this.page.locator(`tr`).filter({
6024
- hasText: user.name
6025
- }).locator(`td .icon-delete`).count()).toBeGreaterThan(0);
5992
+ (0, $hOLA6$expect)(await this.page.getByTestId(`user-actions-btn-${user.name}`).count()).toBeGreaterThan(0);
6026
5993
  }
6027
5994
  }
6028
5995
  async expectNoUser(username) {
@@ -6031,9 +5998,10 @@ class $2cb6a6ac6b17e85f$export$107317390f5aa598 extends (0, $9626bc9256ce31f7$ex
6031
5998
  }
6032
5999
  async updateUser(username) {
6033
6000
  await this.filterUser(username);
6034
- await this.page.getByRole("row", {
6035
- name: "" + username + ""
6036
- }).locator(".icon-edit").click();
6001
+ await this.page.getByTestId(`user-actions-btn-${username}`).click();
6002
+ const editIcon = this.page.locator(".icon-edit");
6003
+ await (0, $hOLA6$expect)(editIcon).toBeVisible();
6004
+ await editIcon.click();
6037
6005
  return this.modal;
6038
6006
  }
6039
6007
  async sortByColumn(columnName, columnIndex) {
@@ -9273,17 +9241,6 @@ class $e72552cbf941ecfa$export$b8a61e5c71402559 {
9273
9241
  await this.page.waitForSelector("#releases-content");
9274
9242
  return new (0, $50c91328c9110668$export$b453f08936c58edb)(this.page);
9275
9243
  }
9276
- async openFolderByName(folderName) {
9277
- const folder = this.page.getByTitle(folderName);
9278
- await (0, $hOLA6$expect)(folder).toBeVisible({
9279
- timeout: 5000
9280
- });
9281
- await folder.click();
9282
- await (0, $hOLA6$expect)(this.page.locator(".MuiBreadcrumbs-li").getByRole("link", {
9283
- name: folderName
9284
- })).toBeVisible();
9285
- return this;
9286
- }
9287
9244
  async openProfilePage() {
9288
9245
  await this.page.goto(`./#/profile`);
9289
9246
  return new (0, $a5932af323ac015a$export$3cf9c90f870f31bd)(this.page);
@@ -9433,22 +9390,43 @@ class $4444bee76761dfb1$export$f14c0e3f98d164c0 extends (0, $9626bc9256ce31f7$ex
9433
9390
  * @param userName
9434
9391
  * @param password
9435
9392
  */ async login(userName, password) {
9436
- await this.page.goto("./#/login");
9437
- await (0, $hOLA6$expect)(this.page).toHaveTitle("Digital.ai Release");
9438
- await this.page.getByPlaceholder("User").fill(userName, {
9439
- timeout: 1000
9440
- });
9441
- await this.page.getByPlaceholder("Password").fill(password, {
9442
- timeout: 10000
9393
+ const baseUrl = undefined;
9394
+ if (!baseUrl || !userName || !password) throw new Error("Missing BASE_URL or TEST_USERNAME or TEST_PASSWORD in environment variables");
9395
+ await this.page.goto(baseUrl, {
9396
+ waitUntil: "domcontentloaded"
9443
9397
  });
9398
+ const usernameInput = this.getUsernameInput();
9399
+ const passwordInput = this.getPasswordInput();
9400
+ await usernameInput.fill(userName);
9401
+ await passwordInput.fill(password);
9444
9402
  await this.page.getByRole("button", {
9445
- name: "Log in"
9446
- }).click({
9447
- timeout: 10000
9448
- });
9449
- await this.page.waitForTimeout(1000);
9403
+ name: /log in|sign in/i
9404
+ }).click();
9405
+ (0, $hOLA6$expect)(this.page.getByText("Digital.ai Release Home"));
9450
9406
  await this.closePendoModalWindow();
9451
9407
  }
9408
+ getUsernameInput() {
9409
+ const env = undefined ?? "local";
9410
+ switch(env){
9411
+ case "local":
9412
+ return this.page.getByPlaceholder("User");
9413
+ case "saas":
9414
+ return this.page.locator("input#username");
9415
+ default:
9416
+ throw new Error(`Unsupported TEST_ENV value: ${env}`);
9417
+ }
9418
+ }
9419
+ getPasswordInput() {
9420
+ const env = undefined ?? "local";
9421
+ switch(env){
9422
+ case "local":
9423
+ return this.page.getByPlaceholder("Password");
9424
+ case "saas":
9425
+ return this.page.locator("input#password");
9426
+ default:
9427
+ throw new Error(`Unsupported TEST_ENV value: ${env}`);
9428
+ }
9429
+ }
9452
9430
  async loginWithoutReload(userName, password) {
9453
9431
  let loadTriggered = false;
9454
9432
  this.page.on("load", ()=>{
@@ -9651,9 +9629,17 @@ const $f86fbaaa8b4e8c61$export$45f0aca2596a2bb3 = function() {
9651
9629
 
9652
9630
 
9653
9631
 
9632
+
9633
+ var $80c3ae34677b4324$require$Buffer = $hOLA6$Buffer;
9654
9634
  const $80c3ae34677b4324$var$JIRA_ISSUE_API_URL = "https://digitalai.atlassian.net/rest/api/2/issue";
9655
- const $80c3ae34677b4324$var$adminHeaders = {
9656
- Authorization: "Basic YWRtaW46YWRtaW4=",
9635
+ function $80c3ae34677b4324$var$encodeBasicAuth() {
9636
+ const username = $hOLA6$env.TEST_USERNAME;
9637
+ const password = $hOLA6$env.TEST_PASSWORD;
9638
+ if (!username || !password) throw new Error("Missing TEST_USERNAME or TEST_PASSWORD in environment variables");
9639
+ return $80c3ae34677b4324$require$Buffer.from(`${username}:${password}`).toString("base64");
9640
+ }
9641
+ const $80c3ae34677b4324$export$1d40aa9bc568f58d = {
9642
+ Authorization: `Basic ${$80c3ae34677b4324$var$encodeBasicAuth()}`,
9657
9643
  Cookie: "XSRF-TOKEN=1;",
9658
9644
  "X-XSRF-TOKEN": "1"
9659
9645
  };
@@ -10135,24 +10121,24 @@ class $80c3ae34677b4324$var$Fixtures {
10135
10121
  doPost(url, body) {
10136
10122
  return this.request.post(url, {
10137
10123
  data: body,
10138
- headers: $80c3ae34677b4324$var$adminHeaders
10124
+ headers: $80c3ae34677b4324$export$1d40aa9bc568f58d
10139
10125
  });
10140
10126
  }
10141
10127
  doPut(url, body) {
10142
10128
  return this.request.put(url, {
10143
10129
  data: body,
10144
- headers: $80c3ae34677b4324$var$adminHeaders
10130
+ headers: $80c3ae34677b4324$export$1d40aa9bc568f58d
10145
10131
  });
10146
10132
  }
10147
10133
  doGet(url) {
10148
10134
  return this.request.get(url, {
10149
- headers: $80c3ae34677b4324$var$adminHeaders
10135
+ headers: $80c3ae34677b4324$export$1d40aa9bc568f58d
10150
10136
  });
10151
10137
  }
10152
10138
  doDelete(url, body) {
10153
10139
  return this.request.delete(url, {
10154
10140
  data: body,
10155
- headers: $80c3ae34677b4324$var$adminHeaders
10141
+ headers: $80c3ae34677b4324$export$1d40aa9bc568f58d
10156
10142
  });
10157
10143
  }
10158
10144
  initDefaults(ci) {