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

Method uncheckOption

lib/helper/WebDriver.js:1405–1420  ·  view source on GitHub ↗

* Appium: not tested * {{> uncheckOption }}

(field, context = null)

Source from the content-addressed store, hash-verified

1403 * {{> uncheckOption }}
1404 */
1405 async uncheckOption(field, context = null) {
1406 const clickMethod = this.browser.isMobile && this.browser.capabilities.platformName !== 'android' ? 'touchClick' : 'elementClick'
1407 const locateFn = prepareLocateFn.call(this, context)
1408
1409 const res = await findCheckable.call(this, field, locateFn)
1410
1411 assertElementExists(res, field, 'Checkable')
1412 const elem = selectElement(res, field, this)
1413 const elementId = getElementId(elem)
1414 highlightActiveElement.call(this, elem)
1415
1416 const isSelected = await isElementChecked(this.browser, elementId)
1417
1418 if (!isSelected) return Promise.resolve(true)
1419 return this.browser[clickMethod](elementId)
1420 }
1421
1422 /**
1423 * {{> grabTextFromAll }}

Callers

nothing calls this directly

Calls 4

selectElementFunction · 0.90
getElementIdFunction · 0.85
isElementCheckedFunction · 0.85
assertElementExistsFunction · 0.70

Tested by

no test coverage detected