test(e2e): wait for the zone page after an import apply
This commit is contained in:
1 parent
1cafcc759e
commit
5d7da681e7
1 file changed
+8
@@ -579,8 +579,16 @@ export class Ui {
|
|||||||
result = { status: response.status(), json: await response.json() };
|
result = { status: response.status(), json: await response.json() };
|
||||||
await route.fulfill({ response });
|
await route.fulfill({ response });
|
||||||
}, { times: 1 });
|
}, { 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'));
|
await this.submitAndWait('POST', path, () => this.page.click('#import-apply'));
|
||||||
if (!result) throw new Error('no import apply response');
|
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;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user