drafts: Fix flaky test by waiting for compose box to clear.

Fixes flaky test mentioned on CZO here:
https://chat.zulip.org/#narrow/stream/43-automated-testing/topic/main.20failing/near/1478126
Test was introduced here: #23820.

The compose box clear happens after the message is sent,
and the test wasn't consistently waiting for the compose
box to successfully clear. This change forces a wait.
This commit is contained in:
evykassirer 2022-12-11 22:29:46 -08:00 committed by Tim Abbott
parent 7d17a11db0
commit a972804de3
1 changed files with 1 additions and 1 deletions

View File

@ -244,7 +244,7 @@ async function test_delete_draft_on_sending(page: Page): Promise<void> {
console.log("Sending draft.");
await page.waitForSelector("#compose-send-button", {visible: true});
await page.click("#compose-send-button");
await common.assert_compose_box_content(page, "");
await page.waitForSelector('xpath///*[@id="compose-textarea" and normalize-space()=""]');
await page.waitForSelector(
`xpath///*[${common.has_class_x("top_left_drafts")}]//*[${common.has_class_x(
"unread_count",