@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/CHANGELOG.md CHANGED
@@ -1,10 +1,22 @@
1
1
  # @digital-ai/devops-page-object-release
2
2
 
3
- ## 0.0.0-snapshot-20251216091120
3
+ ## 0.0.0-snapshot-20260114095354
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - 43cf4ad: S-126526: Added page object for edit-teams-and-permissions-scenario
7
+ - 650862d: S-127587: Changed the page objects to support SAAS
8
+
9
+ ## 0.0.99
10
+
11
+ ### Patch Changes
12
+
13
+ - 70bd85d: S-127475 : Added SPEL related page objects
14
+
15
+ ## 0.0.98
16
+
17
+ ### Patch Changes
18
+
19
+ - f76a633: S-127036: Update for Action button with options. Updated the action button implementation to use a dropdown menu pattern instead of direct action buttons.
8
20
 
9
21
  ## 0.0.97
10
22
 
package/dist/main.js CHANGED
@@ -1,3 +1,4 @@
1
+ var $kKeXs$buffer = require("buffer");
1
2
  var $kKeXs$playwrighttest = require("@playwright/test");
2
3
  var $kKeXs$child_process = require("child_process");
3
4
  var $kKeXs$process = require("process");
@@ -2065,6 +2066,9 @@ class $9c0b0c2caed50730$export$d4865631ba74f3e2 extends (0, $f8721861c660dd88$ex
2065
2066
  this.preconditionToggle = page.getByLabel("Enable precondition");
2066
2067
  this.textEditor = page.locator("textarea");
2067
2068
  this.saveButton = page.getByTestId("save-btn");
2069
+ this.selectEL = page.getByRole("textbox", {
2070
+ name: "Precondition type"
2071
+ }).getByLabel("Precondition type");
2068
2072
  }
2069
2073
  async enablePrecondition() {
2070
2074
  (0, $kKeXs$playwrighttest.expect)(await this.preconditionToggle.isChecked()).toBe(false);
@@ -2080,6 +2084,15 @@ class $9c0b0c2caed50730$export$d4865631ba74f3e2 extends (0, $f8721861c660dd88$ex
2080
2084
  await this.saveButton.dblclick();
2081
2085
  await this.page.waitForTimeout(1000);
2082
2086
  }
2087
+ async setPreconditionToEL(script) {
2088
+ await this.enablePrecondition();
2089
+ await this.selectEL.click();
2090
+ await this.selectEL.selectOption("EL");
2091
+ await this.page.locator(".ace_content").click();
2092
+ await this.textEditor.fill(script);
2093
+ await this.saveButton.dblclick();
2094
+ await this.page.waitForTimeout(1000);
2095
+ }
2083
2096
  async expectPreconditionEditable(editable) {
2084
2097
  if (editable) await (0, $kKeXs$playwrighttest.expect)(this.textEditor).toBeEditable();
2085
2098
  else await (0, $kKeXs$playwrighttest.expect)(this.textEditor).not.toBeEditable();
@@ -5971,52 +5984,6 @@ class $e5c8dec182aa2e84$export$e2613a7eee3a1b1b extends (0, $f8721861c660dd88$ex
5971
5984
  });
5972
5985
  await tag.locator(".close-icon").click();
5973
5986
  }
5974
- async expectPermissionReadOnly(permission, team, readOnly) {
5975
- const rowLocator = this.page.locator(`table tr:has-text("${permission}")`);
5976
- const tagLocator = rowLocator.locator(`.tag-label:has-text("${team}")`);
5977
- if (readOnly) await (0, $kKeXs$playwrighttest.expect)(tagLocator).toBeVisible();
5978
- else {
5979
- const closeIconLocator = tagLocator.locator(".. >> .tag-close");
5980
- await (0, $kKeXs$playwrighttest.expect)(closeIconLocator).toBeVisible();
5981
- }
5982
- }
5983
- async expectTeamsNotToExist(teams, readOnly) {
5984
- for (const team of teams){
5985
- const teamRow = this.page.locator(`tr:has-text("${team}")`);
5986
- if (readOnly) await (0, $kKeXs$playwrighttest.expect)(teamRow.getByTitle("Delete")).toHaveCount(0);
5987
- else await (0, $kKeXs$playwrighttest.expect)(teamRow.getByTitle("Delete")).toBeVisible();
5988
- }
5989
- }
5990
- async expectInheritTeamsDisabled() {
5991
- const inheritCheckbox = this.page.locator(".inherit-checkbox input");
5992
- await (0, $kKeXs$playwrighttest.expect)(inheritCheckbox).toBeVisible();
5993
- await (0, $kKeXs$playwrighttest.expect)(inheritCheckbox).toBeDisabled();
5994
- }
5995
- async expectNewTeamButtonDisabled() {
5996
- const addTeamButton = this.page.locator(".button-add-team");
5997
- await (0, $kKeXs$playwrighttest.expect)(addTeamButton).toBeDisabled();
5998
- }
5999
- async expectRemoveTeamButtonNotToExist() {
6000
- await (0, $kKeXs$playwrighttest.expect)(this.page.locator("#teams-permissions-table table tr .action-label")).toHaveCount(0);
6001
- return this;
6002
- }
6003
- async expectSaveButtonDisabled() {
6004
- const saveButton = this.page.getByRole("button", {
6005
- name: "Save"
6006
- });
6007
- await (0, $kKeXs$playwrighttest.expect)(saveButton).toBeVisible();
6008
- await (0, $kKeXs$playwrighttest.expect)(saveButton).toBeDisabled();
6009
- return this;
6010
- }
6011
- async expectTeamsReadOnly(teams, readOnly) {
6012
- for (const team of teams){
6013
- const teamRow = this.page.locator("table").first().locator("tr", {
6014
- hasText: team
6015
- });
6016
- await (0, $kKeXs$playwrighttest.expect)(teamRow.locator(".tag-label + .tag-close")).toHaveCount(readOnly ? 0 : 1);
6017
- }
6018
- return this;
6019
- }
6020
5987
  async expectPermissionNotToExist(permission, team) {
6021
5988
  const row = this.page.locator("table tr", {
6022
5989
  hasText: permission
@@ -6911,7 +6878,9 @@ class $3ceab7c613cabfd6$export$107317390f5aa598 extends (0, $f8721861c660dd88$ex
6911
6878
  }).getByRole("checkbox")).toBeChecked();
6912
6879
  }
6913
6880
  async deleteUser(username) {
6914
- await this.page.getByTestId(`delete-btn-${username}`).click();
6881
+ await this.page.getByTestId(`user-actions-btn-${username}`).click();
6882
+ await (0, $kKeXs$playwrighttest.expect)(this.page.locator(".icon-delete")).toBeVisible();
6883
+ await this.page.locator(".icon-delete").click();
6915
6884
  await this.modal.delete();
6916
6885
  }
6917
6886
  async openRoles() {
@@ -6956,9 +6925,7 @@ class $3ceab7c613cabfd6$export$107317390f5aa598 extends (0, $f8721861c660dd88$ex
6956
6925
  }).locator(`td`).filter({
6957
6926
  hasText: user.externalId
6958
6927
  }).count()).toBeGreaterThan(0);
6959
- (0, $kKeXs$playwrighttest.expect)(await this.page.locator(`tr`).filter({
6960
- hasText: user.name
6961
- }).locator(`td .icon-delete`).count()).toBeGreaterThan(0);
6928
+ (0, $kKeXs$playwrighttest.expect)(await this.page.getByTestId(`user-actions-btn-${user.name}`).count()).toBeGreaterThan(0);
6962
6929
  }
6963
6930
  }
6964
6931
  async expectNoUser(username) {
@@ -6967,9 +6934,10 @@ class $3ceab7c613cabfd6$export$107317390f5aa598 extends (0, $f8721861c660dd88$ex
6967
6934
  }
6968
6935
  async updateUser(username) {
6969
6936
  await this.filterUser(username);
6970
- await this.page.getByRole("row", {
6971
- name: "" + username + ""
6972
- }).locator(".icon-edit").click();
6937
+ await this.page.getByTestId(`user-actions-btn-${username}`).click();
6938
+ const editIcon = this.page.locator(".icon-edit");
6939
+ await (0, $kKeXs$playwrighttest.expect)(editIcon).toBeVisible();
6940
+ await editIcon.click();
6973
6941
  return this.modal;
6974
6942
  }
6975
6943
  async sortByColumn(columnName, columnIndex) {
@@ -10209,17 +10177,6 @@ class $4ef41cf96a5fae4c$export$b8a61e5c71402559 {
10209
10177
  await this.page.waitForSelector("#releases-content");
10210
10178
  return new (0, $9058d40a81bdb1f5$export$b453f08936c58edb)(this.page);
10211
10179
  }
10212
- async openFolderByName(folderName) {
10213
- const folder = this.page.getByTitle(folderName);
10214
- await (0, $kKeXs$playwrighttest.expect)(folder).toBeVisible({
10215
- timeout: 5000
10216
- });
10217
- await folder.click();
10218
- await (0, $kKeXs$playwrighttest.expect)(this.page.locator(".MuiBreadcrumbs-li").getByRole("link", {
10219
- name: folderName
10220
- })).toBeVisible();
10221
- return this;
10222
- }
10223
10180
  async openProfilePage() {
10224
10181
  await this.page.goto(`./#/profile`);
10225
10182
  return new (0, $010122e1d9b28b80$export$3cf9c90f870f31bd)(this.page);
@@ -10369,22 +10326,43 @@ class $258749e0671c845a$export$f14c0e3f98d164c0 extends (0, $f8721861c660dd88$ex
10369
10326
  * @param userName
10370
10327
  * @param password
10371
10328
  */ async login(userName, password) {
10372
- await this.page.goto("./#/login");
10373
- await (0, $kKeXs$playwrighttest.expect)(this.page).toHaveTitle("Digital.ai Release");
10374
- await this.page.getByPlaceholder("User").fill(userName, {
10375
- timeout: 1000
10376
- });
10377
- await this.page.getByPlaceholder("Password").fill(password, {
10378
- timeout: 10000
10329
+ const baseUrl = undefined;
10330
+ if (!baseUrl || !userName || !password) throw new Error("Missing BASE_URL or TEST_USERNAME or TEST_PASSWORD in environment variables");
10331
+ await this.page.goto(baseUrl, {
10332
+ waitUntil: "domcontentloaded"
10379
10333
  });
10334
+ const usernameInput = this.getUsernameInput();
10335
+ const passwordInput = this.getPasswordInput();
10336
+ await usernameInput.fill(userName);
10337
+ await passwordInput.fill(password);
10380
10338
  await this.page.getByRole("button", {
10381
- name: "Log in"
10382
- }).click({
10383
- timeout: 10000
10384
- });
10385
- await this.page.waitForTimeout(1000);
10339
+ name: /log in|sign in/i
10340
+ }).click();
10341
+ (0, $kKeXs$playwrighttest.expect)(this.page.getByText("Digital.ai Release Home"));
10386
10342
  await this.closePendoModalWindow();
10387
10343
  }
10344
+ getUsernameInput() {
10345
+ const env = undefined ?? "local";
10346
+ switch(env){
10347
+ case "local":
10348
+ return this.page.getByPlaceholder("User");
10349
+ case "saas":
10350
+ return this.page.locator("input#username");
10351
+ default:
10352
+ throw new Error(`Unsupported TEST_ENV value: ${env}`);
10353
+ }
10354
+ }
10355
+ getPasswordInput() {
10356
+ const env = undefined ?? "local";
10357
+ switch(env){
10358
+ case "local":
10359
+ return this.page.getByPlaceholder("Password");
10360
+ case "saas":
10361
+ return this.page.locator("input#password");
10362
+ default:
10363
+ throw new Error(`Unsupported TEST_ENV value: ${env}`);
10364
+ }
10365
+ }
10388
10366
  async loginWithoutReload(userName, password) {
10389
10367
  let loadTriggered = false;
10390
10368
  this.page.on("load", ()=>{
@@ -11261,9 +11239,17 @@ const $8977f8672c5de0fa$export$45f0aca2596a2bb3 = function() {
11261
11239
 
11262
11240
 
11263
11241
 
11242
+
11243
+ var $6998c6a53a9eb4fa$require$Buffer = $kKeXs$buffer.Buffer;
11264
11244
  const $6998c6a53a9eb4fa$var$JIRA_ISSUE_API_URL = "https://digitalai.atlassian.net/rest/api/2/issue";
11265
- const $6998c6a53a9eb4fa$var$adminHeaders = {
11266
- Authorization: "Basic YWRtaW46YWRtaW4=",
11245
+ function $6998c6a53a9eb4fa$var$encodeBasicAuth() {
11246
+ const username = $kKeXs$process.env.TEST_USERNAME;
11247
+ const password = $kKeXs$process.env.TEST_PASSWORD;
11248
+ if (!username || !password) throw new Error("Missing TEST_USERNAME or TEST_PASSWORD in environment variables");
11249
+ return $6998c6a53a9eb4fa$require$Buffer.from(`${username}:${password}`).toString("base64");
11250
+ }
11251
+ const $6998c6a53a9eb4fa$export$1d40aa9bc568f58d = {
11252
+ Authorization: `Basic ${$6998c6a53a9eb4fa$var$encodeBasicAuth()}`,
11267
11253
  Cookie: "XSRF-TOKEN=1;",
11268
11254
  "X-XSRF-TOKEN": "1"
11269
11255
  };
@@ -11745,24 +11731,24 @@ class $6998c6a53a9eb4fa$var$Fixtures {
11745
11731
  doPost(url, body) {
11746
11732
  return this.request.post(url, {
11747
11733
  data: body,
11748
- headers: $6998c6a53a9eb4fa$var$adminHeaders
11734
+ headers: $6998c6a53a9eb4fa$export$1d40aa9bc568f58d
11749
11735
  });
11750
11736
  }
11751
11737
  doPut(url, body) {
11752
11738
  return this.request.put(url, {
11753
11739
  data: body,
11754
- headers: $6998c6a53a9eb4fa$var$adminHeaders
11740
+ headers: $6998c6a53a9eb4fa$export$1d40aa9bc568f58d
11755
11741
  });
11756
11742
  }
11757
11743
  doGet(url) {
11758
11744
  return this.request.get(url, {
11759
- headers: $6998c6a53a9eb4fa$var$adminHeaders
11745
+ headers: $6998c6a53a9eb4fa$export$1d40aa9bc568f58d
11760
11746
  });
11761
11747
  }
11762
11748
  doDelete(url, body) {
11763
11749
  return this.request.delete(url, {
11764
11750
  data: body,
11765
- headers: $6998c6a53a9eb4fa$var$adminHeaders
11751
+ headers: $6998c6a53a9eb4fa$export$1d40aa9bc568f58d
11766
11752
  });
11767
11753
  }
11768
11754
  initDefaults(ci) {