From fc5121c41e5d6387785e70e8a396f23d24f073ae Mon Sep 17 00:00:00 2001 From: Michael Li Date: Wed, 31 Jul 2024 12:12:09 -0400 Subject: [PATCH] test(e2e): Update test to select other options from Items Per Page (#2417) --- ui/admin/tests/e2e/tests/pagination.spec.js | 28 +++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/ui/admin/tests/e2e/tests/pagination.spec.js b/ui/admin/tests/e2e/tests/pagination.spec.js index ed9e22f90b..83605f07dd 100644 --- a/ui/admin/tests/e2e/tests/pagination.spec.js +++ b/ui/admin/tests/e2e/tests/pagination.spec.js @@ -145,6 +145,34 @@ test('Search and Pagination (Targets) @ce @ent @aws @docker', async ({ await expect( page.getByRole('link', { name: targets[targets.length - 2].name }), ).toBeVisible(); + + // Use the "Items per page" options to show 50 items per page. + await page + .getByRole('combobox', { name: 'Items per page' }) + .selectOption('50'); + await expect( + page.getByRole('link', { name: targets[0].name }), + ).toBeVisible(); + await expect( + page.getByRole('link', { name: targets[targets.length - 1].name }), + ).toBeVisible(); + await expect( + page.getByRole('link', { name: targets[targets.length - 2].name }), + ).toBeVisible(); + + // Use the "Items per page" options to show 10 items per page. + await page + .getByRole('combobox', { name: 'Items per page' }) + .selectOption('10'); + await expect( + page.getByRole('link', { name: targets[0].name }), + ).toBeHidden(); + await expect( + page.getByRole('link', { name: targets[targets.length - 2].name }), + ).toBeVisible(); + await expect( + page.getByRole('link', { name: targets[targets.length - 1].name }), + ).toBeVisible(); } finally { if (org.id) { org = await request.delete(`/v1/scopes/${org.id}`);