Skip to content

Commit

Permalink
Scroll select into view
Browse files Browse the repository at this point in the history
Makes for a nicer screenshot when we fail to select the expected value.
  • Loading branch information
gabrielweyer committed Oct 21, 2024
1 parent 8e98531 commit fe7c7c0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion parser/src/puppeteerExtensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export async function isSelectedCheckbox(page: puppeteer.Page, selector: string)

async function getSelectedValue(page: puppeteer.Page, selector: string): Promise<string> {
const fullSelector = getSelectFullSelector(selector);
await page.waitForSelector(fullSelector, { visible: true });
const select = await page.waitForSelector(fullSelector, { visible: true });
await select.scrollIntoView();
return await page.$eval(fullSelector, node => (<HTMLSelectElement> node).value);
}

Expand Down

0 comments on commit fe7c7c0

Please sign in to comment.