dh-auth-library 2.3.0 → 2.4.0
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/index.cjs.js +10 -8
- package/dist/index.es.js +10 -8
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -156,7 +156,9 @@ var ADLoginPage = class ADLoginPage extends nl_portal_playwright_libraries.BaseP
|
|
|
156
156
|
await adLoginPage.usernameInput.waitFor();
|
|
157
157
|
await adLoginPage.usernameInput.fill(account.username);
|
|
158
158
|
await adLoginPage.nextInput.click();
|
|
159
|
-
|
|
159
|
+
const usePasswordLink = this.page.getByText("Uw wachtwoord gebruiken");
|
|
160
|
+
await usePasswordLink.or(adLoginPage.passwordInput).filter({ visible: true }).first().waitFor();
|
|
161
|
+
if (await usePasswordLink.isVisible()) await usePasswordLink.click();
|
|
160
162
|
}
|
|
161
163
|
});
|
|
162
164
|
let sessionWasStale = false;
|
|
@@ -372,7 +374,7 @@ var DigidLoginPage = class extends BaseLoginPage {
|
|
|
372
374
|
await _playwright_test.test.step("Login with DigiD as gemachtigde and create session", async () => {
|
|
373
375
|
await this.openPage(startUrl);
|
|
374
376
|
await this.handleAnySpecialADLoginScreen();
|
|
375
|
-
this.page.waitForLoadState("networkidle");
|
|
377
|
+
await this.page.waitForLoadState("networkidle", { timeout: 1e4 }).catch(() => {});
|
|
376
378
|
try {
|
|
377
379
|
await loginButton.click();
|
|
378
380
|
} catch (_error) {
|
|
@@ -391,7 +393,7 @@ var DigidLoginPage = class extends BaseLoginPage {
|
|
|
391
393
|
*/
|
|
392
394
|
async handleAnySpecialADLoginScreen() {
|
|
393
395
|
try {
|
|
394
|
-
this.page.waitForLoadState("networkidle");
|
|
396
|
+
await this.page.waitForLoadState("networkidle", { timeout: 1e4 }).catch(() => {});
|
|
395
397
|
await this.page.locator(`//div[contains(@data-test-id,'${node_process.default.env.AD_USER}')]`).first().waitFor({ timeout: 1e3 });
|
|
396
398
|
await this.page.locator(`//div[contains(@data-test-id,'${node_process.default.env.AD_USER}')]`).first().click();
|
|
397
399
|
} catch (_error) {}
|
|
@@ -499,13 +501,13 @@ var EHerkenningLoginPage = class extends BaseLoginPage {
|
|
|
499
501
|
const loginButton = options.loginButton(this.page);
|
|
500
502
|
const { startUrl } = options;
|
|
501
503
|
await this.openPage(startUrl);
|
|
502
|
-
this.page.waitForLoadState("networkidle");
|
|
504
|
+
await this.page.waitForLoadState("networkidle", { timeout: 1e4 }).catch(() => {});
|
|
503
505
|
try {
|
|
504
506
|
await loginButton.click();
|
|
505
507
|
} catch (_error) {
|
|
506
508
|
console.error(`EHerkenning Loginbutton click failed with error: ${_error}`);
|
|
507
509
|
await this.openPage();
|
|
508
|
-
this.page.waitForLoadState("networkidle");
|
|
510
|
+
await this.page.waitForLoadState("networkidle", { timeout: 1e4 }).catch(() => {});
|
|
509
511
|
await this.loginButton.click();
|
|
510
512
|
}
|
|
511
513
|
await this.loginWithEHerkenning(account, options);
|
|
@@ -534,13 +536,13 @@ var EHerkenningLoginPage = class extends BaseLoginPage {
|
|
|
534
536
|
const loginButton = options.loginButton(this.page);
|
|
535
537
|
const { startUrl } = options;
|
|
536
538
|
await this.openPage(startUrl);
|
|
537
|
-
this.page.waitForLoadState("networkidle");
|
|
539
|
+
await this.page.waitForLoadState("networkidle", { timeout: 1e4 }).catch(() => {});
|
|
538
540
|
try {
|
|
539
541
|
await loginButton.click();
|
|
540
542
|
} catch (_error) {
|
|
541
543
|
console.error(`EHerkenning Loginbutton click failed with error: ${_error}`);
|
|
542
544
|
await this.openPage();
|
|
543
|
-
this.page.waitForLoadState("networkidle");
|
|
545
|
+
await this.page.waitForLoadState("networkidle", { timeout: 1e4 }).catch(() => {});
|
|
544
546
|
await loginButton.click();
|
|
545
547
|
}
|
|
546
548
|
await this.loginWithEHerkenningVestiging(account, options);
|
|
@@ -569,7 +571,7 @@ var EHerkenningLoginPage = class extends BaseLoginPage {
|
|
|
569
571
|
const loginButton = options.loginButton(this.page);
|
|
570
572
|
const { startUrl } = options;
|
|
571
573
|
await this.openPage(startUrl);
|
|
572
|
-
this.page.waitForLoadState("networkidle");
|
|
574
|
+
await this.page.waitForLoadState("networkidle", { timeout: 1e4 }).catch(() => {});
|
|
573
575
|
await loginButton.click();
|
|
574
576
|
});
|
|
575
577
|
await _playwright_test.test.step("Login with eHerkenning credentials as bewindvoerder", async () => {
|
package/dist/index.es.js
CHANGED
|
@@ -132,7 +132,9 @@ var ADLoginPage = class ADLoginPage extends BasePage {
|
|
|
132
132
|
await adLoginPage.usernameInput.waitFor();
|
|
133
133
|
await adLoginPage.usernameInput.fill(account.username);
|
|
134
134
|
await adLoginPage.nextInput.click();
|
|
135
|
-
|
|
135
|
+
const usePasswordLink = this.page.getByText("Uw wachtwoord gebruiken");
|
|
136
|
+
await usePasswordLink.or(adLoginPage.passwordInput).filter({ visible: true }).first().waitFor();
|
|
137
|
+
if (await usePasswordLink.isVisible()) await usePasswordLink.click();
|
|
136
138
|
}
|
|
137
139
|
});
|
|
138
140
|
let sessionWasStale = false;
|
|
@@ -348,7 +350,7 @@ var DigidLoginPage = class extends BaseLoginPage {
|
|
|
348
350
|
await test.step("Login with DigiD as gemachtigde and create session", async () => {
|
|
349
351
|
await this.openPage(startUrl);
|
|
350
352
|
await this.handleAnySpecialADLoginScreen();
|
|
351
|
-
this.page.waitForLoadState("networkidle");
|
|
353
|
+
await this.page.waitForLoadState("networkidle", { timeout: 1e4 }).catch(() => {});
|
|
352
354
|
try {
|
|
353
355
|
await loginButton.click();
|
|
354
356
|
} catch (_error) {
|
|
@@ -367,7 +369,7 @@ var DigidLoginPage = class extends BaseLoginPage {
|
|
|
367
369
|
*/
|
|
368
370
|
async handleAnySpecialADLoginScreen() {
|
|
369
371
|
try {
|
|
370
|
-
this.page.waitForLoadState("networkidle");
|
|
372
|
+
await this.page.waitForLoadState("networkidle", { timeout: 1e4 }).catch(() => {});
|
|
371
373
|
await this.page.locator(`//div[contains(@data-test-id,'${process$1.env.AD_USER}')]`).first().waitFor({ timeout: 1e3 });
|
|
372
374
|
await this.page.locator(`//div[contains(@data-test-id,'${process$1.env.AD_USER}')]`).first().click();
|
|
373
375
|
} catch (_error) {}
|
|
@@ -475,13 +477,13 @@ var EHerkenningLoginPage = class extends BaseLoginPage {
|
|
|
475
477
|
const loginButton = options.loginButton(this.page);
|
|
476
478
|
const { startUrl } = options;
|
|
477
479
|
await this.openPage(startUrl);
|
|
478
|
-
this.page.waitForLoadState("networkidle");
|
|
480
|
+
await this.page.waitForLoadState("networkidle", { timeout: 1e4 }).catch(() => {});
|
|
479
481
|
try {
|
|
480
482
|
await loginButton.click();
|
|
481
483
|
} catch (_error) {
|
|
482
484
|
console.error(`EHerkenning Loginbutton click failed with error: ${_error}`);
|
|
483
485
|
await this.openPage();
|
|
484
|
-
this.page.waitForLoadState("networkidle");
|
|
486
|
+
await this.page.waitForLoadState("networkidle", { timeout: 1e4 }).catch(() => {});
|
|
485
487
|
await this.loginButton.click();
|
|
486
488
|
}
|
|
487
489
|
await this.loginWithEHerkenning(account, options);
|
|
@@ -510,13 +512,13 @@ var EHerkenningLoginPage = class extends BaseLoginPage {
|
|
|
510
512
|
const loginButton = options.loginButton(this.page);
|
|
511
513
|
const { startUrl } = options;
|
|
512
514
|
await this.openPage(startUrl);
|
|
513
|
-
this.page.waitForLoadState("networkidle");
|
|
515
|
+
await this.page.waitForLoadState("networkidle", { timeout: 1e4 }).catch(() => {});
|
|
514
516
|
try {
|
|
515
517
|
await loginButton.click();
|
|
516
518
|
} catch (_error) {
|
|
517
519
|
console.error(`EHerkenning Loginbutton click failed with error: ${_error}`);
|
|
518
520
|
await this.openPage();
|
|
519
|
-
this.page.waitForLoadState("networkidle");
|
|
521
|
+
await this.page.waitForLoadState("networkidle", { timeout: 1e4 }).catch(() => {});
|
|
520
522
|
await loginButton.click();
|
|
521
523
|
}
|
|
522
524
|
await this.loginWithEHerkenningVestiging(account, options);
|
|
@@ -545,7 +547,7 @@ var EHerkenningLoginPage = class extends BaseLoginPage {
|
|
|
545
547
|
const loginButton = options.loginButton(this.page);
|
|
546
548
|
const { startUrl } = options;
|
|
547
549
|
await this.openPage(startUrl);
|
|
548
|
-
this.page.waitForLoadState("networkidle");
|
|
550
|
+
await this.page.waitForLoadState("networkidle", { timeout: 1e4 }).catch(() => {});
|
|
549
551
|
await loginButton.click();
|
|
550
552
|
});
|
|
551
553
|
await test.step("Login with eHerkenning credentials as bewindvoerder", async () => {
|