From c684f3d8b1c0c0f01f71c3946a608eb4a6fbfa84 Mon Sep 17 00:00:00 2001 From: mgaoVA <16783916+mgaoVA@users.noreply.github.com> Date: Thu, 3 Oct 2024 14:20:21 -0400 Subject: [PATCH] add homepage test: show more records --- 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();; +});