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

Function proceedClick

lib/helper/Puppeteer.js:3092–3117  ·  view source on GitHub ↗
(locator, context = null, options = {})

Source from the content-addressed store, hash-verified

3090}
3091
3092async function proceedClick(locator, context = null, options = {}) {
3093 let matcher = await this.context
3094 if (context) {
3095 const els = await this._locate(context)
3096 assertElementExists(els, context)
3097 matcher = els[0]
3098 }
3099 const els = await findClickable.call(this, matcher, locator)
3100 if (context) {
3101 assertElementExists(els, locator, 'Clickable element', `was not found inside element ${new Locator(context).toString()}`)
3102 } else {
3103 assertElementExists(els, locator, 'Clickable element')
3104 }
3105 const el = selectElement(els, locator, this)
3106
3107 highlightActiveElement.call(this, el, await this._getContext())
3108
3109 await el.click(options)
3110 const promises = []
3111 if (options.waitForNavigation) {
3112 promises.push(this.waitForNavigation())
3113 }
3114 promises.push(this._waitForAction())
3115
3116 return Promise.all(promises)
3117}
3118
3119async function findClickable(matcher, locator) {
3120 const matchedLocator = new Locator(locator)

Callers

nothing calls this directly

Calls 9

selectElementFunction · 0.90
pushMethod · 0.80
assertElementExistsFunction · 0.70
_locateMethod · 0.45
toStringMethod · 0.45
_getContextMethod · 0.45
clickMethod · 0.45
waitForNavigationMethod · 0.45
_waitForActionMethod · 0.45

Tested by

no test coverage detected