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_test: Wait for 100ms after typing each char to avoid flake.

Riken Shahf7baa3c388ff
diff --git a/frontend_tests/puppeteer_tests/subscriptions.ts b/frontend_tests/puppeteer_tests/subscriptions.ts
index 93cb190f13b..184937b4747 100644
--- a/frontend_tests/puppeteer_tests/subscriptions.ts
+++ b/frontend_tests/puppeteer_tests/subscriptions.ts
@@ -129,8 +129,13 @@ async function test_user_filter_ui(
// Desdemona should be checked by default
await wait_for_checked(page, "desdemona", true);
- await common.fill_form(page, "form#stream_creation_form", {user_list_filter: "ot"});
+ await page.type(`form#stream_creation_form [name="user_list_filter"]`, "ot", {delay: 100});
await page.waitForSelector("#user-checkboxes", {visible: true});
+ // Wait until filtering is completed.
+ await page.waitForFunction(
+ () => document.querySelectorAll("#user-checkboxes label").length === 1,
+ );
+
await page.waitForSelector(cordelia_checkbox, {hidden: true});
await page.waitForSelector(othello_checkbox, {visible: true});