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

Function checkFocusBeforeType

lib/helper/extras/focusCheck.js:14–21  ·  view source on GitHub ↗
(helper)

Source from the content-addressed store, hash-verified

12}
13
14export async function checkFocusBeforeType(helper) {
15 if (!helper.options.strict && !store.debugMode) return
16 if (!await isNoElementFocused(helper)) return
17
18 const message = 'No element is in focus. Use I.click() or I.focus() to activate an element before typing.'
19 if (helper.options.strict) throw new NonFocusedType(message)
20 helper.debugSection('Warning', message)
21}
22
23export async function checkFocusBeforePressKey(helper, originalKey) {
24 if (!helper.options.strict && !store.debugMode) return

Callers 3

typeMethod · 0.90
typeMethod · 0.90
typeMethod · 0.90

Calls 1

isNoElementFocusedFunction · 0.85

Tested by

no test coverage detected