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

Function findClickable

lib/helper/WebDriver.js:3039–3071  ·  view source on GitHub ↗
(locator, locateFn)

Source from the content-addressed store, hash-verified

3037}
3038
3039async function findClickable(locator, locateFn) {
3040 locator = new Locator(locator)
3041
3042 if (this._isCustomLocator(locator)) {
3043 return locateFn(locator.value)
3044 }
3045
3046 if (locator.isAccessibilityId() && !this.isWeb) return locateFn(locator, true)
3047 if (locator.isRole()) return locateFn(locator, true)
3048 if (!locator.isFuzzy()) return locateFn(locator, true)
3049
3050 let els
3051 const literal = xpathLocator.literal(locator.value)
3052
3053 els = await locateFn(Locator.clickable.narrow(literal))
3054 if (els.length) return els
3055
3056 // Try ARIA selector for accessible name
3057 try {
3058 els = await locateFn(`aria/${locator.value}`)
3059 if (els.length) return els
3060 } catch (e) {
3061 // ARIA selector not supported or failed
3062 }
3063
3064 els = await locateFn(Locator.clickable.wide(literal))
3065 if (els.length) return els
3066
3067 els = await locateFn(Locator.clickable.self(literal))
3068 if (els.length) return els
3069
3070 return await locateFn(locator.value) // by css or xpath
3071}
3072
3073async function findFields(locator, context = null) {
3074 const locateFn = prepareLocateFn.call(this, context)

Callers

nothing calls this directly

Calls 4

_isCustomLocatorMethod · 0.80
isAccessibilityIdMethod · 0.80
isRoleMethod · 0.80
isFuzzyMethod · 0.80

Tested by

no test coverage detected