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

Function findClickable

lib/helper/Puppeteer.js:3119–3149  ·  view source on GitHub ↗
(matcher, locator)

Source from the content-addressed store, hash-verified

3117}
3118
3119async function findClickable(matcher, locator) {
3120 const matchedLocator = new Locator(locator)
3121
3122 if (!matchedLocator.isFuzzy()) return findElements.call(this, matcher, matchedLocator)
3123
3124 let els
3125 const literal = xpathLocator.literal(matchedLocator.value)
3126
3127 els = await findElements.call(this, matcher, Locator.clickable.narrow(literal))
3128 if (els.length) return els
3129
3130 els = await findElements.call(this, matcher, Locator.clickable.wide(literal))
3131 if (els.length) return els
3132
3133 try {
3134 els = await findElements.call(this, matcher, Locator.clickable.self(literal))
3135 if (els.length) return els
3136 } catch (err) {
3137 // Do nothing
3138 }
3139
3140 // Try ARIA selector for accessible name
3141 try {
3142 els = await matcher.$$(`::-p-aria(${matchedLocator.value})`)
3143 if (els.length) return els
3144 } catch (err) {
3145 // ARIA selector not supported or failed
3146 }
3147
3148 return findElements.call(this, matcher, matchedLocator.value) // by css or xpath
3149}
3150
3151async function proceedSee(assertType, text, context, strict = false) {
3152 let description

Callers

nothing calls this directly

Calls 2

isFuzzyMethod · 0.95
$$Method · 0.80

Tested by

no test coverage detected