@ministryofjustice/hmpps-probation-integration-e2e-tests 1.201.0 → 1.203.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.201.0",
4
+ "version": "1.203.0",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/ministryofjustice/hmpps-probation-integration-e2e-tests#readme",
7
7
  "bugs": {
@@ -9,14 +9,14 @@ async function createSubjectAccessReport(page, crn, downloadLocation) {
9
9
  await page.locator("input", { hasText: "New SAR" }).click();
10
10
  await page.locator("input", { hasText: "Save" }).click();
11
11
  const sarProgressTable = page.locator("#subjectAccessReportTable");
12
- await refreshUntil(page, () => expect(sarProgressTable).toContainText("Complete"));
12
+ await refreshUntil(page, () => expect(sarProgressTable).toContainText("Complete"), { timeout: 2e4 });
13
13
  const [download] = await Promise.all([page.waitForEvent("download"), sarProgressTable.locator("a", { hasText: "Download" }).click()]);
14
14
  await download.saveAs(downloadLocation);
15
15
  }
16
16
  async function getFileFromZip(downloadLocation, filename) {
17
17
  const zip = new StreamZip.async({ file: downloadLocation });
18
18
  const matchingFiles = Object.values(await zip.entries()).filter((entry) => entry.isFile && filename.test(entry.name));
19
- expect(matchingFiles).toHaveLength(2);
19
+ expect(matchingFiles).toHaveLength(1);
20
20
  return zip.entryData(matchingFiles[0]);
21
21
  }
22
22
  //#endregion
@@ -26,6 +26,9 @@ async function registerCaseInMPoP(page, person, crn) {
26
26
  await expect(heading).toContainText(new RegExp(`${person.firstName} is eligible to use online check ins`, "i"));
27
27
  await page.getByRole("radio", { name: "To replace some face-to-face" }).click();
28
28
  await page.getByRole("button", { name: "Sign up for online check ins" }).click();
29
+ await expect(heading).toContainText(new RegExp(`Check you've got approval before you sign ${person.firstName} up`, "i"));
30
+ await page.locator("input[value=\"spo-approval\"]").check();
31
+ await page.getByRole("button", { name: "Continue" }).click();
29
32
  await expect(heading).toContainText(/Set up\s+online check ins/i);
30
33
  await page.locator(".moj-js-datepicker-input").fill(uiDueDate);
31
34
  await page.getByRole("radio", { name: "Every 2 weeks" }).check();
@@ -59,9 +62,7 @@ async function createCheckin(page, uuid, person) {
59
62
  await page.getByRole("button", { name: "Continue" }).click();
60
63
  await page.getByRole("radio", { name: "Very well" }).check();
61
64
  await page.getByRole("button", { name: "Continue" }).click();
62
- await page.getByRole("checkbox", { name: "No, I do not need help" }).check();
63
- await page.getByRole("button", { name: "Continue" }).click();
64
- await page.getByRole("radio", { name: "No" }).check();
65
+ await page.getByRole("checkbox", { name: "No, I do not need any support" }).check();
65
66
  await page.getByRole("button", { name: "Continue" }).click();
66
67
  await page.getByRole("button", { name: "Continue" }).click();
67
68
  await page.getByRole("button", { name: "Start recording" }).click();
@@ -20,7 +20,8 @@ const commonData = {
20
20
  adjournedForFastPreSentenceReport: {
21
21
  appearanceType: "Trial/Adjournment",
22
22
  outcome: "Adjourned - Pre-Sentence Report",
23
- reportType: "Pre-Sentence Report - Fast"
23
+ reportType: "Pre-Sentence Report - Fast",
24
+ mainOffence: "Stealing by an employee - 04100"
24
25
  },
25
26
  adjournedForOralPreSentenceReport: {
26
27
  appearanceType: "Trial/Adjournment",
@@ -2,7 +2,8 @@
2
2
  const testEnvironmentData = {
3
3
  documentTemplates: {
4
4
  shortFormatPreSentenceReport: "Nat Short format pre-sentence report pilot",
5
- oralPreSentenceReport: "Record of Oral Pre-Sentence Report"
5
+ oralPreSentenceReport: "Record of Oral Pre-Sentence Report",
6
+ adjournedPsr: "Adjourned PSR"
6
7
  },
7
8
  contacts: { initialAppointment: {
8
9
  category: "All/Always",
@@ -48,6 +48,7 @@ declare class TestData {
48
48
  outcome: string;
49
49
  length?: string;
50
50
  reportType?: string;
51
+ mainOffence?: string;
51
52
  };
52
53
  };
53
54
  requirements: {