From 32f13e0a7331fd9135dd398abdbe5272d3cdcd57 Mon Sep 17 00:00:00 2001 From: Michael Gao <16783916+mgaoVA@users.noreply.github.com> Date: Wed, 9 Oct 2024 14:25:15 -0400 Subject: [PATCH] add homepage test: show more records (#5) --- end2end/package.json | 2 +- end2end/tests/homepage.spec.ts | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/end2end/package.json b/end2end/package.json index e8f45dbc6..53f076289 100644 --- a/end2end/package.json +++ b/end2end/package.json @@ -8,7 +8,7 @@ "license": "ISC", "description": "", "devDependencies": { - "@playwright/test": "^1.46.0", + "@playwright/test": "^1.47.2", "@types/node": "^22.1.0" } } diff --git a/end2end/tests/homepage.spec.ts b/end2end/tests/homepage.spec.ts index df7721d74..644510d91 100644 --- a/end2end/tests/homepage.spec.ts +++ b/end2end/tests/homepage.spec.ts @@ -68,3 +68,16 @@ test('table header background color is inverted when scrolled down', async ({ pa const screenshot = await page.screenshot(); await testInfo.attach('screenshot', { body: screenshot, contentType: 'image/png' }); }); + +test('show more records', async ({ page }, testInfo) => { + await page.goto('https://host.docker.internal/Test_Request_Portal/'); + + // Wait for async load + await expect(page.locator('#searchContainer')).not.toContainText('Searching for records'); + + await expect(page.getByRole('link', { name: '5', exact: true })).not.toBeVisible(); // arbitrary record that would be on the bottom of the full list + await page.getByRole('button', { name: 'Show more records' }).click(); + await expect(page.getByRole('button', { name: 'Show more records' })).not.toBeVisible(); + await page.keyboard.press('End'); + await expect(page.getByRole('link', { name: '5', exact: true })).toBeVisible();; +});