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: Wait till background mouse events are enabled in settings test.

sahil83946db1da9a963
diff --git a/frontend_tests/puppeteer_tests/16-settings.ts b/frontend_tests/puppeteer_tests/16-settings.ts
index 3d164633489..a54335461d1 100644
--- a/frontend_tests/puppeteer_tests/16-settings.ts
+++ b/frontend_tests/puppeteer_tests/16-settings.ts
@@ -45,6 +45,8 @@ async function test_change_full_name(page: Page): Promise<void> {
await page.type(full_name_input_selector, "New name");
await page.click(change_full_name_button_selector);
await page.waitForFunction(() => $("#change_full_name").text().trim() === "New name");
+ // Ensure that the mouse events are enabled for the background for further tests.
+ await page.waitForFunction(() => $(".overlay.show").attr("style") === undefined);
}
async function test_change_password(page: Page): Promise<void> {
@@ -64,6 +66,8 @@ async function test_change_password(page: Page): Promise<void> {
// On success the change password modal gets closed.
await page.waitForFunction(() => $("#change_password_modal").attr("aria-hidden") === "true");
+ // Ensure that the mouse events are enabled for the background for further tests.
+ await page.waitForFunction(() => $(".overlay.show").attr("style") === undefined);
}
async function test_get_api_key(page: Page): Promise<void> {
@@ -93,6 +97,8 @@ async function test_get_api_key(page: Page): Promise<void> {
const zuliprc_decoded_url = await get_decoded_url_in_selector(page, download_zuliprc_selector);
assert(zuliprc_regex.test(zuliprc_decoded_url), "Incorrect zuliprc file");
await page.click("#api_key_modal .close");
+ // Ensure that the mouse events are enabled for the background for further tests.
+ await page.waitForFunction(() => $(".overlay.show").attr("style") === undefined);
}
async function test_webhook_bot_creation(page: Page): Promise<void> {
@@ -175,6 +181,9 @@ async function test_edit_bot_form(page: Page): Promise<void> {
await page.waitForXPath(
`//*[@class="btn open_edit_bot_form" and @data-email="${bot1_email}"]/ancestor::*[@class="details"]/*[@class="name" and text()="Bot one"]`,
);
+
+ // Ensure that the mouse events are enabled for the background for further tests.
+ await page.waitForFunction(() => $(".overlay.show").attr("style") === undefined);
}
async function test_your_bots_section(page: Page): Promise<void> {