From acf04792be62646d7a402c855eb8f6359bed12e9 Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Thu, 29 Aug 2024 19:49:35 -0600 Subject: [PATCH] change tests assuming result will be at top --- test-playwright/20-create-project.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test-playwright/20-create-project.spec.ts b/test-playwright/20-create-project.spec.ts index ed27bba3c..f46226b92 100644 --- a/test-playwright/20-create-project.spec.ts +++ b/test-playwright/20-create-project.spec.ts @@ -64,13 +64,13 @@ test('Create new project, then search for it', async ({ page }) => { // Search for newly-created project in /projects await page.goto('./projects'); await page.getByRole('link', { name: 'Projects', exact: true }).click(); - await expect(page.locator('ul#listProjects li.border-b:nth-child(1)')).toContainText(finalRandomString); // Assumes newest project always appears first in the Projects tab list + await expect(page.locator('ul#listProjects li').filter({ hasText: finalTitle })).toBeVisible(); // Search for newly-created project in /discover await page.goto('./discover'); await page.getByPlaceholder('Search…').fill(finalRandomString); await page.locator('#QuickSearch button').click(); - await expect(page.locator('ul#listDiscoverResults li.border-b:nth-child(1)')).toContainText(finalRandomString); + await expect(page.locator('ul#listDiscoverResults li').filter({ hasText: finalTitle })).toBeVisible(); // Edit the project await page.locator('a').filter({ hasText: finalTitle }).first().click();