@ministryofjustice/hmpps-probation-integration-e2e-tests 1.197.0 → 1.199.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.
|
|
4
|
+
"version": "1.199.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/ministryofjustice/hmpps-probation-integration-e2e-tests#readme",
|
|
7
7
|
"bugs": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { data } from "../../../test-data/test-data.mjs";
|
|
2
2
|
import { Tomorrow } from "../utils/date-time.mjs";
|
|
3
|
-
import { doUntil } from "../utils/refresh.mjs";
|
|
3
|
+
import { doUntil, waitForAjax } from "../utils/refresh.mjs";
|
|
4
4
|
import { fillDate, fillTime, selectOption } from "../utils/inputs.mjs";
|
|
5
5
|
import { findOffenderByCRNNoContextCheck } from "../offender/find-offender.mjs";
|
|
6
6
|
import { findContactsByCRN } from "./find-contacts.mjs";
|
|
@@ -13,6 +13,7 @@ const createContact = async (page, crn, options) => {
|
|
|
13
13
|
if (options.date) await fillDate(page, "#StartDate\\:datePicker", options.date);
|
|
14
14
|
await selectOption(page, "#RelatedTo\\:selectOneMenu", options.relatesTo);
|
|
15
15
|
await selectOption(page, "#ContactCategory\\:selectOneMenu", options.category);
|
|
16
|
+
await waitForAjax(page);
|
|
16
17
|
const contactTypeDropdown = page.locator("[id=\"ContactType:selectOneMenu-autocomplete\"]");
|
|
17
18
|
await contactTypeDropdown.click();
|
|
18
19
|
await contactTypeDropdown.fill(options.type);
|
|
@@ -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
|
|
15
|
+
await page.locator("text=Accommodation Services for East of England").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();
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { refreshUntil } from "../delius/utils/refresh.mjs";
|
|
1
2
|
import { expect } from "@playwright/test";
|
|
2
3
|
//#region steps/workforce/login.ts
|
|
3
4
|
const login = async (page) => {
|
|
@@ -6,7 +7,7 @@ const login = async (page) => {
|
|
|
6
7
|
await page.fill("#username", process.env.DELIUS_USERNAME);
|
|
7
8
|
await page.fill("#password", process.env.DELIUS_PASSWORD);
|
|
8
9
|
await page.click("#submit");
|
|
9
|
-
await expect(page).toHaveTitle(/.*Manage a workforce/);
|
|
10
|
+
await refreshUntil(page, () => expect(page).toHaveTitle(/.*Manage a workforce/));
|
|
10
11
|
};
|
|
11
12
|
//#endregion
|
|
12
13
|
export { login };
|