@ministryofjustice/hmpps-probation-integration-e2e-tests 1.236.0 → 1.237.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.236.0",
4
+ "version": "1.237.0",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/ministryofjustice/hmpps-probation-integration-e2e-tests#readme",
7
7
  "bugs": {
@@ -11,5 +11,20 @@ declare function internalTransfer(page: Page, {
11
11
  allocation?: Optional<Allocation>;
12
12
  reason?: string;
13
13
  }): Promise<string>;
14
+ declare function transferToDeliusUser(page: Page, {
15
+ crn,
16
+ provider,
17
+ team,
18
+ firstName,
19
+ lastName,
20
+ reason
21
+ }: {
22
+ crn: string;
23
+ provider: string;
24
+ team: string;
25
+ firstName: string;
26
+ lastName: string;
27
+ reason?: string;
28
+ }): Promise<void>;
14
29
  //#endregion
15
- export { internalTransfer };
30
+ export { internalTransfer, transferToDeliusUser };
@@ -15,5 +15,18 @@ async function internalTransfer(page, { crn, allocation, reason = "Initial Alloc
15
15
  await expect(page).toHaveTitle(/Consolidated Transfer Request/);
16
16
  return selectedStaff;
17
17
  }
18
+ async function transferToDeliusUser(page, { crn, provider, team, firstName, lastName, reason = "Initial Allocation" }) {
19
+ await findOffenderByCRN(page, crn);
20
+ await page.locator("input", { hasText: "Transfers" }).click({ timeout: 5e3 });
21
+ await expect(page).toHaveTitle(/Consolidated Transfer Request/);
22
+ await selectOption(page, "#Trust\\:selectOneMenu", provider);
23
+ await selectOption(page, "#Team\\:selectOneMenu", team);
24
+ await selectOption(page, "#Staff\\:selectOneMenu", void 0, (s) => s.toLowerCase().includes(firstName.toLowerCase()) && s.toLowerCase().includes(lastName.toLowerCase()));
25
+ const count = await page.locator("#offenderTransferRequestTable select").count();
26
+ for (let i = 0; i < count; i++) await selectOption(page, `:nth-match(#offenderTransferRequestTable select, ${i + 1})`, reason);
27
+ await page.locator("input", { hasText: "Transfer" }).click();
28
+ await expect(page).toHaveTitle(/Consolidated Transfer Request/);
29
+ console.log(`Allocated Case to ${firstName} ${lastName}`);
30
+ }
18
31
  //#endregion
19
- export { internalTransfer };
32
+ export { internalTransfer, transferToDeliusUser };