Skip to content

Commit 440b654

Browse files
cdervclaude
andcommitted
Use role-based locators instead of Algolia CSS classes
Replace .aa-DetachedSearchButton and .aa-Input with ARIA role locators (getByRole('button'), getByRole('searchbox')). These are resilient to Algolia autocomplete class name changes and follow Playwright best practices used elsewhere in the test suite. Co-Authored-By: Claude Opus 4.6 <[email protected]>
1 parent 417faf0 commit 440b654

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

tests/integration/playwright/tests/html-search-highlight.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ test('Search highlights cleared when query changes', async ({ page }) => {
2222

2323
await expect(marks.first()).toBeVisible({ timeout: 5000 });
2424

25-
// Open the detached search overlay
26-
await page.locator('.aa-DetachedSearchButton').click();
27-
const input = page.locator('.aa-Input');
25+
// Open the search overlay and type a different query
26+
await page.locator('#quarto-search').getByRole('button').click();
27+
const input = page.getByRole('searchbox');
2828
await expect(input).toBeVisible({ timeout: 2000 });
2929

30-
// Type a different query triggers onStateChange which clears marks
30+
// Typing a different query triggers onStateChange which clears marks
3131
await input.fill('different');
3232
await expect(page.locator('main mark')).toHaveCount(0, { timeout: 2000 });
3333
});

0 commit comments

Comments
 (0)