@ministryofjustice/hmpps-probation-integration-e2e-tests 1.204.0 → 1.206.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,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ministryofjustice/hmpps-probation-integration-e2e-tests",
|
|
3
3
|
"description": "Playwright end to end tests for hmpps-probation-integration-services.",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.206.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/ministryofjustice/hmpps-probation-integration-e2e-tests#readme",
|
|
7
7
|
"bugs": {
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
"./steps/api/esupervision/esupervision": "./steps/api/esupervision/esupervision.mjs",
|
|
46
46
|
"./steps/api/external-api/external-api": "./steps/api/external-api/external-api.mjs",
|
|
47
47
|
"./steps/api/prison-identifier-and-delius/prison-identifier-and-delius": "./steps/api/prison-identifier-and-delius/prison-identifier-and-delius.mjs",
|
|
48
|
+
"./steps/api/probation-access-control/probation-access-control": "./steps/api/probation-access-control/probation-access-control.mjs",
|
|
48
49
|
"./steps/api/resettlement-passport/resettlement-passport-api": "./steps/api/resettlement-passport/resettlement-passport-api.mjs",
|
|
49
50
|
"./steps/api/sentence-plan/sentence-plan-and-delius": "./steps/api/sentence-plan/sentence-plan-and-delius.mjs",
|
|
50
51
|
"./steps/api/utils/api-utils": "./steps/api/utils/api-utils.mjs",
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as _$playwright_core0 from "playwright-core";
|
|
2
|
+
|
|
3
|
+
//#region steps/api/probation-access-control/probation-access-control.d.ts
|
|
4
|
+
declare function getAccessControlForUserAndPerson(user: string, crn: string): Promise<_$playwright_core0.APIResponse>;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { getAccessControlForUserAndPerson };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { getToken } from "../auth/get-token.mjs";
|
|
2
|
+
import { request } from "@playwright/test";
|
|
3
|
+
//#region steps/api/probation-access-control/probation-access-control.ts
|
|
4
|
+
async function getContext() {
|
|
5
|
+
const token = await getToken();
|
|
6
|
+
return request.newContext({
|
|
7
|
+
baseURL: process.env.PROBATION_ACCESS_CONTROL_API,
|
|
8
|
+
extraHTTPHeaders: {
|
|
9
|
+
Accept: "application/json",
|
|
10
|
+
"Content-Type": "application/json",
|
|
11
|
+
Authorization: `Bearer ${token}`
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
async function getAccessControlForUserAndPerson(user, crn) {
|
|
16
|
+
return await (await getContext()).get(`/user/${user}/access/${crn}`);
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { getAccessControlForUserAndPerson };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { doUntil } from "../utils/refresh.mjs";
|
|
2
2
|
import { selectOption } from "../utils/inputs.mjs";
|
|
3
|
-
import { login } from "../login.mjs";
|
|
4
3
|
import { findOffenderByNomisId } from "../offender/find-offender.mjs";
|
|
4
|
+
import { login } from "../login.mjs";
|
|
5
5
|
import { expect } from "@playwright/test";
|
|
6
6
|
import { faker } from "@faker-js/faker";
|
|
7
7
|
//#region steps/delius/staff/community-manager.ts
|