()
| 267 | } |
| 268 | |
| 269 | const openMenu = async () => { |
| 270 | await button.hover().catch(() => {}); |
| 271 | await button.click().catch(() => {}); |
| 272 | const visibleAfterClick = await menu.isVisible().catch(() => false); |
| 273 | if (visibleAfterClick) { |
| 274 | return true; |
| 275 | } |
| 276 | |
| 277 | await button.evaluate((element) => element.click()).catch(() => {}); |
| 278 | return page.waitForFunction((target) => { |
| 279 | return target instanceof HTMLElement && |
| 280 | target.classList.contains('open') && |
| 281 | window.getComputedStyle(target).display !== 'none' && |
| 282 | window.getComputedStyle(target).visibility !== 'hidden'; |
| 283 | }, await menu.elementHandle(), { timeout: 3000 }).then(() => true).catch(() => false); |
| 284 | }; |
| 285 | |
| 286 | const opened = await openMenu(); |
| 287 | if (!opened) { |
no test coverage detected