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

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,6 +1,6 @@
1
1
  # @digital-ai/devops-page-object-release
2
2
 
3
- ## 0.0.0-snapshot-20260122084417
3
+ ## 0.0.0-snapshot-20260122113824
4
4
 
5
5
  ### Patch Changes
6
6
 
package/dist/main.js CHANGED
@@ -10325,83 +10325,25 @@ class $258749e0671c845a$export$f14c0e3f98d164c0 extends (0, $f8721861c660dd88$ex
10325
10325
  * Login with username and password
10326
10326
  * @param userName
10327
10327
  * @param password
10328
- */ /*async login(
10329
- userName: string | undefined = process.env.TEST_USERNAME,
10330
- password: string | undefined = process.env.TEST_PASSWORD,
10331
- ): Promise<void> {
10332
- const baseUrl = process.env.BASE_URL;
10333
- process.stdout.write(`[ENV] TEST_ENV=${process.env.TEST_ENV}\n`);
10334
- process.stdout.write(`[ENV] BASE_URL=${process.env.BASE_URL}\n`);
10335
- process.stdout.write(`[ENV] TEST_USERNAME=${process.env.TEST_USERNAME}\n`);
10336
- if (!baseUrl || !userName || !password) {
10337
- throw new Error('Missing BASE_URL or TEST_USERNAME or TEST_PASSWORD in environment variables');
10338
- }
10339
-
10340
- await this.page.goto(baseUrl, { waitUntil: 'domcontentloaded' });
10341
- const usernameInput = this.getUsernameInput();
10342
- const passwordInput = this.getPasswordInput();
10343
-
10344
- await usernameInput.fill(userName);
10345
- await passwordInput.fill(password);
10346
- await this.page.getByRole('button', { name: /log in|sign in/i }).click();
10347
- expect(this.page.getByText('Digital.ai Release Home'));
10348
- await this.closePendoModalWindow();
10349
- }
10350
-
10351
- private getUsernameInput(): Locator {
10352
- const env = process.env.TEST_ENV ?? 'local';
10353
-
10354
- switch (env) {
10355
- case 'local':
10356
- return this.page.getByPlaceholder('User');
10357
-
10358
- case 'saas':
10359
- return this.page.locator('input#username');
10360
-
10361
- default:
10362
- throw new Error(`Unsupported TEST_ENV value: ${env}`);
10363
- }
10364
- }
10365
-
10366
- private getPasswordInput(): Locator {
10367
- const env = process.env.TEST_ENV ?? 'local';
10368
-
10369
- switch (env) {
10370
- case 'local':
10371
- return this.page.getByPlaceholder('Password');
10372
-
10373
- case 'saas':
10374
- return this.page.locator('input#password');
10375
-
10376
- default:
10377
- throw new Error(`Unsupported TEST_ENV value: ${env}`);
10378
- }
10379
- }*/ /* private async waitForKeycloakLogin(): Promise<void> {
10380
- await this.page.waitForSelector('form#kc-form-login', {
10381
- state: 'visible',
10382
- timeout: 15000,
10383
- });
10384
- }*/ async login(userName, password) {
10328
+ */ async login(userName, password) {
10385
10329
  await this.page.goto("./");
10386
10330
  const localPassword = this.page.getByPlaceholder("Password");
10387
- if (await localPassword.isVisible({
10388
- timeout: 3000
10389
- }).catch(()=>false)) {
10390
- await this.page.getByPlaceholder("User").fill(userName);
10391
- await localPassword.fill(password);
10392
- } else {
10331
+ if (this.page.url().includes("/auth/realms")) {
10393
10332
  const usernameInput = this.page.locator('input[name="username"]');
10394
10333
  await usernameInput.waitFor({
10395
10334
  state: "visible",
10396
10335
  timeout: 10000
10397
10336
  });
10398
10337
  await usernameInput.fill(userName);
10399
- const passwordInput = this.page.locator('input[type="password"]');
10338
+ const passwordInput = this.page.locator('input[name="password"]');
10400
10339
  await passwordInput.waitFor({
10401
10340
  state: "visible",
10402
10341
  timeout: 10000
10403
10342
  });
10404
10343
  await passwordInput.fill(password);
10344
+ } else {
10345
+ await this.page.getByPlaceholder("User").fill(userName);
10346
+ await localPassword.fill(password);
10405
10347
  }
10406
10348
  await this.page.getByRole("button", {
10407
10349
  name: /log in|sign in/i