From 5d7da681e7a646815824a5f50533bf8c2c20fb72 Mon Sep 17 00:00:00 2001 From: Bryan Joshua Pedini Date: Thu, 19 Nov 2026 14:52:11 +0100 Subject: [PATCH] test(e2e): wait for the zone page after an import apply --- e2e/harness/ui.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/e2e/harness/ui.ts b/e2e/harness/ui.ts index aaf0448..c1de7f8 100644 --- a/e2e/harness/ui.ts +++ b/e2e/harness/ui.ts @@ -579,8 +579,16 @@ export class Ui { result = { status: response.status(), json: await response.json() }; await route.fulfill({ response }); }, { times: 1 }); + const navigated = this.page + .waitForURL((url) => /^\/zones\/[^/]+$/.test(url.pathname), { waitUntil: 'load' }) + .then(() => true, () => false); await this.submitAndWait('POST', path, () => this.page.click('#import-apply')); if (!result) throw new Error('no import apply response'); + if (result.status === 200) { + if (!(await navigated)) throw new Error('import apply did not return to the zone page'); + await expect(this.page.locator('#records-status')).not.toHaveText('Loading records...'); + await this.settle(); + } return result; }