@ministryofjustice/hmpps-probation-integration-e2e-tests 1.194.0 → 1.196.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.194.0",
4
+ "version": "1.196.0",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/ministryofjustice/hmpps-probation-integration-e2e-tests#readme",
7
7
  "bugs": {
@@ -30,7 +30,7 @@
30
30
  "@typescript-eslint/parser": "^8.0.1",
31
31
  "eslint-config-prettier": "^10.0.1",
32
32
  "eslint-plugin-prettier": "^5.2.1",
33
- "prettier": "3.8.1",
33
+ "prettier": "3.8.2",
34
34
  "tsdown": "^0.21.0"
35
35
  },
36
36
  "exports": {
@@ -10,7 +10,9 @@ declare function allocateCurrentCaseToUpwProject(page: Page, {
10
10
  startTime,
11
11
  endTime,
12
12
  projectType,
13
- pickupPoint
13
+ pickupPoint,
14
+ frequency,
15
+ startDate
14
16
  }: {
15
17
  crn: string;
16
18
  providerName: string;
@@ -21,6 +23,8 @@ declare function allocateCurrentCaseToUpwProject(page: Page, {
21
23
  endTime?: string;
22
24
  projectType?: string;
23
25
  pickupPoint?: string;
26
+ frequency?: string;
27
+ startDate?: Date;
24
28
  }): Promise<void>;
25
29
  declare const setAllocationOutcome: (page: Page, {
26
30
  crn,
@@ -1,9 +1,9 @@
1
1
  import { getCurrentDay } from "../utils/date-time.mjs";
2
- import { selectOption } from "../utils/inputs.mjs";
2
+ import { fillDate, getOptions, selectOption } from "../utils/inputs.mjs";
3
3
  import { findOffenderByCRN } from "../offender/find-offender.mjs";
4
4
  import { expect } from "@playwright/test";
5
5
  //#region steps/delius/upw/allocate-current-case-to-upw-project.ts
6
- async function allocateCurrentCaseToUpwProject(page, { crn, providerName, teamName, projectName = null, day = getCurrentDay(), startTime = null, endTime = null, projectType = "Group Placement - National Project", pickupPoint = null }) {
6
+ async function allocateCurrentCaseToUpwProject(page, { crn, providerName, teamName, projectName = null, day = getCurrentDay(), startTime = null, endTime = null, projectType = "Group Placement - National Project", pickupPoint = null, frequency = null, startDate = null }) {
7
7
  await findOffenderByCRN(page, crn);
8
8
  await page.getByRole("link", { name: "Event List" }).click();
9
9
  await page.getByRole("link", {
@@ -14,12 +14,16 @@ async function allocateCurrentCaseToUpwProject(page, { crn, providerName, teamNa
14
14
  await expect(page.locator("#content > h1")).toContainText("View UPW Details");
15
15
  await page.getByRole("button", { name: "Allocations" }).click();
16
16
  await expect(page.locator("#content > h1")).toContainText("Schedule UPW Appointments");
17
+ if (startDate) await fillDate(page, "#startDate\\:datePicker", startDate);
17
18
  await selectOption(page, "#area\\:selectOneMenu", providerName);
18
19
  await selectOption(page, "#selectionDay\\:selectOneMenu", day);
19
20
  await selectOption(page, "#projectType\\:selectOneMenu", projectType);
20
21
  await selectOption(page, "#team\\:selectOneMenu", teamName);
21
22
  await selectOption(page, "#project\\:selectOneMenu", projectName);
22
- await selectOption(page, "#allocationDay\\:selectOneMenu");
23
+ await selectOption(page, "#frequency\\:selectOneMenu", frequency);
24
+ let allocationDay = day;
25
+ if (allocationDay != null) allocationDay = (await getOptions(page, "#allocationDay\\:selectOneMenu")).find((option) => option.includes(allocationDay));
26
+ await selectOption(page, "#allocationDay\\:selectOneMenu", allocationDay);
23
27
  if (startTime) await page.locator("#startTime\\:timePicker").fill(startTime);
24
28
  if (endTime) await page.locator("#endTime\\:timePicker").fill(endTime);
25
29
  await selectOption(page, "#pickupPlace\\:selectOneMenu", pickupPoint);
@@ -1,9 +1,10 @@
1
1
  import { Page } from "@playwright/test";
2
2
 
3
3
  //#region steps/delius/utils/inputs.d.ts
4
+ declare const getOptions: (page: Page, selector: string, filter?: (s: string) => boolean) => Promise<string[]>;
4
5
  declare const selectOption: (page: Page, selector: string, option?: string, filter?: (s: string) => boolean, attempts?: number) => Promise<string>;
5
6
  declare const fillDate: (page: Page, selector: string, date: Date) => Promise<void>;
6
7
  declare const fillDateOasys: (page: Page, selector: string, date: Date) => Promise<void>;
7
8
  declare const fillTime: (page: Page, selector: string, time: Date) => Promise<void>;
8
9
  //#endregion
9
- export { fillDate, fillDateOasys, fillTime, selectOption };
10
+ export { fillDate, fillDateOasys, fillTime, getOptions, selectOption };
@@ -31,4 +31,4 @@ const fillTime = async (page, selector, time) => {
31
31
  await page.fill(selector, DeliusTimeFormatter(time));
32
32
  };
33
33
  //#endregion
34
- export { fillDate, fillDateOasys, fillTime, selectOption };
34
+ export { fillDate, fillDateOasys, fillTime, getOptions, selectOption };