common: Add a proper delay.

This commit is contained in:
Aman Agrawal
2025-07-02 10:44:03 +05:30
parent 1e4b0bdfea
commit 8f1f34b2ea

View File

@@ -39,7 +39,9 @@ export const pm_recipient = {
// a flake where the typeahead doesn't show up. // a flake where the typeahead doesn't show up.
// The flake seems to be due to some method that triggers focus on // The flake seems to be due to some method that triggers focus on
// compose textarea, which causes the typeahead to not show up. // compose textarea, which causes the typeahead to not show up.
await page.type("#private_message_recipient", recipient, {delay: 200}); // Add a delay before typing.
await timersPromises.setTimeout(100);
await page.type("#private_message_recipient", recipient);
// PM typeaheads always have an image. This ensures we are waiting for the right typeahead to appear. // PM typeaheads always have an image. This ensures we are waiting for the right typeahead to appear.
const entry = await page.waitForSelector(".typeahead .active a .typeahead-image", { const entry = await page.waitForSelector(".typeahead .active a .typeahead-image", {