clickIfExists only if isVisible, closes #20
This commit is contained in:
parent
08da100646
commit
6f2271168d
1 changed files with 1 additions and 1 deletions
|
|
@ -39,7 +39,7 @@ const page = context.pages()[0];
|
|||
console.debug('userAgent:', await page.evaluate(() => navigator.userAgent));
|
||||
|
||||
const clickIfExists = async selector => {
|
||||
if (await page.locator(selector).count() > 0)
|
||||
if (await page.locator(selector).count() > 0 && await page.locator(selector).isVisible())
|
||||
await page.click(selector);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue