Skip to content

Commit 5654a6c

Browse files
committed
test(e2e): use exact model comparison locators
1 parent 821bb68 commit 5654a6c

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

tests/e2e/core-journeys.spec.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@ test('search opens a model detail page', async ({ page }) => {
1414
test('model comparison selection persists across routes', async ({ page }) => {
1515
await page.goto('/models')
1616

17-
await page.getByTitle('Compare: Gemini 3 Flash').click()
18-
await page.getByTitle('Compare: GPT-5.2').click()
17+
const geminiCompare = page.getByTitle('Compare: Gemini 3 Flash', { exact: true })
18+
const gptCompare = page.getByTitle('Compare: GPT-5.2', { exact: true })
19+
20+
await geminiCompare.click()
21+
await gptCompare.click()
1922

2023
const compareLink = page.getByRole('link', { name: /Compare \(2\/2\)/ })
2124
await expect(compareLink).toBeVisible()
@@ -26,8 +29,8 @@ test('model comparison selection persists across routes', async ({ page }) => {
2629
await expect(page.locator('select').nth(1)).toHaveValue('gpt-5-2')
2730

2831
await page.goto('/models')
29-
await expect(page.getByTitle('Compare: Gemini 3 Flash')).toHaveAttribute('aria-pressed', 'true')
30-
await expect(page.getByTitle('Compare: GPT-5.2')).toHaveAttribute('aria-pressed', 'true')
32+
await expect(geminiCompare).toHaveAttribute('aria-pressed', 'true')
33+
await expect(gptCompare).toHaveAttribute('aria-pressed', 'true')
3134
})
3235

3336
test('language switching preserves the current detail route', async ({ page }) => {

0 commit comments

Comments
 (0)