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

Function proceedIsChecked

lib/helper/Puppeteer.js:3216–3238  ·  view source on GitHub ↗
(assertType, option)

Source from the content-addressed store, hash-verified

3214}
3215
3216async function proceedIsChecked(assertType, option) {
3217 let els = await findCheckable.call(this, option)
3218 assertElementExists(els, option, 'Checkable')
3219
3220 const checkedStates = await Promise.all(
3221 els.map(async el => {
3222 const checked = await el
3223 .getProperty('checked')
3224 .then(p => p.jsonValue())
3225 .catch(() => null)
3226
3227 if (checked) {
3228 return checked
3229 }
3230
3231 const ariaChecked = await el.evaluate(el => el.getAttribute('aria-checked'))
3232 return ariaChecked === 'true'
3233 }),
3234 )
3235
3236 const selected = checkedStates.reduce((prev, cur) => prev || cur)
3237 return truth(`checkable ${option}`, 'to be checked')[assertType](selected)
3238}
3239
3240async function findVisibleFields(locator, context = null) {
3241 const els = await findFields.call(this, locator, context)

Callers

nothing calls this directly

Calls 5

truthFunction · 0.90
getPropertyMethod · 0.80
evaluateMethod · 0.80
getAttributeMethod · 0.80
assertElementExistsFunction · 0.70

Tested by

no test coverage detected