dh-auth-library 1.0.0 → 1.2.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/README.md +23 -12
- package/dist/auth/api/apiTokenHelper.d.ts +2 -2
- package/dist/auth/api/index.d.ts +0 -1
- package/dist/auth/api/sessionHandlerResolvers.d.ts +3 -6
- package/dist/auth/pages/digidLoginPage.d.ts +1 -1
- package/dist/auth/pages/eHerkenningLoginPage.d.ts +6 -7
- package/dist/auth/sessionHandler.d.ts +1 -1
- package/dist/auth/utils/sessionFileHelper.d.ts +9 -8
- package/dist/constants/accountTypes.d.ts +7 -29
- package/dist/constants/authTypes.d.ts +3 -0
- package/dist/constants/index.d.ts +1 -4
- package/dist/index.cjs.js +35 -333
- package/dist/index.es.js +34 -317
- package/package.json +55 -54
- package/dist/auth/api/apiAuthentication.d.ts +0 -10
- package/dist/constants/accounts.d.ts +0 -12
- package/dist/constants/testAccounts.d.ts +0 -38
- package/dist/constants/testProfiles.d.ts +0 -27
- package/dist/sha-B5xpXfPW.mjs +0 -911
- package/dist/sha-Eh0BcCJ_.js +0 -911
package/README.md
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# DH Authorizatoin Library
|
|
2
2
|
|
|
3
|
-
A Playwright library for
|
|
4
|
-
test
|
|
3
|
+
A Playwright library for all login implementations in Den Haag
|
|
5
4
|
|
|
6
5
|
it is published an npm package too and should be imported like that
|
|
7
6
|
|
|
@@ -9,27 +8,39 @@ it is published an npm package too and should be imported like that
|
|
|
9
8
|
|
|
10
9
|
## 📦 Purpose
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
Within DenHaag we will have several different repositories which will all have to use certain
|
|
12
|
+
types of login like AD, digid and eHerkenning.
|
|
13
|
+
|
|
14
|
+
In order to prevent each repo to have it's own implementation we created this library which
|
|
15
|
+
will take care of all login logic and even maintains the sessions during the testrun
|
|
15
16
|
|
|
16
17
|
---
|
|
17
18
|
|
|
18
19
|
## 🧱 Structure
|
|
19
20
|
|
|
20
21
|
packages/
|
|
21
|
-
├── auth/ #
|
|
22
|
-
├──
|
|
23
|
-
├── nl-portal/ # NL Portal pages, base_fixture and some utils that help with testing and testdata
|
|
22
|
+
├── auth/ # Contains all classes for handling login and sessions
|
|
23
|
+
├── constants/ # Constains accounts and types that can be used
|
|
24
24
|
|
|
25
25
|
---
|
|
26
26
|
|
|
27
27
|
## Auth
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
# api
|
|
30
|
+
|
|
31
|
+
Has the authentication logic for api calls for nl-portal
|
|
32
|
+
|
|
33
|
+
# loginhandlers
|
|
34
|
+
|
|
35
|
+
Has all the login handlers that are needed for the nl-portal-playwright-libraries
|
|
36
|
+
|
|
37
|
+
# pages
|
|
38
|
+
|
|
39
|
+
Has all the login pages and the login overview page
|
|
40
|
+
|
|
41
|
+
# utils
|
|
32
42
|
|
|
43
|
+
Has the sessionFileHelper which takes care of the filename for each session
|
|
33
44
|
|
|
34
45
|
## Publishing to npm
|
|
35
46
|
|
|
@@ -12,6 +12,6 @@ export type ApiFixtures = {
|
|
|
12
12
|
* Per specfile it is not problem but this should be done in every specfile to assure a valid token
|
|
13
13
|
*
|
|
14
14
|
* @param baseTest
|
|
15
|
-
* @param
|
|
15
|
+
* @param handler
|
|
16
16
|
*/
|
|
17
|
-
export declare function getApiTokenFromSession(baseTest: typeof base,
|
|
17
|
+
export declare function getApiTokenFromSession(baseTest: typeof base, handler: SessionHandler): import("@playwright/test").TestType<import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & ApiFixtures, import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions>;
|
package/dist/auth/api/index.d.ts
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare function
|
|
4
|
-
export declare function getDigidGemachtigdeSessionHandler(): import("nl-portal-playwright-libraries").SessionHandler;
|
|
5
|
-
export declare function getEHerkenningBewindvoerderSessionHandler(): import("nl-portal-playwright-libraries").SessionHandler;
|
|
6
|
-
export declare function getAdSessionHandler(): import("nl-portal-playwright-libraries").SessionHandler;
|
|
1
|
+
import { Account } from 'nl-portal-playwright-libraries';
|
|
2
|
+
import { AuthType } from '../../constants/authTypes';
|
|
3
|
+
export declare function getSessionHandler(authType: AuthType, account: Account): import("nl-portal-playwright-libraries").SessionHandler;
|
|
@@ -10,6 +10,6 @@ export declare class DigidLoginPage extends LoginOverzichtPage {
|
|
|
10
10
|
* Je krijgt dan een speciaal scherm waar je moet bevestigen voordat je door kan
|
|
11
11
|
*/
|
|
12
12
|
handleAnySpecialADLoginScreen(): Promise<void>;
|
|
13
|
-
loginWithDigid(account
|
|
13
|
+
loginWithDigid(account: Account, gemachtigde?: boolean): Promise<import("@playwright/test").Response>;
|
|
14
14
|
loginAlsDigidGemachtigde(): Promise<void>;
|
|
15
15
|
}
|
|
@@ -12,11 +12,10 @@ export declare class EHerkenningLoginPage extends LoginOverzichtPage {
|
|
|
12
12
|
private readonly inputBsn;
|
|
13
13
|
private readonly buttonZoek;
|
|
14
14
|
constructor(page: Page);
|
|
15
|
-
probeerInTeLoggenMetEHerkenning(account
|
|
16
|
-
loginWithEHerkenningAndCreateSession(fileName: string, account
|
|
17
|
-
loginWithEHerkenning(account
|
|
18
|
-
loginWithEHerkenningVestigingAndCreateSession(fileName: string, account
|
|
19
|
-
loginWithEHerkenningVestiging(account
|
|
20
|
-
loginAlsProfessioneelBewindvoerder(gemachtigde
|
|
21
|
-
valideerDatNietGemachtigdBerichtZichtbaarIs(): Promise<void>;
|
|
15
|
+
probeerInTeLoggenMetEHerkenning(account: Account): Promise<void>;
|
|
16
|
+
loginWithEHerkenningAndCreateSession(fileName: string, account: Account): Promise<void>;
|
|
17
|
+
loginWithEHerkenning(account: Account): Promise<void>;
|
|
18
|
+
loginWithEHerkenningVestigingAndCreateSession(fileName: string, account: Account): Promise<void>;
|
|
19
|
+
loginWithEHerkenningVestiging(account: Account): Promise<void>;
|
|
20
|
+
loginAlsProfessioneelBewindvoerder(gemachtigde: Account, file?: string): Promise<void>;
|
|
22
21
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Account, SessionHandler } from 'nl-portal-playwright-libraries';
|
|
2
|
-
import { AuthType } from '../constants/authTypes';
|
|
3
2
|
import { LoginHandler } from '../constants/loginHandler';
|
|
3
|
+
import { AuthType } from '../constants';
|
|
4
4
|
export declare const MAX_SESSION_TIME_IN_MINUTES = 10;
|
|
5
5
|
/**
|
|
6
6
|
* This class creates the correct SessionHandler
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { Browser } from '@playwright/test';
|
|
2
|
+
import { Account } from 'nl-portal-playwright-libraries';
|
|
2
3
|
/**
|
|
3
4
|
* Easy way to create the filenames for the sessions
|
|
4
5
|
*/
|
|
5
6
|
export declare class SessionFileHelper {
|
|
6
|
-
static getLocalhostFileName(browser: Browser): string;
|
|
7
|
-
static getLocalhostFileNameBedrijf(browser: Browser): string;
|
|
8
|
-
static getDigidFileName(browser: Browser): string;
|
|
9
|
-
static getDigidGemachtigdeFileName(browser: Browser): string;
|
|
10
|
-
static getEHerkenningFileName(browser: Browser): string;
|
|
11
|
-
static getEHerkenningVestigingFileName(browser: Browser): string;
|
|
12
|
-
static getEHerkenningBewindvoerderFileName(browser: Browser): string;
|
|
13
|
-
static getADFileName(browser: Browser): string;
|
|
7
|
+
static getLocalhostFileName(browser: Browser, account: Account): string;
|
|
8
|
+
static getLocalhostFileNameBedrijf(browser: Browser, account: Account): string;
|
|
9
|
+
static getDigidFileName(browser: Browser, account: Account): string;
|
|
10
|
+
static getDigidGemachtigdeFileName(browser: Browser, account: Account): string;
|
|
11
|
+
static getEHerkenningFileName(browser: Browser, account: Account): string;
|
|
12
|
+
static getEHerkenningVestigingFileName(browser: Browser, account: Account): string;
|
|
13
|
+
static getEHerkenningBewindvoerderFileName(browser: Browser, account: Account): string;
|
|
14
|
+
static getADFileName(browser: Browser, account: Account): string;
|
|
14
15
|
}
|
|
@@ -1,34 +1,12 @@
|
|
|
1
1
|
import { AuthType } from './authTypes';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Interface for TestProfiles
|
|
4
|
+
* accountId should be used for identifying the account
|
|
5
|
+
* authType is used to determine the type of authentication (digid, eHerkenning etc)
|
|
6
|
+
* id can be used for extra information like bsn number or kvk number
|
|
7
|
+
*/
|
|
3
8
|
export interface TestProfile {
|
|
4
|
-
|
|
9
|
+
accountId: string;
|
|
5
10
|
authType: AuthType;
|
|
6
11
|
id: string;
|
|
7
12
|
}
|
|
8
|
-
export declare const profiles: {
|
|
9
|
-
burger: {
|
|
10
|
-
accountType: "burger";
|
|
11
|
-
authType: "digid";
|
|
12
|
-
id: string;
|
|
13
|
-
};
|
|
14
|
-
bedrijf: {
|
|
15
|
-
accountType: "bedrijf";
|
|
16
|
-
authType: "eherkenning";
|
|
17
|
-
id: string;
|
|
18
|
-
};
|
|
19
|
-
vestiging: {
|
|
20
|
-
accountType: "vestiging";
|
|
21
|
-
authType: "eherkenning_vestiging";
|
|
22
|
-
id: string;
|
|
23
|
-
};
|
|
24
|
-
gemachtigde: {
|
|
25
|
-
accountType: "digid-gemachtigde";
|
|
26
|
-
authType: "digid_gemachtigde";
|
|
27
|
-
id: string;
|
|
28
|
-
};
|
|
29
|
-
bewindvoerder: {
|
|
30
|
-
accountType: "bedrijf";
|
|
31
|
-
authType: "eherkenning_bewindvoerder";
|
|
32
|
-
id: string;
|
|
33
|
-
};
|
|
34
|
-
};
|