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

Method focus

lib/helper/Puppeteer.js:858–867  ·  view source on GitHub ↗

* {{> focus }} *

(locator)

Source from the content-addressed store, hash-verified

856 *
857 */
858 async focus(locator) {
859 const el = await this._locateElement(locator)
860 if (!el) {
861 throw new ElementNotFound(locator, 'Element to focus')
862 }
863
864 await el.click()
865 await el.focus()
866 return this._waitForAction()
867 }
868
869 /**
870 * {{> blur }}

Callers 9

clientSideFnFunction · 0.45
focusMarkedInFrameScriptFunction · 0.45
selectAllInFrameScriptFunction · 0.45
selectAllInEditableFunction · 0.45
fillRichEditorFunction · 0.45
testsFunction · 0.45

Calls 3

_locateElementMethod · 0.95
_waitForActionMethod · 0.95
clickMethod · 0.45

Tested by

no test coverage detected