@digital-ai/devops-page-object-release 0.0.0-snapshot-20260122094725 → 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 +1 -1
- package/dist/main.js +25 -78
- package/dist/main.js.map +1 -1
- package/dist/module.js +25 -78
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/main.js
CHANGED
|
@@ -10325,84 +10325,31 @@ class $258749e0671c845a$export$f14c0e3f98d164c0 extends (0, $f8721861c660dd88$ex
|
|
|
10325
10325
|
* Login with username and password
|
|
10326
10326
|
* @param userName
|
|
10327
10327
|
* @param password
|
|
10328
|
-
*/
|
|
10329
|
-
|
|
10330
|
-
|
|
10331
|
-
|
|
10332
|
-
|
|
10333
|
-
|
|
10334
|
-
|
|
10335
|
-
|
|
10336
|
-
|
|
10337
|
-
|
|
10338
|
-
|
|
10339
|
-
|
|
10340
|
-
|
|
10341
|
-
|
|
10342
|
-
|
|
10343
|
-
|
|
10344
|
-
|
|
10345
|
-
|
|
10346
|
-
|
|
10347
|
-
|
|
10348
|
-
|
|
10349
|
-
|
|
10350
|
-
|
|
10351
|
-
|
|
10352
|
-
|
|
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: string, password: string): Promise<void> {
|
|
10385
|
-
await this.page.goto('./');
|
|
10386
|
-
|
|
10387
|
-
const localPassword = this.page.getByPlaceholder('Password');
|
|
10388
|
-
|
|
10389
|
-
if (await localPassword.isVisible({ timeout: 3000 }).catch(() => false)) {
|
|
10390
|
-
await this.page.getByPlaceholder('User').fill(userName);
|
|
10391
|
-
await localPassword.fill(password);
|
|
10392
|
-
} else {
|
|
10393
|
-
const usernameInput = this.page.locator('input[name="username"]');
|
|
10394
|
-
await usernameInput.waitFor({ state: 'visible', timeout: 10000 });
|
|
10395
|
-
await usernameInput.fill(userName);
|
|
10396
|
-
|
|
10397
|
-
const passwordInput = this.page.locator('input[type="password"]');
|
|
10398
|
-
await passwordInput.waitFor({ state: 'visible', timeout: 10000 });
|
|
10399
|
-
await passwordInput.fill(password);
|
|
10400
|
-
}
|
|
10401
|
-
await this.page.getByRole('button', { name: /log in|sign in/i }).click();
|
|
10402
|
-
await this.page.waitForTimeout(1000);
|
|
10403
|
-
await this.closePendoModalWindow();
|
|
10404
|
-
}*/ async login(userName, password) {
|
|
10405
|
-
throw new Error("TEST_ENV is not defined. Aborting login.");
|
|
10328
|
+
*/ async login(userName, password) {
|
|
10329
|
+
await this.page.goto("./");
|
|
10330
|
+
const localPassword = this.page.getByPlaceholder("Password");
|
|
10331
|
+
if (this.page.url().includes("/auth/realms")) {
|
|
10332
|
+
const usernameInput = this.page.locator('input[name="username"]');
|
|
10333
|
+
await usernameInput.waitFor({
|
|
10334
|
+
state: "visible",
|
|
10335
|
+
timeout: 10000
|
|
10336
|
+
});
|
|
10337
|
+
await usernameInput.fill(userName);
|
|
10338
|
+
const passwordInput = this.page.locator('input[name="password"]');
|
|
10339
|
+
await passwordInput.waitFor({
|
|
10340
|
+
state: "visible",
|
|
10341
|
+
timeout: 10000
|
|
10342
|
+
});
|
|
10343
|
+
await passwordInput.fill(password);
|
|
10344
|
+
} else {
|
|
10345
|
+
await this.page.getByPlaceholder("User").fill(userName);
|
|
10346
|
+
await localPassword.fill(password);
|
|
10347
|
+
}
|
|
10348
|
+
await this.page.getByRole("button", {
|
|
10349
|
+
name: /log in|sign in/i
|
|
10350
|
+
}).click();
|
|
10351
|
+
await this.page.waitForTimeout(1000);
|
|
10352
|
+
await this.closePendoModalWindow();
|
|
10406
10353
|
}
|
|
10407
10354
|
async loginWithoutReload(userName, password) {
|
|
10408
10355
|
let loadTriggered = false;
|