* Appium: not tested * {{> checkOption }}
(field, context = null)
| 1382 | * {{> checkOption }} |
| 1383 | */ |
| 1384 | async checkOption(field, context = null) { |
| 1385 | const clickMethod = this.browser.isMobile && this.browser.capabilities.platformName !== 'android' ? 'touchClick' : 'elementClick' |
| 1386 | const locateFn = prepareLocateFn.call(this, context) |
| 1387 | |
| 1388 | const res = await findCheckable.call(this, field, locateFn) |
| 1389 | |
| 1390 | assertElementExists(res, field, 'Checkable') |
| 1391 | const elem = selectElement(res, field, this) |
| 1392 | const elementId = getElementId(elem) |
| 1393 | highlightActiveElement.call(this, elem) |
| 1394 | |
| 1395 | const isSelected = await isElementChecked(this.browser, elementId) |
| 1396 | |
| 1397 | if (isSelected) return Promise.resolve(true) |
| 1398 | return this.browser[clickMethod](elementId) |
| 1399 | } |
| 1400 | |
| 1401 | /** |
| 1402 | * Appium: not tested |
nothing calls this directly
no test coverage detected