@ministryofjustice/hmpps-probation-integration-e2e-tests 1.234.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.234.0",
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": {
@@ -30,7 +30,7 @@
30
30
  "@typescript-eslint/parser": "^8.0.1",
31
31
  "eslint-config-prettier": "^10.0.1",
32
32
  "eslint-plugin-prettier": "^5.2.1",
33
- "prettier": "3.8.3",
33
+ "prettier": "3.8.4",
34
34
  "tsdown": "^0.22.0"
35
35
  },
36
36
  "exports": {
@@ -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 nextPageButtonLocator = page.getByRole("link", { name: "Next" });
13
- await expect(nextPageButtonLocator, `Expected - ${content} - not found, try next page`).toBeVisible();
14
- await nextPageButtonLocator.click();
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 getRowByContent(page, tableId, content);
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) {