@ministryofjustice/hmpps-probation-integration-e2e-tests 1.214.0 → 1.215.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.214.0",
4
+ "version": "1.215.0",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/ministryofjustice/hmpps-probation-integration-e2e-tests#readme",
7
7
  "bugs": {
@@ -6,7 +6,8 @@ declare function recordAttendanceCompliedOutcome(page: Page, startTime?: string,
6
6
  declare function recordUnacceptableAbsenceOutcome(page: Page): Promise<void>;
7
7
  declare function adjustTravelTime(page: Page, hours: string, minutes: string): Promise<void>;
8
8
  declare function findGroupSession(page: Page, crn: string, person: Person, projectName: string, provider: string, teamName: string): Promise<void>;
9
- declare function findPlacementsWithHostPartner(page: Page, provider: string, teamName: string): Promise<string | null>;
9
+ declare function findAnIndividualPlacement(page: Page, provider: string, teamName: string): Promise<string | null>;
10
+ declare function findAnAppointment(page: Page, provider: string): Promise<string | null>;
10
11
  declare function recordSessionAttendance(page: Page, startTime: string, endTime: string): Promise<string | null>;
11
12
  //#endregion
12
- export { adjustTravelTime, findGroupSession, findPlacementsWithHostPartner, recordAttendanceCompliedOutcome, recordSessionAttendance, recordUnacceptableAbsenceOutcome };
13
+ export { adjustTravelTime, findAnAppointment, findAnIndividualPlacement, findGroupSession, recordAttendanceCompliedOutcome, recordSessionAttendance, recordUnacceptableAbsenceOutcome };
@@ -64,14 +64,14 @@ async function findGroupSession(page, crn, person, projectName, provider, teamNa
64
64
  await expect(page.locator("h1.govuk-heading-l")).toContainText(projectName);
65
65
  await page.getByRole("cell", { name: person.firstName + person.lastName }).isVisible();
66
66
  await page.getByRole("cell", { name: crn }).isVisible();
67
- await page.getByRole("link", { name: "Update" }).click();
67
+ await page.getByRole("link", { name: "Update" }).first().click();
68
68
  await expect(page.locator(".govuk-caption-l")).toContainText(crn);
69
- await page.getByRole("button", { name: "Continue" }).click();
69
+ await page.getByRole("button", { name: "Update appointment" }).click();
70
70
  await expect(page.getByRole("heading", { name: "Add supervisor details" })).toBeVisible();
71
71
  await selectOption(page, "#supervisor", supervisor);
72
72
  await page.getByRole("button", { name: "Continue" }).click();
73
73
  }
74
- async function findPlacementsWithHostPartner(page, provider, teamName) {
74
+ async function findAnIndividualPlacement(page, provider, teamName) {
75
75
  const supervisor = "Unallocated Staff";
76
76
  await page.getByRole("link", { name: "Record attendance with host" }).click();
77
77
  await selectOption(page, "#provider", provider);
@@ -81,12 +81,20 @@ async function findPlacementsWithHostPartner(page, provider, teamName) {
81
81
  await page.getByRole("link", { name: "Update" }).first().click();
82
82
  const crn = await page.locator(".govuk-caption-l").textContent();
83
83
  await expect(page.locator("h2.govuk-heading-m")).toContainText("Appointment details");
84
- await page.getByRole("button", { name: "Continue" }).click();
84
+ await page.getByRole("button", { name: "Update appointment" }).click();
85
85
  await expect(page.getByRole("heading", { name: "Add supervisor details" })).toBeVisible();
86
86
  await selectOption(page, "#supervisor", supervisor);
87
87
  await page.getByRole("button", { name: "Continue" }).click();
88
88
  return crn;
89
89
  }
90
+ async function findAnAppointment(page, provider) {
91
+ await page.getByRole("link", { name: "Adjust travel time hours" }).click();
92
+ await selectOption(page, "#provider", provider);
93
+ await page.getByRole("button", { name: "Apply filters" }).click();
94
+ const crn = await page.locator("//tbody/tr[1]/td[2]").textContent();
95
+ await page.getByRole("link", { name: "Update" }).first().click();
96
+ return crn;
97
+ }
90
98
  async function recordSessionAttendance(page, startTime, endTime) {
91
99
  await expect(page).toHaveTitle(/Record group session attendance/);
92
100
  await page.getByRole("button", { name: "View details" }).first().click();
@@ -107,4 +115,4 @@ async function recordSessionAttendance(page, startTime, endTime) {
107
115
  return crn;
108
116
  }
109
117
  //#endregion
110
- export { adjustTravelTime, findGroupSession, findPlacementsWithHostPartner, recordAttendanceCompliedOutcome, recordSessionAttendance, recordUnacceptableAbsenceOutcome };
118
+ export { adjustTravelTime, findAnAppointment, findAnIndividualPlacement, findGroupSession, recordAttendanceCompliedOutcome, recordSessionAttendance, recordUnacceptableAbsenceOutcome };
@@ -65,7 +65,7 @@ async function createCheckin(page, uuid, person) {
65
65
  await page.getByRole("checkbox", { name: "No, I do not need any support" }).check();
66
66
  await page.getByRole("button", { name: "Continue" }).click();
67
67
  await page.getByRole("button", { name: "Continue" }).click();
68
- await page.getByRole("button", { name: "Start recording" }).click();
68
+ await page.getByRole("button", { name: "Start identity check" }).click();
69
69
  await page.getByRole("button", { name: /Submit video anyway/ }).click();
70
70
  await page.getByRole("checkbox", { name: /I confirm/ }).check();
71
71
  await page.getByRole("button", { name: "Complete check in" }).click();