([locator, num])
| 3251 | const context = await this._getContext() |
| 3252 | if (locator.isCSS()) { |
| 3253 | const visibleFn = function ([locator, num]) { |
| 3254 | const els = document.querySelectorAll(locator) |
| 3255 | if (!els || els.length === 0) { |
| 3256 | return false |
| 3257 | } |
| 3258 | return Array.prototype.filter.call(els, el => el.offsetParent !== null).length === num |
| 3259 | } |
| 3260 | waiter = context.waitForFunction(visibleFn, [locator.value, num], { timeout: waitTimeout }) |
| 3261 | } else { |
| 3262 | const visibleFn = function ([locator, $XPath, num]) { |