@ministryofjustice/hmpps-probation-integration-e2e-tests 1.203.0 → 1.204.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.204.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/ministryofjustice/hmpps-probation-integration-e2e-tests#readme",
|
|
7
7
|
"bugs": {
|
|
@@ -136,6 +136,7 @@
|
|
|
136
136
|
"./steps/delius/transfer/internal-transfer": "./steps/delius/transfer/internal-transfer.mjs",
|
|
137
137
|
"./steps/delius/upw/allocate-current-case-to-upw-project": "./steps/delius/upw/allocate-current-case-to-upw-project.mjs",
|
|
138
138
|
"./steps/delius/upw/checkAppointmentDetails": "./steps/delius/upw/checkAppointmentDetails.mjs",
|
|
139
|
+
"./steps/delius/upw/create-upw-appointment": "./steps/delius/upw/create-upw-appointment.mjs",
|
|
139
140
|
"./steps/delius/upw/create-upw-project": "./steps/delius/upw/create-upw-project.mjs",
|
|
140
141
|
"./steps/delius/upw/start-upw-assessment": "./steps/delius/upw/start-upw-assessment.mjs",
|
|
141
142
|
"./steps/delius/upw/verify-time-credited": "./steps/delius/upw/verify-time-credited.mjs",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { doUntil } from "../utils/refresh.mjs";
|
|
2
2
|
import { selectOption } from "../utils/inputs.mjs";
|
|
3
|
-
import { findOffenderByNomisId } from "../offender/find-offender.mjs";
|
|
4
3
|
import { login } from "../login.mjs";
|
|
4
|
+
import { findOffenderByNomisId } from "../offender/find-offender.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
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Page } from "@playwright/test";
|
|
2
|
+
|
|
3
|
+
//#region steps/delius/upw/create-upw-appointment.d.ts
|
|
4
|
+
interface Options {
|
|
5
|
+
crn: string;
|
|
6
|
+
eventNumber?: number;
|
|
7
|
+
projectName: string;
|
|
8
|
+
date: Date;
|
|
9
|
+
providerName: string;
|
|
10
|
+
teamName: string;
|
|
11
|
+
startTime?: string;
|
|
12
|
+
endTime?: string;
|
|
13
|
+
supervisorName?: string;
|
|
14
|
+
projectType: string;
|
|
15
|
+
allocation: string;
|
|
16
|
+
}
|
|
17
|
+
declare function createUpwAppointment(page: Page, {
|
|
18
|
+
crn,
|
|
19
|
+
eventNumber,
|
|
20
|
+
projectName,
|
|
21
|
+
date,
|
|
22
|
+
providerName,
|
|
23
|
+
teamName,
|
|
24
|
+
startTime,
|
|
25
|
+
endTime,
|
|
26
|
+
supervisorName,
|
|
27
|
+
projectType,
|
|
28
|
+
allocation
|
|
29
|
+
}: Options): Promise<void>;
|
|
30
|
+
//#endregion
|
|
31
|
+
export { createUpwAppointment as default };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { waitForAjax } from "../utils/refresh.mjs";
|
|
2
|
+
import { fillDate, selectOption } from "../utils/inputs.mjs";
|
|
3
|
+
import { findEventByCRN } from "../event/find-events.mjs";
|
|
4
|
+
import { expect } from "@playwright/test";
|
|
5
|
+
//#region steps/delius/upw/create-upw-appointment.ts
|
|
6
|
+
async function createUpwAppointment(page, { crn, eventNumber = 1, projectName, date, providerName, teamName, startTime, endTime, supervisorName = "Unallocated", projectType, allocation }) {
|
|
7
|
+
await findEventByCRN(page, crn, eventNumber);
|
|
8
|
+
await page.click("#navigation-include\\:linkNavigation3UnpaidWork");
|
|
9
|
+
await page.getByRole("button", { name: "Worksheet summary" }).click();
|
|
10
|
+
await waitForAjax(page);
|
|
11
|
+
await page.getByRole("button", { name: "Add appointment" }).click();
|
|
12
|
+
await waitForAjax(page);
|
|
13
|
+
await fillDate(page, "#appointmentDate\\:datePicker", date);
|
|
14
|
+
await selectOption(page, "#trustList\\:selectOneMenu", providerName);
|
|
15
|
+
await selectOption(page, "#projectTeamList\\:selectOneMenu", teamName);
|
|
16
|
+
await selectOption(page, "#project\\:selectOneMenu", projectName);
|
|
17
|
+
await selectOption(page, "#projectType\\:selectOneMenu", projectType);
|
|
18
|
+
await selectOption(page, "#projectAvailability\\:selectOneMenu", allocation);
|
|
19
|
+
await waitForAjax(page);
|
|
20
|
+
if (startTime) await page.fill("#startTime\\:timePicker", startTime);
|
|
21
|
+
if (endTime) await page.fill("#endTime\\:timePicker", endTime);
|
|
22
|
+
await selectOption(page, "#supervisorTeam\\:selectOneMenu", teamName);
|
|
23
|
+
await selectOption(page, "#supervisorEmployee\\:selectOneMenu", supervisorName);
|
|
24
|
+
await page.getByRole("button", { name: "Save" }).click();
|
|
25
|
+
await waitForAjax(page);
|
|
26
|
+
await expect(page.getByRole("heading", { level: 1 })).toContainText("Worksheet Summary");
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
export { createUpwAppointment as default };
|