@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # @digital-ai/devops-page-object-release
2
2
 
3
- ## 0.0.0-snapshot-20260120112719
3
+ ## 0.0.0-snapshot-20260121070533
4
4
 
5
5
  ### Patch Changes
6
6
 
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
- * @param baseUrl
10330
- */ async login(userName, password) {
10331
- const baseUrl = undefined;
10332
- $kKeXs$process.stdout.write(`[ENV] TEST_ENV=${undefined}\n`);
10333
- $kKeXs$process.stdout.write(`[ENV] BASE_URL=${undefined}\n`);
10334
- $kKeXs$process.stdout.write(`[ENV] TEST_USERNAME=${undefined}\n`);
10335
- if (!baseUrl || !userName || !password) throw new Error("Missing BASE_URL or TEST_USERNAME or TEST_PASSWORD in environment variables");
10336
- await this.page.goto(baseUrl, {
10337
- waitUntil: "domcontentloaded"
10338
- });
10339
- const usernameInput = this.getUsernameInput();
10340
- const passwordInput = this.getPasswordInput();
10341
- await usernameInput.fill(userName);
10342
- await passwordInput.fill(password);
10343
- await this.page.getByRole("button", {
10344
- name: /log in|sign in/i
10345
- }).click();
10346
- (0, $kKeXs$playwrighttest.expect)(this.page.getByText("Digital.ai Release Home"));
10347
- await this.closePendoModalWindow();
10348
- }
10349
- getUsernameInput() {
10350
- const env = undefined ?? "local";
10351
- switch(env){
10352
- case "local":
10353
- return this.page.getByPlaceholder("User");
10354
- case "saas":
10355
- return this.page.locator("input#username");
10356
- default:
10357
- throw new Error(`Unsupported TEST_ENV value: ${env}`);
10358
- }
10359
- }
10360
- getPasswordInput() {
10361
- const env = undefined ?? "local";
10362
- switch(env){
10363
- case "local":
10364
- return this.page.getByPlaceholder("Password");
10365
- case "saas":
10366
- return this.page.locator("input#password");
10367
- default:
10368
- throw new Error(`Unsupported TEST_ENV value: ${env}`);
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;