@digital-ai/devops-page-object-release 0.0.0-snapshot-20251216064142 → 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-20251216064142
3
+ ## 0.0.0-snapshot-20260114095354
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - ec1a601: S-127036: Update for Action button with options. Updated the action button implementation to use a dropdown menu pattern instead of direct action buttons.
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();
@@ -10313,22 +10326,43 @@ class $258749e0671c845a$export$f14c0e3f98d164c0 extends (0, $f8721861c660dd88$ex
10313
10326
  * @param userName
10314
10327
  * @param password
10315
10328
  */ async login(userName, password) {
10316
- await this.page.goto("./#/login");
10317
- await (0, $kKeXs$playwrighttest.expect)(this.page).toHaveTitle("Digital.ai Release");
10318
- await this.page.getByPlaceholder("User").fill(userName, {
10319
- timeout: 1000
10320
- });
10321
- await this.page.getByPlaceholder("Password").fill(password, {
10322
- 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"
10323
10333
  });
10334
+ const usernameInput = this.getUsernameInput();
10335
+ const passwordInput = this.getPasswordInput();
10336
+ await usernameInput.fill(userName);
10337
+ await passwordInput.fill(password);
10324
10338
  await this.page.getByRole("button", {
10325
- name: "Log in"
10326
- }).click({
10327
- timeout: 10000
10328
- });
10329
- 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"));
10330
10342
  await this.closePendoModalWindow();
10331
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
+ }
10332
10366
  async loginWithoutReload(userName, password) {
10333
10367
  let loadTriggered = false;
10334
10368
  this.page.on("load", ()=>{
@@ -11205,9 +11239,17 @@ const $8977f8672c5de0fa$export$45f0aca2596a2bb3 = function() {
11205
11239
 
11206
11240
 
11207
11241
 
11242
+
11243
+ var $6998c6a53a9eb4fa$require$Buffer = $kKeXs$buffer.Buffer;
11208
11244
  const $6998c6a53a9eb4fa$var$JIRA_ISSUE_API_URL = "https://digitalai.atlassian.net/rest/api/2/issue";
11209
- const $6998c6a53a9eb4fa$var$adminHeaders = {
11210
- 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()}`,
11211
11253
  Cookie: "XSRF-TOKEN=1;",
11212
11254
  "X-XSRF-TOKEN": "1"
11213
11255
  };
@@ -11689,24 +11731,24 @@ class $6998c6a53a9eb4fa$var$Fixtures {
11689
11731
  doPost(url, body) {
11690
11732
  return this.request.post(url, {
11691
11733
  data: body,
11692
- headers: $6998c6a53a9eb4fa$var$adminHeaders
11734
+ headers: $6998c6a53a9eb4fa$export$1d40aa9bc568f58d
11693
11735
  });
11694
11736
  }
11695
11737
  doPut(url, body) {
11696
11738
  return this.request.put(url, {
11697
11739
  data: body,
11698
- headers: $6998c6a53a9eb4fa$var$adminHeaders
11740
+ headers: $6998c6a53a9eb4fa$export$1d40aa9bc568f58d
11699
11741
  });
11700
11742
  }
11701
11743
  doGet(url) {
11702
11744
  return this.request.get(url, {
11703
- headers: $6998c6a53a9eb4fa$var$adminHeaders
11745
+ headers: $6998c6a53a9eb4fa$export$1d40aa9bc568f58d
11704
11746
  });
11705
11747
  }
11706
11748
  doDelete(url, body) {
11707
11749
  return this.request.delete(url, {
11708
11750
  data: body,
11709
- headers: $6998c6a53a9eb4fa$var$adminHeaders
11751
+ headers: $6998c6a53a9eb4fa$export$1d40aa9bc568f58d
11710
11752
  });
11711
11753
  }
11712
11754
  initDefaults(ci) {