@ministryofjustice/hmpps-probation-integration-e2e-tests 1.216.0 → 1.218.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.216.0",
4
+ "version": "1.218.0",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/ministryofjustice/hmpps-probation-integration-e2e-tests#readme",
7
7
  "bugs": {
@@ -36,7 +36,6 @@
36
36
  "exports": {
37
37
  "./steps/accredited-programmes/application": "./steps/accredited-programmes/application.mjs",
38
38
  "./steps/accredited-programmes/login": "./steps/accredited-programmes/login.mjs",
39
- "./steps/accredited-programmes/manageAndDeliverLogin": "./steps/accredited-programmes/manageAndDeliverLogin.mjs",
40
39
  "./steps/api/arns/arns-api": "./steps/api/arns/arns-api.mjs",
41
40
  "./steps/api/auth/get-token": "./steps/api/auth/get-token.mjs",
42
41
  "./steps/api/court-case/court-case-api": "./steps/api/court-case/court-case-api.mjs",
@@ -95,9 +94,8 @@
95
94
  "./steps/cas3-transitional-accommodation/application": "./steps/cas3-transitional-accommodation/application.mjs",
96
95
  "./steps/cas3-transitional-accommodation/login": "./steps/cas3-transitional-accommodation/login.mjs",
97
96
  "./steps/common/common": "./steps/common/common.mjs",
98
- "./steps/community-payback/case-admin-login": "./steps/community-payback/case-admin-login.mjs",
97
+ "./steps/community-payback/login": "./steps/community-payback/login.mjs",
99
98
  "./steps/community-payback/record-outcome": "./steps/community-payback/record-outcome.mjs",
100
- "./steps/community-payback/supervisor-login": "./steps/community-payback/supervisor-login.mjs",
101
99
  "./steps/court-case/hearing-data": "./steps/court-case/hearing-data.mjs",
102
100
  "./steps/court-case/prepare-case-for-sentence/application": "./steps/court-case/prepare-case-for-sentence/application.mjs",
103
101
  "./steps/court-case/prepare-case-for-sentence/login": "./steps/court-case/prepare-case-for-sentence/login.mjs",
@@ -2,5 +2,6 @@ import { Page } from "@playwright/test";
2
2
 
3
3
  //#region steps/accredited-programmes/login.d.ts
4
4
  declare const login: (page: Page) => Promise<void>;
5
+ declare const manageAndDeliverLogin: (page: Page) => Promise<void>;
5
6
  //#endregion
6
- export { login };
7
+ export { login, manageAndDeliverLogin };
@@ -8,5 +8,13 @@ const login = async (page) => {
8
8
  await page.click("#submit");
9
9
  await expect(page).toHaveTitle(/Accredited Programmes/);
10
10
  };
11
+ const manageAndDeliverLogin = async (page) => {
12
+ await page.goto(process.env.ACCREDITED_PROGRAMMES_MANAGE_AND_DELIVER_URL);
13
+ await expect(page).toHaveTitle(/HMPPS Digital Services - Sign in/);
14
+ await page.fill("#username", process.env.DELIUS_USERNAME);
15
+ await page.fill("#password", process.env.DELIUS_PASSWORD);
16
+ await page.click("#submit");
17
+ await expect(page).toHaveTitle(/Accredited Programmes/);
18
+ };
11
19
  //#endregion
12
- export { login };
20
+ export { login, manageAndDeliverLogin };
@@ -0,0 +1,7 @@
1
+ import { Page } from "@playwright/test";
2
+
3
+ //#region steps/community-payback/login.d.ts
4
+ declare const loginAsCaseAdmin: (page: Page) => Promise<void>;
5
+ declare const loginAsSupervisor: (page: Page) => Promise<void>;
6
+ //#endregion
7
+ export { loginAsCaseAdmin, loginAsSupervisor };
@@ -0,0 +1,20 @@
1
+ import { expect } from "@playwright/test";
2
+ //#region steps/community-payback/login.ts
3
+ const loginAsCaseAdmin = async (page) => {
4
+ await page.goto(process.env.COMMUNITY_PAYBACK_URL);
5
+ await expect(page).toHaveTitle(/HMPPS Digital Services - Sign in/);
6
+ await page.fill("#username", process.env.DELIUS_USERNAME);
7
+ await page.fill("#password", process.env.DELIUS_PASSWORD);
8
+ await page.click("#submit");
9
+ await expect(page).toHaveTitle(/Community Payback/);
10
+ };
11
+ const loginAsSupervisor = async (page) => {
12
+ await page.goto(process.env.COMMUNITY_PAYBACK_SUPERVISORS_URL);
13
+ await expect(page).toHaveTitle(/HMPPS Digital Services - Sign in/);
14
+ await page.fill("#username", process.env.DELIUS_USERNAME);
15
+ await page.fill("#password", process.env.DELIUS_PASSWORD);
16
+ await page.click("#submit");
17
+ await expect(page.locator("h1.govuk-heading-l")).toContainText(/Next sessions/);
18
+ };
19
+ //#endregion
20
+ export { loginAsCaseAdmin, loginAsSupervisor };
@@ -65,8 +65,8 @@ 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 identity check" }).click();
69
- await page.getByRole("button", { name: /Submit video anyway/ }).click();
68
+ await page.goto(`${process.env.PROBATION_CHECK_IN_URL}/${uuid}/liveness/view`);
69
+ await page.getByRole("button", { name: /Submit anyway/ }).click();
70
70
  await page.getByRole("checkbox", { name: /I confirm/ }).check();
71
71
  await page.getByRole("button", { name: "Complete check in" }).click();
72
72
  await expect(page.locator("h1")).toContainText("Check in completed");
@@ -12,7 +12,7 @@ const referralProgress = async (page, referralRef) => {
12
12
  };
13
13
  const makeReferral = async (page, crn) => {
14
14
  await page.getByRole("link", { name: "Find a CRS intervention and make a referral" }).click();
15
- await page.locator("text=Accommodation Services for East of England").click();
15
+ await page.locator("text=Personal Wellbeing Services in Cheshire").click();
16
16
  await page.locator("text=Make a referral").click();
17
17
  await page.locator("input[name=\"service-user-crn\"]").fill(crn);
18
18
  await page.locator("text=Continue").click();
@@ -46,15 +46,19 @@ const makeReferral = async (page, crn) => {
46
46
  await page.locator("#has-additional-responsibilities-2").check();
47
47
  await page.locator("text=Save and continue").click();
48
48
  await expect(page).toHaveURL(/\/referrals\/.*\/form/);
49
- await page.locator("text=Confirm the relevant sentence for the Accommodation referral").click();
49
+ await page.locator("text=Select service types for the Personal wellbeing referral").click();
50
+ await page.locator("#service-category-ids").check();
51
+ await page.locator("text=Save and continue").click();
52
+ await expect(page).toHaveURL(/\/referrals\/.*\/form/);
53
+ await page.locator("text=Confirm the relevant sentence for the Personal wellbeing referral").click();
50
54
  await expect(page).toHaveURL(/referrals\/.*\/relevant-sentence/);
51
55
  await page.locator("input[name=\"relevant-sentence-id\"]").first().check();
52
56
  await page.locator("text=Save and continue").click();
53
57
  await expect(page).toHaveURL(/referrals\/.*\/service-category\/.*\/desired-outcomes/);
54
- await page.locator("#desired-outcomes-ids-2").check();
58
+ await page.locator("#desired-outcomes-ids").check();
55
59
  await page.locator("text=Save and continue").click();
56
60
  await expect(page).toHaveURL(/referrals\/.*\/service-category\/.*\/complexity-level/);
57
- await page.locator("text=Medium complexity Service user is at risk of homelessness/is homeless, or will b >> input[name=\"complexity-level-id\"]").check();
61
+ await page.getByRole("radio", { name: "Medium complexity" }).click();
58
62
  await page.locator("text=Save and continue").click();
59
63
  await expect(page).toHaveURL(/referrals\/.*\/enforceable-days/);
60
64
  await page.locator("input[name=\"maximum-enforceable-days\"]").fill("10");
@@ -1,6 +0,0 @@
1
- import { Page } from "@playwright/test";
2
-
3
- //#region steps/accredited-programmes/manageAndDeliverLogin.d.ts
4
- declare const login: (page: Page) => Promise<void>;
5
- //#endregion
6
- export { login };
@@ -1,12 +0,0 @@
1
- import { expect } from "@playwright/test";
2
- //#region steps/accredited-programmes/manageAndDeliverLogin.ts
3
- const login = async (page) => {
4
- await page.goto(process.env.ACCREDITED_PROGRAMMES_MANAGE_AND_DELIVER_URL);
5
- await expect(page).toHaveTitle(/HMPPS Digital Services - Sign in/);
6
- await page.fill("#username", process.env.DELIUS_USERNAME);
7
- await page.fill("#password", process.env.DELIUS_PASSWORD);
8
- await page.click("#submit");
9
- await expect(page).toHaveTitle(/Accredited Programmes/);
10
- };
11
- //#endregion
12
- export { login };
@@ -1,6 +0,0 @@
1
- import { Page } from "@playwright/test";
2
-
3
- //#region steps/community-payback/case-admin-login.d.ts
4
- declare const caseAdminLogin: (page: Page) => Promise<void>;
5
- //#endregion
6
- export { caseAdminLogin };
@@ -1,12 +0,0 @@
1
- import { expect } from "@playwright/test";
2
- //#region steps/community-payback/case-admin-login.ts
3
- const caseAdminLogin = async (page) => {
4
- await page.goto(process.env.COMMUNITY_PAYBACK_URL);
5
- await expect(page).toHaveTitle(/HMPPS Digital Services - Sign in/);
6
- await page.fill("#username", process.env.DELIUS_USERNAME);
7
- await page.fill("#password", process.env.DELIUS_PASSWORD);
8
- await page.click("#submit");
9
- await expect(page).toHaveTitle(/Community Payback/);
10
- };
11
- //#endregion
12
- export { caseAdminLogin };
@@ -1,6 +0,0 @@
1
- import { Page } from "@playwright/test";
2
-
3
- //#region steps/community-payback/supervisor-login.d.ts
4
- declare const supervisorLogin: (page: Page) => Promise<void>;
5
- //#endregion
6
- export { supervisorLogin };
@@ -1,12 +0,0 @@
1
- import { expect } from "@playwright/test";
2
- //#region steps/community-payback/supervisor-login.ts
3
- const supervisorLogin = async (page) => {
4
- await page.goto(process.env.COMMUNITY_PAYBACK_SUPERVISORS_URL);
5
- await expect(page).toHaveTitle(/HMPPS Digital Services - Sign in/);
6
- await page.fill("#username", process.env.DELIUS_USERNAME);
7
- await page.fill("#password", process.env.DELIUS_PASSWORD);
8
- await page.click("#submit");
9
- await expect(page.locator("h1.govuk-heading-l")).toContainText(/Next sessions/);
10
- };
11
- //#endregion
12
- export { supervisorLogin };