MCPcopy
hub / github.com/codeceptjs/CodeceptJS / uncheckOption

Method uncheckOption

lib/helper/Puppeteer.js:1486–1502  ·  view source on GitHub ↗

* {{> uncheckOption }}

(field, context = null)

Source from the content-addressed store, hash-verified

1484 * {{> uncheckOption }}
1485 */
1486 async uncheckOption(field, context = null) {
1487 const elm = await this._locateCheckable(field, context)
1488 let curentlyChecked = await elm
1489 .getProperty('checked')
1490 .then(checkedProperty => checkedProperty.jsonValue())
1491 .catch(() => null)
1492
1493 if (!curentlyChecked) {
1494 const ariaChecked = await elm.evaluate(el => el.getAttribute('aria-checked'))
1495 curentlyChecked = ariaChecked === 'true'
1496 }
1497
1498 if (curentlyChecked) {
1499 await elm.click()
1500 return this._waitForAction()
1501 }
1502 }
1503
1504 /**
1505 * {{> seeCheckboxIsChecked }}

Callers 8

Playwright_test.jsFile · 0.45
WebDriver_test.jsFile · 0.45
Puppeteer_test.jsFile · 0.45
testsFunction · 0.45

Calls 6

_locateCheckableMethod · 0.95
_waitForActionMethod · 0.95
getPropertyMethod · 0.80
evaluateMethod · 0.80
getAttributeMethod · 0.80
clickMethod · 0.45

Tested by

no test coverage detected