mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
puppetter: Add a waitForNavigation call before asserting the url.
Since we are doing a assert call checking a url without no page.waitForSelector or similar calls, we add this to avoid flakes where the assert is called when we are in process of navigation to the page. Also, we use Promise.all here, and call page.waitForNavigation first, to avoid race conditions where form is submitted quickly and navigation occurs and then we are stuck waiting for a navigation. There were no flakes in the CI related to this issue, but I expect someone with a slow hardware would probably stumble upto this in future.
This commit is contained in:
committed by
Tim Abbott
parent
60c92b69c5
commit
60fa848aea
@@ -12,7 +12,10 @@ async function realm_creation_tests(page) {
|
||||
// submit the email for realm creation.
|
||||
await page.waitForSelector('#email');
|
||||
await page.type('#email', email);
|
||||
await page.$eval('#send_confirm', form => form.submit());
|
||||
await Promise.all([
|
||||
page.waitForNavigation(),
|
||||
page.$eval('#send_confirm', form => form.submit()),
|
||||
]);
|
||||
|
||||
// Make sure onfirmation email is sent.
|
||||
assert(page.url().includes('/accounts/new/send_confirm/' + email));
|
||||
|
||||
Reference in New Issue
Block a user