@digital-ai/devops-page-object-release 0.0.0-snapshot-20260121132732 → 0.0.0-snapshot-20260122084417

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
@@ -9446,7 +9446,32 @@ class $4444bee76761dfb1$export$f14c0e3f98d164c0 extends (0, $9626bc9256ce31f7$ex
9446
9446
  timeout: 15000,
9447
9447
  });
9448
9448
  }*/ async login(userName, password) {
9449
- throw new Error("TEST_ENV is not defined. Aborting login.");
9449
+ await this.page.goto("./");
9450
+ const localPassword = this.page.getByPlaceholder("Password");
9451
+ if (await localPassword.isVisible({
9452
+ timeout: 3000
9453
+ }).catch(()=>false)) {
9454
+ await this.page.getByPlaceholder("User").fill(userName);
9455
+ await localPassword.fill(password);
9456
+ } else {
9457
+ const usernameInput = this.page.locator('input[name="username"]');
9458
+ await usernameInput.waitFor({
9459
+ state: "visible",
9460
+ timeout: 10000
9461
+ });
9462
+ await usernameInput.fill(userName);
9463
+ const passwordInput = this.page.locator('input[type="password"]');
9464
+ await passwordInput.waitFor({
9465
+ state: "visible",
9466
+ timeout: 10000
9467
+ });
9468
+ await passwordInput.fill(password);
9469
+ }
9470
+ await this.page.getByRole("button", {
9471
+ name: /log in|sign in/i
9472
+ }).click();
9473
+ await this.page.waitForTimeout(1000);
9474
+ await this.closePendoModalWindow();
9450
9475
  }
9451
9476
  async loginWithoutReload(userName, password) {
9452
9477
  let loadTriggered = false;