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

Function filterSelectedByValue

lib/helper/WebDriver.js:3137–3144  ·  view source on GitHub ↗
(elements, value)

Source from the content-addressed store, hash-verified

3135 const filterBySelected = async elements => filterAsync(elements, async el => this.browser.isElementSelected(getElementId(el)))
3136
3137 const filterSelectedByValue = async (elements, value) => {
3138 return filterAsync(elements, async el => {
3139 const elementId = getElementId(el)
3140 const currentValue = await this.browser.getElementAttribute(elementId, 'value')
3141 const isSelected = await this.browser.isElementSelected(elementId)
3142 return currentValue === value && isSelected
3143 })
3144 }
3145
3146 const tag = await elem.getTagName()
3147 if (tag === 'select') {

Callers 1

proceedSeeFieldFunction · 0.85

Calls 2

filterAsyncFunction · 0.85
getElementIdFunction · 0.85

Tested by

no test coverage detected