@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/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();
@@ -9377,22 +9390,43 @@ class $4444bee76761dfb1$export$f14c0e3f98d164c0 extends (0, $9626bc9256ce31f7$ex
9377
9390
  * @param userName
9378
9391
  * @param password
9379
9392
  */ async login(userName, password) {
9380
- await this.page.goto("./#/login");
9381
- await (0, $hOLA6$expect)(this.page).toHaveTitle("Digital.ai Release");
9382
- await this.page.getByPlaceholder("User").fill(userName, {
9383
- timeout: 1000
9384
- });
9385
- await this.page.getByPlaceholder("Password").fill(password, {
9386
- 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"
9387
9397
  });
9398
+ const usernameInput = this.getUsernameInput();
9399
+ const passwordInput = this.getPasswordInput();
9400
+ await usernameInput.fill(userName);
9401
+ await passwordInput.fill(password);
9388
9402
  await this.page.getByRole("button", {
9389
- name: "Log in"
9390
- }).click({
9391
- timeout: 10000
9392
- });
9393
- 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"));
9394
9406
  await this.closePendoModalWindow();
9395
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
+ }
9396
9430
  async loginWithoutReload(userName, password) {
9397
9431
  let loadTriggered = false;
9398
9432
  this.page.on("load", ()=>{
@@ -9595,9 +9629,17 @@ const $f86fbaaa8b4e8c61$export$45f0aca2596a2bb3 = function() {
9595
9629
 
9596
9630
 
9597
9631
 
9632
+
9633
+ var $80c3ae34677b4324$require$Buffer = $hOLA6$Buffer;
9598
9634
  const $80c3ae34677b4324$var$JIRA_ISSUE_API_URL = "https://digitalai.atlassian.net/rest/api/2/issue";
9599
- const $80c3ae34677b4324$var$adminHeaders = {
9600
- 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()}`,
9601
9643
  Cookie: "XSRF-TOKEN=1;",
9602
9644
  "X-XSRF-TOKEN": "1"
9603
9645
  };
@@ -10079,24 +10121,24 @@ class $80c3ae34677b4324$var$Fixtures {
10079
10121
  doPost(url, body) {
10080
10122
  return this.request.post(url, {
10081
10123
  data: body,
10082
- headers: $80c3ae34677b4324$var$adminHeaders
10124
+ headers: $80c3ae34677b4324$export$1d40aa9bc568f58d
10083
10125
  });
10084
10126
  }
10085
10127
  doPut(url, body) {
10086
10128
  return this.request.put(url, {
10087
10129
  data: body,
10088
- headers: $80c3ae34677b4324$var$adminHeaders
10130
+ headers: $80c3ae34677b4324$export$1d40aa9bc568f58d
10089
10131
  });
10090
10132
  }
10091
10133
  doGet(url) {
10092
10134
  return this.request.get(url, {
10093
- headers: $80c3ae34677b4324$var$adminHeaders
10135
+ headers: $80c3ae34677b4324$export$1d40aa9bc568f58d
10094
10136
  });
10095
10137
  }
10096
10138
  doDelete(url, body) {
10097
10139
  return this.request.delete(url, {
10098
10140
  data: body,
10099
- headers: $80c3ae34677b4324$var$adminHeaders
10141
+ headers: $80c3ae34677b4324$export$1d40aa9bc568f58d
10100
10142
  });
10101
10143
  }
10102
10144
  initDefaults(ci) {