()
| 259 | } |
| 260 | |
| 261 | const openMenu = async () => { |
| 262 | await button.hover().catch(() => {}); |
| 263 | await button.click().catch(() => {}); |
| 264 | const visibleAfterClick = await menu.isVisible().catch(() => false); |
| 265 | if (visibleAfterClick) { |
| 266 | return true; |
| 267 | } |
| 268 | |
| 269 | await button.evaluate((element) => element.click()).catch(() => {}); |
| 270 | return page.waitForFunction((target) => { |
| 271 | return target instanceof HTMLElement && |
| 272 | target.classList.contains('open') && |
| 273 | window.getComputedStyle(target).display !== 'none' && |
| 274 | window.getComputedStyle(target).visibility !== 'hidden'; |
| 275 | }, await menu.elementHandle(), { timeout: 3000 }).then(() => true).catch(() => false); |
| 276 | }; |
| 277 | |
| 278 | const opened = await openMenu(); |
| 279 | if (!opened) { |
no outgoing calls
no test coverage detected