Compare commits

...
Author SHA1 Message Date
paseo-bot[bot]andClaude Opus 5.5 32cae04627 Wait for the plugin results route after a directory search (#11939)
The URL changes as soon as the directory submits a search, but the
results route renders only after its registry server call returns. On a
loaded CI runner that call took over 5 s, so the WebKit test failed at
the results heading. Give the directory-to-results transition the same
10 s budget the missed-input-event test already used, in one helper.

Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 21:18:20 +00:00
+11 -8
View File
@@ -185,9 +185,7 @@ test("filters by search and clears to all plugins", async ({ page }) => {
await submitSearch(page, "graphite");
await expect(page).toHaveURL(/\/plugins\/all\?q=graphite$/);
await expect(
page.getByRole("heading", { level: 1, name: /^Results for “graphite”/ }),
).toBeVisible();
await expectSearchResultsAfterDirectory(page, "graphite");
await expect(page.getByRole("main").getByRole("link", { name: /Graphite/ })).toBeVisible();
await expect(page.getByRole("link", { name: /Dracula/ })).toHaveCount(0);
@@ -217,10 +215,7 @@ test("submits the visible search term when its input event was missed", async ({
await page.keyboard.press("Enter");
await expect(page).toHaveURL(/\/plugins\/all\?q=graphite&window=month$/);
// The URL changes before the results route finishes loading its data and code.
await expect(
page.getByRole("heading", { level: 1, name: /^Results for “graphite”/ }),
).toBeVisible({ timeout: 10000 });
await expectSearchResultsAfterDirectory(page, "graphite");
await expect(page.getByRole("link", { name: "This month" })).toHaveAttribute(
"aria-current",
"true",
@@ -286,7 +281,7 @@ test("searches from the directory on submit, and Back returns to the directory",
await page.keyboard.press("Enter");
await expect(page).toHaveURL(/\/plugins\/all\?q=gra$/);
await expect(page.getByRole("heading", { level: 1, name: /^Results for “gra”/ })).toBeVisible();
await expectSearchResultsAfterDirectory(page, "gra");
expect(await historyLength(page)).toBe(entries + 1);
await page.goBack();
@@ -501,6 +496,14 @@ async function expectDirectorySearch(page: Page, term: string, window: string) {
);
}
// The URL changes as soon as the directory submits, but the results route shows only after
// its registry server call returns. On a loaded CI runner that call has taken over 4 s.
async function expectSearchResultsAfterDirectory(page: Page, term: string) {
await expect(
page.getByRole("heading", { level: 1, name: new RegExp(`^Results for “${term}”`) }),
).toBeVisible({ timeout: 10000 });
}
async function typeSearch(page: Page, term: string) {
await page.getByRole("searchbox", { name: "Search plugins" }).pressSequentially(term);
}