(assertType, option)
| 3214 | } |
| 3215 | |
| 3216 | async 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 | |
| 3240 | async function findVisibleFields(locator, context = null) { |
| 3241 | const els = await findFields.call(this, locator, context) |
nothing calls this directly
no test coverage detected