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

Method _locateCheckable

lib/helper/Puppeteer.js:1030–1037  ·  view source on GitHub ↗

* Find a checkbox by providing human-readable text: * NOTE: Assumes the checkable element exists * * ```js * this.helpers['Puppeteer']._locateCheckable('I agree with terms and conditions').then // ... * ```

(locator, providedContext = null)

Source from the content-addressed store, hash-verified

1028 * ```
1029 */
1030 async _locateCheckable(locator, providedContext = null) {
1031 const context = providedContext || (await this._getContext())
1032 const els = await findCheckable.call(this, locator, context)
1033 if (!els || els.length === 0) {
1034 throw new ElementNotFound(locator, 'Checkbox or radio')
1035 }
1036 return selectElement(els, locator, this)
1037 }
1038
1039 /**
1040 * Find a clickable element by providing human-readable text:

Callers 8

checkOptionMethod · 0.95
uncheckOptionMethod · 0.95
Playwright_test.jsFile · 0.45
WebDriver_test.jsFile · 0.45
Puppeteer_test.jsFile · 0.45

Calls 2

_getContextMethod · 0.95
selectElementFunction · 0.90

Tested by

no test coverage detected