Skip to content

Commit

Permalink
feat: aded additional locator to anvil cmg pagination test (#4321)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fran McDade authored and NoopDog committed Jan 6, 2025
1 parent 0d97bb8 commit 78619af
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions e2e/testFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1304,16 +1304,19 @@ export async function filterAndTestLastPagePagination(
await expect(getFirstRowNthColumnCellLocator(page, 0)).toBeVisible();

// Should start on first page, and there should be multiple pages available
await expect(page.getByText(PAGE_COUNT_REGEX, { exact: true })).toHaveText(
/Page 1 of [0-9]+/
);
await expect(
page.getByText(PAGE_COUNT_REGEX, { exact: true })
page.locator(".MuiPaper-table").getByText(PAGE_COUNT_REGEX, { exact: true })
).toHaveText(/Page 1 of [0-9]+/);
await expect(
page.locator(".MuiPaper-table").getByText(PAGE_COUNT_REGEX, { exact: true })
).not.toHaveText("Page 1 of 1");

// Detect number of pages
const splitStartingPageText = (
await page.getByText(PAGE_COUNT_REGEX, { exact: true }).innerText()
await page
.locator(".MuiPaper-table")
.getByText(PAGE_COUNT_REGEX, { exact: true })
.innerText()
).split(" ");
const maxPages = parseInt(
splitStartingPageText[splitStartingPageText.length - 1]
Expand Down

0 comments on commit 78619af

Please sign in to comment.