Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

puppeteer: Fix messages not being echoed locally.

Dinesh50a01311c0bd
diff --git a/frontend_tests/puppeteer_lib/common.js b/frontend_tests/puppeteer_lib/common.js
index d3d0b014f7b..93fde250a42 100644
--- a/frontend_tests/puppeteer_lib/common.js
+++ b/frontend_tests/puppeteer_lib/common.js
@@ -189,15 +189,9 @@ class CommonUtils {
password: credentials.password,
};
await this.fill_form(page, "#login_form", params);
+ await page.$eval("#login_form", (form) => form.submit());
- // We wait until DOMContentLoaded event is fired to ensure that zulip JavaScript
- // is executed since some of our tests access those through page.evaluate. We use defer
- // tag for script tags that load JavaScript which means that whey will be executed after DOM
- // is parsed but before DOMContentLoaded event is fired.
- await Promise.all([
- page.waitForNavigation({waitUntil: "domcontentloaded"}),
- page.$eval("#login_form", (form) => form.submit()),
- ]);
+ await page.waitForSelector("#zhome .message_row", {visible: true});
}
async log_out(page) {
diff --git a/frontend_tests/puppeteer_tests/03-compose.js b/frontend_tests/puppeteer_tests/03-compose.js
index 8a398c763b9..71dd09d32d8 100644
--- a/frontend_tests/puppeteer_tests/03-compose.js
+++ b/frontend_tests/puppeteer_tests/03-compose.js
@@ -26,7 +26,6 @@ function get_last_element(array) {
}
async function test_send_messages(page) {
- await page.waitForSelector("#zhome .message_row", {visible: true});
const initial_msgs_count = await page.evaluate(() => $("#zhome .message_row").length);
await common.send_multiple_messages(page, [