fix playwright tests (#759)
This commit is contained in:
@@ -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=.*/);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user