dh-auth-library 2.0.1 → 2.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dh-auth-library",
3
- "version": "2.0.1",
3
+ "version": "2.1.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/Gemeente-DenHaag/dh-auth-library.git"
@@ -1,71 +0,0 @@
1
- import { Locator, Page } from '@playwright/test';
2
- import { BasePage } from 'nl-portal-playwright-libraries';
3
- /**
4
- * Where and how to start the login, supplied by the consumer of this library. Applies to whichever
5
- * auth type the login handler is created for; for `ad-session`, `startUrl` is the required app
6
- * behind the firewall.
7
- *
8
- * @example
9
- * // Klantportaal (starts from PORTAL_BASE_URL)
10
- * getLoginHandler('digid', {
11
- * loginButton: (page) => page.locator('#oidc-digid'),
12
- * cookieButton: (page) => page.locator('#ppms_cm_agree-to-all'),
13
- * });
14
- *
15
- * @example
16
- * // Open Forms: start on the form and click its DigiD button
17
- * getLoginHandler('digid', {
18
- * startUrl: 'https://openformulieren-zgw.acc.denhaag.nl/<form>/startpagina',
19
- * loginButton: (page) => page.getByRole('link', { name: 'Inloggen met DigiD' }),
20
- * cookieButton: (page) => page.locator('button[class*="cookie-notice__accept"]'),
21
- * });
22
- */
23
- export interface LoginOptions {
24
- /**
25
- * Returns the button that starts the login. A function because the page doesn't exist yet when
26
- * the login handler is created. Required for DigiD; eHerkenning doesn't use these options yet.
27
- */
28
- loginButton?: (page: Page) => Locator;
29
- /** URL of the page with the login button. Defaults to `PORTAL_BASE_URL`. */
30
- startUrl?: string;
31
- /**
32
- * Returns the button that accepts the app's cookie banner after logging in, so the consent is
33
- * saved in the session. Left out, no cookie banner is accepted.
34
- */
35
- cookieButton?: (page: Page) => Locator;
36
- }
37
- /** {@link LoginOptions} for logins that start from a button in the app (e.g. DigiD), so `loginButton` is required. */
38
- export type LoginOptionsWithButton = LoginOptions & Required<Pick<LoginOptions, 'loginButton'>>;
39
- export declare class LoginOverzichtPage extends BasePage {
40
- digidLoginButton: Locator;
41
- digidMachtigenLoginButton: Locator;
42
- eHerkenningLoginButton: Locator;
43
- eHerkenningMachtigingLoginButton: Locator;
44
- klantportaalCookieButton: Locator;
45
- constructor(page: Page);
46
- /**
47
- * Clicks the button that starts the login flow. Not every consumer has the login overzicht
48
- * page (e.g. Open Forms), so the button to click can be supplied by the consumer.
49
- *
50
- * @param loginButton the button that starts the login flow
51
- */
52
- clickLoginButton(loginButton: Locator): Promise<void>;
53
- clickDigidLoginOption(): Promise<void>;
54
- clickDigidMachtigenLoginOption(): Promise<void>;
55
- clickEHerkenningLoginOption(): Promise<void>;
56
- clickProfessionalBewindvoerderLoginOption(): Promise<void>;
57
- verifyLoginOverviewIsVisible(): Promise<void>;
58
- /**
59
- * Accepts the cookie banner and waits until the consent is stored in a cookie; skipped when the
60
- * banner doesn't show within 10 seconds.
61
- *
62
- * @param cookieButton the button that accepts the cookie banner, defaults to the klantportaal banner
63
- */
64
- acceptCookies(cookieButton?: Locator): Promise<void>;
65
- /**
66
- * Waits until the cookies differ from `cookiesBefore` and have not changed for a second, at most 10 seconds.
67
- */
68
- private waitForCookiesToSettle;
69
- private cookiesAsText;
70
- reloadPage(): Promise<void>;
71
- }