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

Method valueFn

lib/helper/Puppeteer.js:2330–2336  ·  view source on GitHub ↗
(locator, value)

Source from the content-addressed store, hash-verified

2328 const context = await this._getContext()
2329 if (locator.isCSS()) {
2330 const valueFn = function (locator, value) {
2331 const els = document.querySelectorAll(locator)
2332 if (!els || els.length === 0) {
2333 return false
2334 }
2335 return Array.prototype.filter.call(els, el => (el.value.toString() || '').indexOf(value) !== -1).length > 0
2336 }
2337 waiter = context.waitForFunction(valueFn, { timeout: waitTimeout }, locator.value, value)
2338 } else {
2339 const valueFn = function (locator, $XPath, value) {

Callers

nothing calls this directly

Calls 3

filterMethod · 0.80
$XPathFunction · 0.70
toStringMethod · 0.45

Tested by

no test coverage detected