mirror of https://github.com/zulip/zulip.git
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:
parent
6c6b6643ce
commit
49193231aa
|
@ -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> {
|
||||
|
|
Loading…
Reference in New Issue