From 206168ed2820a801a4f1afac2b6051b71aa00676 Mon Sep 17 00:00:00 2001 From: Dinesh Date: Sat, 2 Oct 2021 07:33:52 +0000 Subject: [PATCH] puppeteer: Remove waitFors on deletion spinners. Also added a waitFor for the modal to disappear and removed waitFor for the spinner to hide which would obviously be hidden with modal and it also doesn't add much value. --- frontend_tests/puppeteer_tests/delete-message.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/frontend_tests/puppeteer_tests/delete-message.ts b/frontend_tests/puppeteer_tests/delete-message.ts index 932f47f270..d9f42094f9 100644 --- a/frontend_tests/puppeteer_tests/delete-message.ts +++ b/frontend_tests/puppeteer_tests/delete-message.ts @@ -20,10 +20,11 @@ async function delete_message_test(page: Page): Promise { await page.waitForSelector("#dialog_widget_modal", {visible: true}); await page.click(".dialog_submit_button"); - await page.waitForSelector(".dialog_submit_button .loader", { - visible: true, - }); - await page.waitForSelector(".dialog_submit_button span", {hidden: true}); + + const confirm_span = ".dialog_submit_button span"; + await page.waitForSelector(confirm_span, {hidden: true}); + + await page.waitForSelector("#dialog_widget_modal", {hidden: true}); await page.waitForFunction( (expected_length: number) => $("#zhome .message_row").length === expected_length, @@ -32,9 +33,6 @@ async function delete_message_test(page: Page): Promise { ); await page.waitForSelector(`#${CSS.escape(last_message_id!)}`, {hidden: true}); - await page.waitForSelector(".dialog_submit_button .loader", { - hidden: true, - }); } common.run_test(delete_message_test);