Browse Source

change tests assuming result will be at top

pull/121/head
Trent Larson 3 weeks ago
parent
commit
acf04792be
  1. 4
      test-playwright/20-create-project.spec.ts

4
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 // Search for newly-created project in /projects
await page.goto('./projects'); await page.goto('./projects');
await page.getByRole('link', { name: 'Projects', exact: true }).click(); 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 // Search for newly-created project in /discover
await page.goto('./discover'); await page.goto('./discover');
await page.getByPlaceholder('Search…').fill(finalRandomString); await page.getByPlaceholder('Search…').fill(finalRandomString);
await page.locator('#QuickSearch button').click(); 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 // Edit the project
await page.locator('a').filter({ hasText: finalTitle }).first().click(); await page.locator('a').filter({ hasText: finalTitle }).first().click();

Loading…
Cancel
Save