@ministryofjustice/hmpps-probation-integration-e2e-tests 1.235.0 → 1.236.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.236.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 { doUntil } from "../utils/refresh.mjs";
|
|
2
|
-
import { referralProgress } from "../../referandmonitor/referral.mjs";
|
|
3
2
|
import { findOffenderByCRN } from "../offender/find-offender.mjs";
|
|
3
|
+
import { referralProgress } from "../../referandmonitor/referral.mjs";
|
|
4
4
|
import { findEventByCRN } from "../event/find-events.mjs";
|
|
5
5
|
import { expect } from "@playwright/test";
|
|
6
6
|
//#region steps/delius/contact/find-contacts.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { doUntil } from "../utils/refresh.mjs";
|
|
2
2
|
import { selectOption } from "../utils/inputs.mjs";
|
|
3
|
-
import { login } from "../login.mjs";
|
|
4
3
|
import { findOffenderByNomisId } from "../offender/find-offender.mjs";
|
|
4
|
+
import { login } from "../login.mjs";
|
|
5
5
|
import { expect } from "@playwright/test";
|
|
6
6
|
import { faker } from "@faker-js/faker";
|
|
7
7
|
//#region steps/delius/staff/community-manager.ts
|
|
@@ -9,11 +9,24 @@ async function getRowByContent(page, tableId, content) {
|
|
|
9
9
|
await expect(row).toBeVisible();
|
|
10
10
|
return row;
|
|
11
11
|
} catch {
|
|
12
|
-
const
|
|
13
|
-
await expect(
|
|
14
|
-
await
|
|
12
|
+
const lastPageLocator = page.getByRole("link", { name: "Last" });
|
|
13
|
+
await expect(lastPageLocator, `Expected - ${content} - not found.`).toBeVisible();
|
|
14
|
+
await lastPageLocator.click();
|
|
15
15
|
await waitForAjax(page);
|
|
16
|
-
return
|
|
16
|
+
return getRowByContentPaginatedFromLast(page, tableLocator, content);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
async function getRowByContentPaginatedFromLast(page, tableLocator, content) {
|
|
20
|
+
const row = tableLocator.getByRole("row").filter({ hasText: content });
|
|
21
|
+
try {
|
|
22
|
+
await expect(row).toBeVisible();
|
|
23
|
+
return row;
|
|
24
|
+
} catch {
|
|
25
|
+
const previousPageLocator = page.getByRole("link", { name: "Previous" });
|
|
26
|
+
await expect(previousPageLocator, `Expected - ${content} - not found.`).toBeVisible();
|
|
27
|
+
await previousPageLocator.click();
|
|
28
|
+
await waitForAjax(page);
|
|
29
|
+
return getRowByContentPaginatedFromLast(page, tableLocator, content);
|
|
17
30
|
}
|
|
18
31
|
}
|
|
19
32
|
async function getRowCellsByContent(page, tableId, content) {
|