From d5da7276a8b3beaa0ccb36ba5592d92f91932e6e Mon Sep 17 00:00:00 2001 From: Theo Sanderson Date: Wed, 26 Feb 2025 00:47:27 +0000 Subject: [PATCH] fix --- website/tests/pages/search/index.spec.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/website/tests/pages/search/index.spec.ts b/website/tests/pages/search/index.spec.ts index 25fcf6092..a1144b341 100644 --- a/website/tests/pages/search/index.spec.ts +++ b/website/tests/pages/search/index.spec.ts @@ -159,13 +159,18 @@ test.describe('The search page', () => { }); test('should add selected sequence to URL when clicking a sequence', async ({ searchPage, page }) => { - // Go to search page and click a sequence + // Go to search page await searchPage.goto(); - const firstAccessionLink = page.locator('tr').nth(1).locator('a').first(); - const accessionId = await firstAccessionLink.textContent(); + + // Get accessions using the helper method that returns a Promise + const accessions = await searchPage.getAccessions(1); + const accessionId = accessions[0]; + + // Find the link with the accession ID + const accessionLink = page.getByRole('link', { name: accessionId }); // Click to show the sequence preview modal - await firstAccessionLink.click(); + await accessionLink.click(); // Wait for the modal to appear await expect(page.getByText('Amino acid mutations')).toBeVisible({ timeout: 30000 });