@digital-ai/devops-page-object-release 0.0.0-snapshot-20260120112719 → 0.0.0-snapshot-20260121070533
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 +75 -41
- package/dist/main.js.map +1 -1
- package/dist/module.js +76 -42
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +1 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/main.js
CHANGED
|
@@ -10320,53 +10320,87 @@ class $4ef41cf96a5fae4c$export$b8a61e5c71402559 {
|
|
|
10320
10320
|
|
|
10321
10321
|
|
|
10322
10322
|
|
|
10323
|
-
|
|
10324
10323
|
class $258749e0671c845a$export$f14c0e3f98d164c0 extends (0, $f8721861c660dd88$export$2b65d1d97338f32b) {
|
|
10325
10324
|
/**
|
|
10326
10325
|
* Login with username and password
|
|
10327
10326
|
* @param userName
|
|
10328
10327
|
* @param password
|
|
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
|
-
|
|
10355
|
-
|
|
10356
|
-
|
|
10357
|
-
|
|
10358
|
-
|
|
10359
|
-
|
|
10360
|
-
|
|
10361
|
-
|
|
10362
|
-
|
|
10363
|
-
|
|
10364
|
-
|
|
10365
|
-
|
|
10366
|
-
|
|
10367
|
-
|
|
10368
|
-
|
|
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
|
+
}*/ async login(userName, password) {
|
|
10380
|
+
const testEnv = undefined ?? "local";
|
|
10381
|
+
await this.page.goto("./");
|
|
10382
|
+
if (testEnv === "saas") {
|
|
10383
|
+
await this.page.locator("input#username").fill(userName, {
|
|
10384
|
+
timeout: 10000
|
|
10385
|
+
});
|
|
10386
|
+
await this.page.locator("input#password").fill(password, {
|
|
10387
|
+
timeout: 10000
|
|
10388
|
+
});
|
|
10389
|
+
} else {
|
|
10390
|
+
await this.page.getByPlaceholder("User").fill(userName, {
|
|
10391
|
+
timeout: 10000
|
|
10392
|
+
});
|
|
10393
|
+
await this.page.getByPlaceholder("Password").fill(password, {
|
|
10394
|
+
timeout: 10000
|
|
10395
|
+
});
|
|
10369
10396
|
}
|
|
10397
|
+
await this.page.locator('button[type="submit"]').click();
|
|
10398
|
+
//await expect(this.page).toHaveTitle('Digital.ai Release');
|
|
10399
|
+
//await this.page.locator('input#username').fill(userName, { timeout: 1000 });
|
|
10400
|
+
//await this.page.locator('input#password').fill(password, { timeout: 10000 });
|
|
10401
|
+
//await this.page.getByRole('button', { name: 'Log in' }).click({ timeout: 10000 });
|
|
10402
|
+
await this.page.waitForTimeout(1000);
|
|
10403
|
+
await this.closePendoModalWindow();
|
|
10370
10404
|
}
|
|
10371
10405
|
async loginWithoutReload(userName, password) {
|
|
10372
10406
|
let loadTriggered = false;
|