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

Function proceedMultiple

lib/helper/WebDriver.js:3104–3119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3102 const elemId = getElementId(elem)
3103
3104 const proceedMultiple = async fields => {
3105 const fieldResults = toArray(
3106 await forEachAsync(fields, async el => {
3107 const elementId = getElementId(el)
3108 return this.browser.getElementAttribute(elementId, 'value')
3109 }),
3110 )
3111
3112 if (typeof value === 'boolean') {
3113 equals(`no. of items matching > 0: ${field}`)[assertType](value, !!fieldResults.length)
3114 } else {
3115 // Assert that results were found so the forEach assert does not silently pass
3116 equals(`no. of items matching > 0: ${field}`)[assertType](true, !!fieldResults.length)
3117 fieldResults.forEach(val => stringIncludes(`fields by ${field}`)[assertType](value, val))
3118 }
3119 }
3120
3121 const proceedSingle = async el => {
3122 let res = await el.getValue()

Callers 1

proceedSeeFieldFunction · 0.70

Calls 4

equalsFunction · 0.90
forEachAsyncFunction · 0.85
getElementIdFunction · 0.85
toArrayFunction · 0.70

Tested by

no test coverage detected