Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions website/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ export default defineConfig({
trace: 'retain-on-failure',
screenshot: 'only-on-failure',
},
expect: {
timeout: 15_000,
},

projects: [
// API integration tests (browser-independent)
Expand Down
16 changes: 14 additions & 2 deletions website/tests/ViewPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,20 @@ export abstract class ViewPage {

public async fillLineageField(locator: Locator, lineage: string) {
await locator.fill(lineage);
const selectedLineage = this.page.getByRole('listbox').getByRole('option', { name: lineage, exact: false });
await selectedLineage.first().click();

const option = this.page.getByRole('listbox').getByRole('option', { name: lineage, exact: false }).first();

// Filling the field opens the autocomplete menu, but each filter field fetches its options
// from LAPIS independently and a re-render triggered by another field settling can close the
// menu again. When that happens the option never appears and a plain click would wait out the
// whole test timeout. Retry "ensure the menu is open, then click the option" together so a
// transient close cannot wedge the test.
await expect(async () => {
if (!(await option.isVisible())) {
await locator.click(); // re-open the menu
}
await option.click({ timeout: 2_000 });
}).toPass();
}

public async fillMutationField(locator: Locator, mutation: string) {
Expand Down
Loading