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

Method executeScript

lib/helper/Puppeteer.js:1961–1967  ·  view source on GitHub ↗

* If a function returns a Promise, tt will wait for its resolution. * * {{> executeScript }}

(...args)

Source from the content-addressed store, hash-verified

1959 * {{> executeScript }}
1960 */
1961 async executeScript(...args) {
1962 let context = await this._getContext()
1963 if (this.context && this.context.constructor.name === 'CdpFrame') {
1964 context = this.context // switching to iframe context
1965 }
1966 return context.evaluate.apply(context, args)
1967 }
1968
1969 /**
1970 * Asynchronous scripts can also be executed with `executeScript` if a function returns a Promise.

Callers 15

_afterMethod · 0.95
_getPageUrlMethod · 0.95
scrollPageToTopMethod · 0.95
scrollPageToBottomMethod · 0.95
scrollToMethod · 0.95
forceClickMethod · 0.95
captureStorageStateFunction · 0.45
evaluateMethod · 0.45
focusMethod · 0.45
evaluateInFrameFunction · 0.45
clearMarkerFunction · 0.45

Calls 1

_getContextMethod · 0.95

Tested by

no test coverage detected