@ministryofjustice/hmpps-probation-integration-e2e-tests 1.123.0 → 1.125.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.125.0",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/ministryofjustice/hmpps-probation-integration-e2e-tests#readme",
7
7
  "bugs": {
@@ -18,7 +18,6 @@
18
18
  "@faker-js/faker": "^10.0.0",
19
19
  "@kubernetes/client-node": "^1.0.0",
20
20
  "@playwright/test": "1.56.1",
21
- "dotenv": "^17.0.0",
22
21
  "luxon": "^3.5.0",
23
22
  "node-stream-zip": "^1.15.0",
24
23
  "pdf2json": "^4.0.0"
@@ -133,6 +132,7 @@
133
132
  "./steps/delius/restriction/create-restrictions": "./steps/delius/restriction/create-restrictions.mjs",
134
133
  "./steps/delius/staff/community-manager": "./steps/delius/staff/community-manager.mjs",
135
134
  "./steps/delius/transfer/internal-transfer": "./steps/delius/transfer/internal-transfer.mjs",
135
+ "./steps/delius/upw/allocate-current-case-to-upw-project": "./steps/delius/upw/allocate-current-case-to-upw-project.mjs",
136
136
  "./steps/delius/upw/start-upw-assessment": "./steps/delius/upw/start-upw-assessment.mjs",
137
137
  "./steps/delius/utils/contact": "./steps/delius/utils/contact.mjs",
138
138
  "./steps/delius/utils/date-time": "./steps/delius/utils/date-time.mjs",
@@ -6,10 +6,8 @@ import { addProviderOfficerDetails } from "./create-staff-record/add-provider-of
6
6
  import { addProviderOfficersApprovedPremises } from "./create-staff-record/update-provider-officer.mjs";
7
7
  import { searchApprovedPremises } from "./Keyworker/approved-premises-keyworker.mjs";
8
8
  import { addKeyWorker } from "./Keyworker/add-keyworker.mjs";
9
- import * as dotenv from "dotenv";
10
9
 
11
10
  //#region steps/delius/createApprovedPremisesKeyWorker/create-approved-premises-keyworker.ts
12
- dotenv.config();
13
11
  const createApprovedPremisesKeyWorker = async (page) => {
14
12
  await clickReferenceData(page);
15
13
  await clickLocalReferenceRecords(page);
@@ -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"
@@ -1,6 +1,5 @@
1
1
  import { commonData } from "./environments/common.mjs";
2
2
  import { testEnvironmentData } from "./environments/test.mjs";
3
- import * as dotenv from "dotenv";
4
3
 
5
4
  //#region test-data/test-data.ts
6
5
  var TestData = class {
@@ -14,7 +13,6 @@ var TestData = class {
14
13
  this.prisoners = {};
15
14
  }
16
15
  };
17
- dotenv.config();
18
16
  const data = new TestData();
19
17
  const environmentData = (!process.env.ENV || process.env.ENV == "test") && testEnvironmentData || (() => {
20
18
  throw new Error(`Unexpected environment: ${process.env.ENV}. Make sure you set the ENV variable correctly.`);