(locator, num)
| 2358 | const context = await this._getContext() |
| 2359 | if (locator.isCSS()) { |
| 2360 | const visibleFn = function (locator, num) { |
| 2361 | const els = document.querySelectorAll(locator) |
| 2362 | if (!els || els.length === 0) { |
| 2363 | return false |
| 2364 | } |
| 2365 | return Array.prototype.filter.call(els, el => el.offsetParent !== null).length === num |
| 2366 | } |
| 2367 | waiter = context.waitForFunction(visibleFn, { timeout: waitTimeout }, locator.value, num) |
| 2368 | } else { |
| 2369 | const visibleFn = function (locator, $XPath, num) { |