puppeteer_lib: Supply missing $eval arugment.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2021-02-19 21:27:11 -08:00 committed by Tim Abbott
parent 72142273c0
commit ad540dac3a
1 changed files with 9 additions and 5 deletions

View File

@ -117,11 +117,15 @@ class CommonUtils {
const name_selector = `${form_selector} [name="${name}"]`;
const value = params[name];
if (typeof value === "boolean") {
await page.$eval(name_selector, (el, value) => {
if (el.checked !== value) {
el.click();
}
});
await page.$eval(
name_selector,
(el, value) => {
if (el.checked !== value) {
el.click();
}
},
value,
);
} else if (await is_dropdown(page, name)) {
await page.select(name_selector, params[name]);
} else {