@ministryofjustice/hmpps-probation-integration-e2e-tests 1.222.0 → 1.223.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.223.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/ministryofjustice/hmpps-probation-integration-e2e-tests#readme",
|
|
7
7
|
"bugs": {
|
|
@@ -8,6 +8,7 @@ declare function adjustTravelTime(page: Page, hours: string, minutes: string): P
|
|
|
8
8
|
declare function findGroupSession(page: Page, crn: string, person: Person, projectName: string, provider: string, teamName: string): Promise<void>;
|
|
9
9
|
declare function findAnIndividualPlacement(page: Page, provider: string, teamName: string): Promise<string | null>;
|
|
10
10
|
declare function findAnAppointment(page: Page, provider: string): Promise<string | null>;
|
|
11
|
+
declare function addSupervisorDetails(page: Page, teamName: string, supervisor: string): Promise<void>;
|
|
11
12
|
declare function recordSessionAttendance(page: Page, startTime: string, endTime: string): Promise<string | null>;
|
|
12
13
|
//#endregion
|
|
13
|
-
export { adjustTravelTime, findAnAppointment, findAnIndividualPlacement, findGroupSession, recordAttendanceCompliedOutcome, recordSessionAttendance, recordUnacceptableAbsenceOutcome };
|
|
14
|
+
export { addSupervisorDetails, adjustTravelTime, findAnAppointment, findAnIndividualPlacement, findGroupSession, recordAttendanceCompliedOutcome, recordSessionAttendance, recordUnacceptableAbsenceOutcome };
|
|
@@ -15,7 +15,7 @@ async function recordAttendanceCompliedOutcome(page, startTime, endTime) {
|
|
|
15
15
|
await page.getByRole("button", { name: "Continue" }).click();
|
|
16
16
|
await page.locator("input[name=\"hiVis\"][value=\"yes\"]").click();
|
|
17
17
|
await page.locator("input[name=\"workedIntensively\"][value=\"yes\"]").click();
|
|
18
|
-
await page.locator("input[name=\"workQuality\"][value=\"
|
|
18
|
+
await page.locator("input[name=\"workQuality\"][value=\"EXCELLENT\"]").click();
|
|
19
19
|
await page.locator("input[name=\"behaviour\"][value=\"GOOD\"]").click();
|
|
20
20
|
await page.getByRole("button", { name: "Continue" }).click();
|
|
21
21
|
await page.getByRole("heading", { name: "Confirm details" }).isVisible();
|
|
@@ -38,6 +38,10 @@ async function recordUnacceptableAbsenceOutcome(page) {
|
|
|
38
38
|
await page.getByRole("link", { name: "Sign out" }).click();
|
|
39
39
|
}
|
|
40
40
|
async function adjustTravelTime(page, hours, minutes) {
|
|
41
|
+
const today = DateTime.now();
|
|
42
|
+
await page.locator("#date-day").fill(today.day.toString());
|
|
43
|
+
await page.locator("#date-month").fill(today.month.toString());
|
|
44
|
+
await page.locator("#date-year").fill(today.year.toString());
|
|
41
45
|
await page.locator("#hours").fill(hours);
|
|
42
46
|
await page.locator("#minutes").fill(minutes);
|
|
43
47
|
await page.getByRole("button", { name: "Credit travel time" }).click();
|
|
@@ -66,10 +70,7 @@ async function findGroupSession(page, crn, person, projectName, provider, teamNa
|
|
|
66
70
|
await page.getByRole("cell", { name: crn }).isVisible();
|
|
67
71
|
await page.getByRole("link", { name: "Update" }).first().click();
|
|
68
72
|
await expect(page.locator(".govuk-caption-l")).toContainText(crn);
|
|
69
|
-
await page
|
|
70
|
-
await expect(page.getByRole("heading", { name: "Add supervisor details" })).toBeVisible();
|
|
71
|
-
await selectOption(page, "#supervisor", supervisor);
|
|
72
|
-
await page.getByRole("button", { name: "Continue" }).click();
|
|
73
|
+
await addSupervisorDetails(page, teamName, supervisor);
|
|
73
74
|
}
|
|
74
75
|
async function findAnIndividualPlacement(page, provider, teamName) {
|
|
75
76
|
const supervisor = "Unallocated Staff";
|
|
@@ -81,10 +82,7 @@ async function findAnIndividualPlacement(page, provider, teamName) {
|
|
|
81
82
|
await page.getByRole("link", { name: "Update" }).first().click();
|
|
82
83
|
const crn = await page.locator(".govuk-caption-l").textContent();
|
|
83
84
|
await expect(page.locator("h2.govuk-heading-m")).toContainText("Appointment details");
|
|
84
|
-
await page
|
|
85
|
-
await expect(page.getByRole("heading", { name: "Add supervisor details" })).toBeVisible();
|
|
86
|
-
await selectOption(page, "#supervisor", supervisor);
|
|
87
|
-
await page.getByRole("button", { name: "Continue" }).click();
|
|
85
|
+
await addSupervisorDetails(page, teamName, supervisor);
|
|
88
86
|
return crn;
|
|
89
87
|
}
|
|
90
88
|
async function findAnAppointment(page, provider) {
|
|
@@ -95,6 +93,14 @@ async function findAnAppointment(page, provider) {
|
|
|
95
93
|
await page.getByRole("link", { name: "Update" }).nth(3).click();
|
|
96
94
|
return crn;
|
|
97
95
|
}
|
|
96
|
+
async function addSupervisorDetails(page, teamName, supervisor) {
|
|
97
|
+
await page.getByRole("button", { name: "Update appointment" }).click();
|
|
98
|
+
await expect(page.getByRole("heading", { name: "Add supervisor details" })).toBeVisible();
|
|
99
|
+
await selectOption(page, "#team", teamName);
|
|
100
|
+
await page.getByRole("button", { name: "Select team" }).click();
|
|
101
|
+
await selectOption(page, "#supervisor", supervisor);
|
|
102
|
+
await page.getByRole("button", { name: "Continue" }).click();
|
|
103
|
+
}
|
|
98
104
|
async function recordSessionAttendance(page, startTime, endTime) {
|
|
99
105
|
await expect(page).toHaveTitle(/Record group session attendance/);
|
|
100
106
|
await page.getByRole("button", { name: "View details" }).first().click();
|
|
@@ -115,4 +121,4 @@ async function recordSessionAttendance(page, startTime, endTime) {
|
|
|
115
121
|
return crn;
|
|
116
122
|
}
|
|
117
123
|
//#endregion
|
|
118
|
-
export { adjustTravelTime, findAnAppointment, findAnIndividualPlacement, findGroupSession, recordAttendanceCompliedOutcome, recordSessionAttendance, recordUnacceptableAbsenceOutcome };
|
|
124
|
+
export { addSupervisorDetails, adjustTravelTime, findAnAppointment, findAnIndividualPlacement, findGroupSession, recordAttendanceCompliedOutcome, recordSessionAttendance, recordUnacceptableAbsenceOutcome };
|