@ministryofjustice/hmpps-probation-integration-e2e-tests 1.120.0 → 1.122.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 +3 -2
- package/steps/cas1-approved-premises/applications/assess-application.mjs +4 -12
- package/steps/cas1-approved-premises/applications/select-ap-placing-reason.d.mts +6 -0
- package/steps/cas1-approved-premises/applications/select-ap-placing-reason.mjs +11 -0
- package/steps/cas1-approved-premises/applications/select-offence.mjs +7 -0
- package/steps/cas1-approved-premises/applications/select-sentence-type.mjs +1 -1
- package/steps/cas1-approved-premises/applications/select-transgender-status.mjs +1 -1
- package/steps/cas1-approved-premises/applications/submit-application-full.mjs +2 -2
- package/steps/cas1-approved-premises/applications/task-list.mjs +1 -1
- package/steps/cas3-transitional-accommodation/application.mjs +6 -6
- package/steps/cvl-licences/application.mjs +4 -3
- package/steps/delius/registration/create-registration.mjs +1 -1
- package/steps/soc/login.mjs +1 -1
- package/steps/soc/refer-to-soc.mjs +2 -0
- package/steps/workforce/allocations.mjs +0 -1
- package/test-data/environments/test.mjs +2 -2
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.122.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/ministryofjustice/hmpps-probation-integration-e2e-tests#readme",
|
|
7
7
|
"bugs": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"dotenv": "^17.0.0",
|
|
22
22
|
"luxon": "^3.5.0",
|
|
23
23
|
"node-stream-zip": "^1.15.0",
|
|
24
|
-
"pdf2json": "^
|
|
24
|
+
"pdf2json": "^4.0.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/luxon": "^3.4.2",
|
|
@@ -71,6 +71,7 @@
|
|
|
71
71
|
"./steps/cas1-approved-premises/applications/reallocate": "./steps/cas1-approved-premises/applications/reallocate.mjs",
|
|
72
72
|
"./steps/cas1-approved-premises/applications/release-date-known-status": "./steps/cas1-approved-premises/applications/release-date-known-status.mjs",
|
|
73
73
|
"./steps/cas1-approved-premises/applications/review-prison-information": "./steps/cas1-approved-premises/applications/review-prison-information.mjs",
|
|
74
|
+
"./steps/cas1-approved-premises/applications/select-ap-placing-reason": "./steps/cas1-approved-premises/applications/select-ap-placing-reason.mjs",
|
|
74
75
|
"./steps/cas1-approved-premises/applications/select-offence": "./steps/cas1-approved-premises/applications/select-offence.mjs",
|
|
75
76
|
"./steps/cas1-approved-premises/applications/select-sentence-type": "./steps/cas1-approved-premises/applications/select-sentence-type.mjs",
|
|
76
77
|
"./steps/cas1-approved-premises/applications/select-situation-option": "./steps/cas1-approved-premises/applications/select-situation-option.mjs",
|
|
@@ -22,6 +22,7 @@ const assessApplication = async (page, personName) => {
|
|
|
22
22
|
await page.getByRole("group", { name: "Does the application identify the risk factors that an Approved Premises (AP) placement can support?" }).getByLabel("Yes").check();
|
|
23
23
|
await page.getByRole("group", { name: "Does the application explain how an AP placement would be beneficial for risk management?" }).getByLabel("Yes").check();
|
|
24
24
|
await page.getByRole("group", { name: "Are there factors to consider regarding the location of placement?" }).getByLabel("No").check();
|
|
25
|
+
await page.locator("#locationOfPlacementComments").fill("Test risk factors regarding location");
|
|
25
26
|
await page.getByRole("group", { name: "Is the move on plan sufficient?" }).getByLabel("Yes").check();
|
|
26
27
|
await page.getByRole("button", { name: "Submit" }).click();
|
|
27
28
|
await expect(page.locator(".govuk-heading-l")).toHaveText("Application timeliness");
|
|
@@ -44,18 +45,9 @@ const assessApplication = async (page, personName) => {
|
|
|
44
45
|
await page.getByRole("button", { name: "Submit" }).click();
|
|
45
46
|
await page.getByRole("link", { name: "Matching information" }).click();
|
|
46
47
|
await page.getByLabel("Standard AP").check();
|
|
47
|
-
await page.
|
|
48
|
-
await page.
|
|
49
|
-
await page.
|
|
50
|
-
await page.getByLabel("Is catered notRelevant").check();
|
|
51
|
-
await page.getByLabel("Has en suite notRelevant").check();
|
|
52
|
-
await page.getByLabel("Is suited for sex offenders notRelevant").check();
|
|
53
|
-
await page.getByLabel("Is suitable for vulnerable notRelevant").check();
|
|
54
|
-
await page.getByLabel("Accepts sex offenders notRelevant").check();
|
|
55
|
-
await page.getByLabel("Accepts child sex offenders notRelevant").check();
|
|
56
|
-
await page.getByLabel("Accepts non sexual child offenders notRelevant").check();
|
|
57
|
-
await page.getByLabel("Accepts hate crime offenders notRelevant").check();
|
|
58
|
-
await page.getByLabel("Yes").check();
|
|
48
|
+
await page.getByRole("radio", { name: "Is step free designated required" }).check();
|
|
49
|
+
await page.getByRole("radio", { name: "Has en suite required" }).check();
|
|
50
|
+
await page.getByRole("radio", { name: "Yes" }).check();
|
|
59
51
|
await page.getByRole("button", { name: "Submit" }).click();
|
|
60
52
|
await page.getByRole("link", { name: "Check assessment answers" }).click();
|
|
61
53
|
await page.getByRole("button", { name: "Continue" }).click();
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { expect } from "@playwright/test";
|
|
2
|
+
|
|
3
|
+
//#region steps/cas1-approved-premises/applications/select-ap-placing-reason.ts
|
|
4
|
+
const selectAPPlacingReason = async (page) => {
|
|
5
|
+
await page.getByLabel("Application for risk management/public protection").check();
|
|
6
|
+
await page.locator(".govuk-button", { hasText: "Save and continue" }).click();
|
|
7
|
+
await expect(page.locator("#main-content h1")).toHaveText("Do you know the person's release date?");
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
export { selectAPPlacingReason };
|
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
const selectOffence = async (page) => {
|
|
3
3
|
await page.locator("[name=\"offenceId\"]").check();
|
|
4
4
|
await page.locator(".govuk-button", { hasText: "Save and continue" }).click();
|
|
5
|
+
if (await page.locator(".govuk-heading-l", { hasText: "We cannot check this person's tier" }).isVisible()) {
|
|
6
|
+
await page.getByRole("radio", {
|
|
7
|
+
name: "High risk",
|
|
8
|
+
exact: true
|
|
9
|
+
}).check();
|
|
10
|
+
await page.locator(".govuk-button", { hasText: "Save and continue" }).click();
|
|
11
|
+
}
|
|
5
12
|
};
|
|
6
13
|
|
|
7
14
|
//#endregion
|
|
@@ -4,7 +4,7 @@ import { expect } from "@playwright/test";
|
|
|
4
4
|
const selectSentenceType = async (page) => {
|
|
5
5
|
await page.getByLabel("Community Order").check();
|
|
6
6
|
await page.locator(".govuk-button", { hasText: "Save and continue" }).click();
|
|
7
|
-
await expect(page.locator("#main-content h1")).toHaveText("
|
|
7
|
+
await expect(page.locator("#main-content h1")).toHaveText("What is the reason for placing this person in an AP?");
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
//#endregion
|
|
@@ -25,7 +25,7 @@ const enterSedLedPssDates = async (page) => {
|
|
|
25
25
|
await page.locator("#pssEndDate-month").fill(month);
|
|
26
26
|
await page.locator("#pssEndDate-year").fill(year);
|
|
27
27
|
await page.locator(".govuk-button", { hasText: "Save and continue" }).click();
|
|
28
|
-
await expect(page.locator(".govuk-fieldset__heading")).toHaveText("Which
|
|
28
|
+
await expect(page.locator(".govuk-fieldset__heading")).toHaveText("Which sentence type does the person have?");
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
//#endregion
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { enterCRN } from "./enter-crn.mjs";
|
|
2
2
|
import { selectSentenceType } from "./select-sentence-type.mjs";
|
|
3
|
-
import { selectSituationOption } from "./select-situation-option.mjs";
|
|
4
3
|
import { selectReleaseDateKnownStatus } from "./release-date-known-status.mjs";
|
|
5
4
|
import { confirmPlacementStartdate } from "./placement-start-date.mjs";
|
|
6
5
|
import { selectAPPlacementPurpose } from "./ap-placement-purpose.mjs";
|
|
@@ -18,6 +17,7 @@ import { addFurtherPlacementConsiderations } from "./futher-placement-considerat
|
|
|
18
17
|
import { addMoveOnInformation } from "./add-move-on-info.mjs";
|
|
19
18
|
import { attachReqrdDocuments } from "./attach-required-documents.mjs";
|
|
20
19
|
import { checkYourAnswers } from "./check-your-answers.mjs";
|
|
20
|
+
import { selectAPPlacingReason } from "./select-ap-placing-reason.mjs";
|
|
21
21
|
import { expect } from "@playwright/test";
|
|
22
22
|
|
|
23
23
|
//#region steps/cas1-approved-premises/applications/submit-application-full.ts
|
|
@@ -28,7 +28,7 @@ const submitAPApplication = async (page, crn) => {
|
|
|
28
28
|
await selectTransgenderStatus(page);
|
|
29
29
|
await enterSedLedPssDates(page);
|
|
30
30
|
await selectSentenceType(page);
|
|
31
|
-
await
|
|
31
|
+
await selectAPPlacingReason(page);
|
|
32
32
|
await selectReleaseDateKnownStatus(page);
|
|
33
33
|
await confirmPlacementStartdate(page);
|
|
34
34
|
await applicationOutsideNSTimescales(page);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { login, navigateToApplications } from "../login.mjs";
|
|
2
2
|
import { enterCRN } from "./enter-crn.mjs";
|
|
3
3
|
import { selectSentenceType } from "./select-sentence-type.mjs";
|
|
4
|
-
import { selectSituationOption } from "./select-situation-option.mjs";
|
|
5
4
|
import { selectReleaseDateKnownStatus } from "./release-date-known-status.mjs";
|
|
6
5
|
import { confirmPlacementStartdate } from "./placement-start-date.mjs";
|
|
7
6
|
import { selectAPPlacementPurpose } from "./ap-placement-purpose.mjs";
|
|
7
|
+
import { selectSituationOption } from "./select-situation-option.mjs";
|
|
8
8
|
import { selectTypeOfAPRequired } from "./select-type-ap-required.mjs";
|
|
9
9
|
import { enterSedLedPssDates, selectTransgenderStatus } from "./select-transgender-status.mjs";
|
|
10
10
|
import { confirmYourDetails } from "./confirm-your-details.mjs";
|
|
@@ -6,6 +6,7 @@ import { faker } from "@faker-js/faker";
|
|
|
6
6
|
async function submitCAS3Referral(page, crn) {
|
|
7
7
|
await startApplication(page);
|
|
8
8
|
await searchForPerson(page, crn);
|
|
9
|
+
await confirmPlacementLocation(page);
|
|
9
10
|
await addOffenceAndBehaviourSummary(page);
|
|
10
11
|
await addSentenceInformation(page);
|
|
11
12
|
await enterContactDetails(page);
|
|
@@ -16,7 +17,6 @@ async function submitCAS3Referral(page, crn) {
|
|
|
16
17
|
await enterPlacementConsiderations(page);
|
|
17
18
|
await enterApprovalsForSpecificRisks(page);
|
|
18
19
|
await outlineBehaviourInCAS(page);
|
|
19
|
-
await confirmPlacementLocation(page);
|
|
20
20
|
await addDisabilityCulturalAndSpecificNeeds(page);
|
|
21
21
|
await addInformationOnSafeguardingAndSupport(page);
|
|
22
22
|
await provideFoodAllergies(page);
|
|
@@ -248,11 +248,11 @@ async function outlineBehaviourInCAS(page) {
|
|
|
248
248
|
}
|
|
249
249
|
async function confirmPlacementLocation(page) {
|
|
250
250
|
await page.getByRole("link", { name: "Confirm placement location" }).click();
|
|
251
|
-
await expect(page).toHaveTitle(/Is placement
|
|
252
|
-
await page.getByRole("radio", {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
}).check();
|
|
251
|
+
await expect(page).toHaveTitle(/Is the placement for the London region/);
|
|
252
|
+
await page.getByRole("radio", { name: "Yes, London" }).check();
|
|
253
|
+
await page.getByRole("button", { name: "Save and continue" }).click();
|
|
254
|
+
await expect(page).toHaveTitle(/Is placement required in a different PDU/);
|
|
255
|
+
await page.getByRole("radio", { name: "No" }).check();
|
|
256
256
|
await page.getByRole("button", { name: "Save and continue" }).click();
|
|
257
257
|
await expect(page).toHaveTitle("Make a referral for Transitional Accommodation (CAS3) - Transitional Accommodation (CAS3)");
|
|
258
258
|
await expect(page.locator("#placement-location-status")).toHaveText("Completed");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { login, loginAsPrisonOfficer } from "./login.mjs";
|
|
2
2
|
import { expect } from "@playwright/test";
|
|
3
|
-
import { faker } from "@faker-js/faker";
|
|
3
|
+
import { faker } from "@faker-js/faker/locale/en_GB";
|
|
4
4
|
|
|
5
5
|
//#region steps/cvl-licences/application.ts
|
|
6
6
|
const createLicence = async (page, crn, nomsNumber) => {
|
|
@@ -16,13 +16,14 @@ const createLicence = async (page, crn, nomsNumber) => {
|
|
|
16
16
|
await page.getByLabel(/Who is the initial appointment with?/).fill(faker.person.fullName());
|
|
17
17
|
await page.getByRole("button", { name: "Continue" }).click();
|
|
18
18
|
await expect(page).toHaveTitle("Create and vary a licence - Create a licence - Where is the initial appointment?");
|
|
19
|
-
await page.
|
|
19
|
+
await page.getByRole("link", { name: /Enter address manually/ }).click();
|
|
20
|
+
await page.getByLabel(/Address line 1/).first().fill(faker.location.buildingNumber() + " " + faker.location.street());
|
|
20
21
|
await page.getByLabel(/Town or city/).fill(faker.location.city());
|
|
21
22
|
await page.getByLabel("County (optional)").fill(faker.location.county());
|
|
22
23
|
await page.getByLabel(/Postcode/).fill(faker.location.zipCode());
|
|
23
24
|
await page.getByRole("button", { name: "Continue" }).click();
|
|
24
25
|
await expect(page).toHaveTitle("Create and vary a licence - Create a licence - What is the contact phone number for the initial appointment?");
|
|
25
|
-
await page.getByLabel("UK telephone number").fill(cvlFormattedPhoneNumber());
|
|
26
|
+
await page.getByLabel("UK telephone number").first().fill(cvlFormattedPhoneNumber());
|
|
26
27
|
await page.getByRole("button", { name: "Continue" }).click();
|
|
27
28
|
await expect(page).toHaveTitle("Create and vary a licence - Create a licence - When is the initial appointment?");
|
|
28
29
|
await page.getByLabel(/Immediately after release/).check();
|
|
@@ -27,8 +27,8 @@ async function createRegistration(page, crn, registrationType, registeringOffice
|
|
|
27
27
|
await doUntil(() => saveBtn.click(), () => expect(page.locator("tbody tr")).toContainText(registrationType));
|
|
28
28
|
const tableRows = await page.$$("#registrationTable tbody tr");
|
|
29
29
|
const [deliusRegtype, deliusRegDate, deliusRegNextReviewDate] = await Promise.all([
|
|
30
|
+
tableRows[0].$("td:nth-child(2)"),
|
|
30
31
|
tableRows[0].$("td:nth-child(3)"),
|
|
31
|
-
tableRows[0].$("td:nth-child(4)"),
|
|
32
32
|
tableRows[0].$("td:nth-child(5)")
|
|
33
33
|
].map(async (cell) => {
|
|
34
34
|
return cell ? await (await cell).innerText() : "";
|
package/steps/soc/login.mjs
CHANGED
|
@@ -9,7 +9,7 @@ const login = async (page) => {
|
|
|
9
9
|
await page.click("#submit");
|
|
10
10
|
await expect(page).toHaveTitle(/HMPPS Digital Services - Home/);
|
|
11
11
|
await page.getByRole("link", { name: "Manage SOC Cases" }).click();
|
|
12
|
-
await expect(page).toHaveTitle(/Manage SOC
|
|
12
|
+
await expect(page).toHaveTitle(/Manage SOC cases/);
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
//#endregion
|
|
@@ -8,6 +8,8 @@ const referToSOC = async (page, crn) => {
|
|
|
8
8
|
await page.getByRole("link", { name: "Add nominal to SOC" }).click();
|
|
9
9
|
await page.getByLabel("Reason for referral or inclusion").fill("Automated testing");
|
|
10
10
|
await page.getByRole("button", { name: "Save and continue" }).click();
|
|
11
|
+
await page.getByLabel("Directorate of Security (DoS").selectOption("North West and West Midlands");
|
|
12
|
+
await page.getByRole("button", { name: "Save and continue" }).click();
|
|
11
13
|
await expect(page.getByRole("heading", { name: "Referral successful" })).toBeVisible();
|
|
12
14
|
};
|
|
13
15
|
function formatStaffNameForSOC(name) {
|
|
@@ -25,7 +25,6 @@ const allocateCase = async (page, crn, allocation) => {
|
|
|
25
25
|
await page.getByRole("button", { name: "Continue" }).click();
|
|
26
26
|
await refreshUntil(page, () => expect(page).toHaveTitle(/Review allocation notes/));
|
|
27
27
|
await page.fill("#instructions", `${allocation.staff.firstName} ${allocation.staff.lastName} is allocated on case with ${crn}. Allocation for ${crn} completed by hmpps-end-to-end-tests`);
|
|
28
|
-
await page.click("#isSensitive");
|
|
29
28
|
await page.getByRole("button", { name: "Continue" }).click();
|
|
30
29
|
await expect(page).toHaveURL(/spo-oversight-contact-option$/);
|
|
31
30
|
await page.getByRole("button", { name: "Save my notes without editing" }).click();
|