mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 20:44:04 +00:00
puppeteer_test: Improve how we select the typeahead element.
Our typeahead system is very sensitive, a simple internal focus can hide it. This leads to occasional failure on the puppeteer test. This commit tries to solve it by clicking via javascript instead of manual puppeteer click.
This commit is contained in:
@@ -482,8 +482,11 @@ class CommonUtils {
|
||||
await this.clear_and_type(page, field_selector, str);
|
||||
const entry = await page.waitForXPath(
|
||||
`//*[@class="typeahead dropdown-menu" and contains(@style, "display: block")]//li[contains(normalize-space(), "${item}")]//a`,
|
||||
{visible: true},
|
||||
);
|
||||
await entry!.click();
|
||||
await page.evaluate((entry) => {
|
||||
entry.click();
|
||||
}, entry);
|
||||
}
|
||||
|
||||
async wait_for_modal_to_close(page: Page): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user