fix playwright tests (#759)

This commit is contained in:
slothful-vassal
2026-02-01 21:02:36 +01:00
committed by GitHub
parent 029f1f134b
commit 6d5494935d
8 changed files with 90 additions and 42 deletions

View File

@@ -10,14 +10,20 @@ export class IndexPage {
}
async goto() {
await this.page.goto('/');
await this.page.goto('/', { waitUntil: 'networkidle' });
}
async search() {
// Start waiting for response before triggering the search
const responsePromise = this.page.waitForResponse(resp =>
resp.url().includes('/api/v1/search/multi') && resp.status() === 200
);
await this.page.locator('input[name="q"]').fill('Munich');
await this.page.waitForResponse('**/api/v1/search/multi');
await responsePromise;
await this.page.locator('.menu-item').first().click();
await this.page.waitForURL('/map?lat=48.13743&lon=11.57549');
await this.page.waitForURL(/\/map\?lat=.*&lon=.*/);
}