MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / visibleFn

Method visibleFn

lib/helper/Puppeteer.js:2360–2366  ·  view source on GitHub ↗
(locator, num)

Source from the content-addressed store, hash-verified

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) {

Callers

nothing calls this directly

Calls 2

filterMethod · 0.80
$XPathFunction · 0.70

Tested by

no test coverage detected