@ministryofjustice/hmpps-probation-integration-e2e-tests 1.123.0 → 1.124.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.123.0",
4
+ "version": "1.124.0",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/ministryofjustice/hmpps-probation-integration-e2e-tests#readme",
7
7
  "bugs": {
@@ -133,6 +133,7 @@
133
133
  "./steps/delius/restriction/create-restrictions": "./steps/delius/restriction/create-restrictions.mjs",
134
134
  "./steps/delius/staff/community-manager": "./steps/delius/staff/community-manager.mjs",
135
135
  "./steps/delius/transfer/internal-transfer": "./steps/delius/transfer/internal-transfer.mjs",
136
+ "./steps/delius/upw/allocate-current-case-to-upw-project": "./steps/delius/upw/allocate-current-case-to-upw-project.mjs",
136
137
  "./steps/delius/upw/start-upw-assessment": "./steps/delius/upw/start-upw-assessment.mjs",
137
138
  "./steps/delius/utils/contact": "./steps/delius/utils/contact.mjs",
138
139
  "./steps/delius/utils/date-time": "./steps/delius/utils/date-time.mjs",
@@ -0,0 +1,16 @@
1
+ import { Page } from "@playwright/test";
2
+
3
+ //#region steps/delius/upw/allocate-current-case-to-upw-project.d.ts
4
+ declare function allocateCurrentCaseToUpwProject(page: Page, {
5
+ providerName,
6
+ teamName,
7
+ day,
8
+ projectType
9
+ }: {
10
+ providerName: string;
11
+ teamName: string;
12
+ day?: string;
13
+ projectType?: string;
14
+ }): Promise<void>;
15
+ //#endregion
16
+ export { allocateCurrentCaseToUpwProject };
@@ -0,0 +1,33 @@
1
+ import { selectOption } from "../utils/inputs.mjs";
2
+ import { expect } from "@playwright/test";
3
+
4
+ //#region steps/delius/upw/allocate-current-case-to-upw-project.ts
5
+ async function allocateCurrentCaseToUpwProject(page, { providerName, teamName, day = "Monday", projectType = "Group Placement - National Project" }) {
6
+ await expect(page.locator("#content > h1")).toContainText("Personal Details");
7
+ await page.getByRole("button", { name: "Update" }).click();
8
+ await page.getByRole("link", { name: "Event List" }).click();
9
+ await page.getByRole("link", {
10
+ name: "view",
11
+ exact: true
12
+ }).click();
13
+ await page.locator("a", { hasText: "Unpaid Work" }).click();
14
+ await expect(page.locator("#content > h1")).toContainText("View UPW Details");
15
+ await page.getByRole("button", { name: "Allocations" }).click();
16
+ await expect(page.locator("#content > h1")).toContainText("Schedule UPW Appointments");
17
+ await selectOption(page, "#area\\:selectOneMenu", providerName);
18
+ await selectOption(page, "#selectionDay\\:selectOneMenu", day);
19
+ await selectOption(page, "#projectType\\:selectOneMenu", projectType);
20
+ await selectOption(page, "#team\\:selectOneMenu", teamName);
21
+ const projectName = await selectOption(page, "#project\\:selectOneMenu");
22
+ await selectOption(page, "#allocationDay\\:selectOneMenu");
23
+ await page.getByRole("button", { name: "Add" }).click();
24
+ await expect(page.locator("#currentAllocationsTable tbody > tr")).toHaveCount(1);
25
+ await page.getByRole("button", { name: "Save" }).click();
26
+ await expect(page.locator("#content > h1")).toContainText("Schedule UPW Appointments");
27
+ await page.getByRole("button", { name: "Confirm" }).click();
28
+ await expect(page.locator("#content > h1")).toContainText("View UPW Details");
29
+ console.log("Case allocated to UPW project '%s' on %s", projectName, day);
30
+ }
31
+
32
+ //#endregion
33
+ export { allocateCurrentCaseToUpwProject };
@@ -58,6 +58,10 @@ const testEnvironmentData = {
58
58
  name: "The Crescent",
59
59
  provider: "North East Region"
60
60
  },
61
+ unpaidWorkTestTeam: {
62
+ name: "Default Designated Transfer Team",
63
+ provider: "East of England"
64
+ },
61
65
  genericTeam: {
62
66
  name: "Vale - Team",
63
67
  provider: "Wales"