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

Method fillField

lib/helper/Playwright.js:2278–2295  ·  view source on GitHub ↗

* {{> fillField }} *

(field, value, context = null)

Source from the content-addressed store, hash-verified

2276 *
2277 */
2278 async fillField(field, value, context = null) {
2279 const els = await findFields.call(this, field, context)
2280 assertElementExists(els, field, 'Field')
2281 const el = selectElement(els, field, this)
2282
2283 await highlightActiveElement.call(this, el)
2284
2285 if (await fillRichEditor(this, el, value)) {
2286 return this._waitForAction()
2287 }
2288
2289 await el.clear()
2290 if (store.debugMode) this.debugSection('Focused', await elToString(el, 1))
2291
2292 await el.type(value.toString(), { delay: this.options.pressKeyDelay })
2293
2294 return this._waitForAction()
2295 }
2296
2297 /**
2298 * {{> clearField }}

Callers

nothing calls this directly

Calls 8

_waitForActionMethod · 0.95
selectElementFunction · 0.90
fillRichEditorFunction · 0.90
elToStringFunction · 0.85
assertElementExistsFunction · 0.70
clearMethod · 0.45
typeMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected