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.
This commit is contained in:
Dinesh 2021-10-02 07:33:52 +00:00 committed by Tim Abbott
parent 0cd68b895c
commit 206168ed28
1 changed files with 5 additions and 7 deletions

View File

@ -20,10 +20,11 @@ async function delete_message_test(page: Page): Promise<void> {
await page.waitForSelector("#dialog_widget_modal", {visible: true}); await page.waitForSelector("#dialog_widget_modal", {visible: true});
await page.click(".dialog_submit_button"); await page.click(".dialog_submit_button");
await page.waitForSelector(".dialog_submit_button .loader", {
visible: true, const confirm_span = ".dialog_submit_button span";
}); await page.waitForSelector(confirm_span, {hidden: true});
await page.waitForSelector(".dialog_submit_button span", {hidden: true});
await page.waitForSelector("#dialog_widget_modal", {hidden: true});
await page.waitForFunction( await page.waitForFunction(
(expected_length: number) => $("#zhome .message_row").length === expected_length, (expected_length: number) => $("#zhome .message_row").length === expected_length,
@ -32,9 +33,6 @@ async function delete_message_test(page: Page): Promise<void> {
); );
await page.waitForSelector(`#${CSS.escape(last_message_id!)}`, {hidden: true}); 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); common.run_test(delete_message_test);