Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/matchers/element/toHaveText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
wrapExpectedWithArray
} from '../../utils.js'

async function condition(el: WebdriverIO.Element | WebdriverIO.ElementArray, text: string | RegExp | Array<string | RegExp> | ExpectWebdriverIO.PartialMatcher | Array<string | RegExp>, options: ExpectWebdriverIO.StringOptions) {
async function condition(el: WebdriverIO.Element | WebdriverIO.ElementArray, text: string | RegExp | Array<string | RegExp> | ExpectWebdriverIO.PartialMatcher, options: ExpectWebdriverIO.StringOptions) {
const actualTextArray: string[] = []
const resultArray: boolean[] = []
let checkAllValuesMatchCondition: boolean
Expand All @@ -22,7 +22,7 @@ async function condition(el: WebdriverIO.Element | WebdriverIO.ElementArray, tex
: compareText(actualText, text, options).result
resultArray.push(result)
}
checkAllValuesMatchCondition = resultArray.every(result => result)
checkAllValuesMatchCondition = resultArray.every(Boolean)
} else {
const actualText = await (el as WebdriverIO.Element).getText()
actualTextArray.push(actualText)
Expand Down