Skip to content

Commit ea25404

Browse files
fhennigFelix Hennigclaude
authored
test(website): make lineage-filter selection resilient to menu re-renders (#1358)
resolves #1255 ### Summary The variant-selection e2e tests (compareSideBySide, singleVariant) were flaky on Firefox/WebKit. The worst failure mode: fillLineageField typed into the lineage autocomplete then clicked the matching dropdown option, but the Downshift menu can be closed again by a concurrent re-render (each filter field fetches its options from LAPIS independently). The option then never appears and the click waits out the full 60s test timeout -- a larger timeout cannot help a closed menu. Re-open the menu and retry the option click together so a transient close cannot wedge the test. Also keep two mitigations for the slower "still loading" failure mode: bump @playwright/test 1.60->1.61 and set a global 15s expect timeout. Co-authored-by: Felix Hennig <felix-agent@felixhennig.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent da9e6b6 commit ea25404

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

website/playwright.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ export default defineConfig({
1818
trace: 'retain-on-failure',
1919
screenshot: 'only-on-failure',
2020
},
21+
expect: {
22+
timeout: 15_000,
23+
},
2124

2225
projects: [
2326
// API integration tests (browser-independent)

website/tests/ViewPage.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,20 @@ export abstract class ViewPage {
3030

3131
public async fillLineageField(locator: Locator, lineage: string) {
3232
await locator.fill(lineage);
33-
const selectedLineage = this.page.getByRole('listbox').getByRole('option', { name: lineage, exact: false });
34-
await selectedLineage.first().click();
33+
34+
const option = this.page.getByRole('listbox').getByRole('option', { name: lineage, exact: false }).first();
35+
36+
// Filling the field opens the autocomplete menu, but each filter field fetches its options
37+
// from LAPIS independently and a re-render triggered by another field settling can close the
38+
// menu again. When that happens the option never appears and a plain click would wait out the
39+
// whole test timeout. Retry "ensure the menu is open, then click the option" together so a
40+
// transient close cannot wedge the test.
41+
await expect(async () => {
42+
if (!(await option.isVisible())) {
43+
await locator.click(); // re-open the menu
44+
}
45+
await option.click({ timeout: 2_000 });
46+
}).toPass();
3547
}
3648

3749
public async fillMutationField(locator: Locator, mutation: string) {

0 commit comments

Comments
 (0)