(assertType, text, context, strict = false)
| 3149 | } |
| 3150 | |
| 3151 | async function proceedSee(assertType, text, context, strict = false) { |
| 3152 | let description |
| 3153 | let allText |
| 3154 | if (!context) { |
| 3155 | let el = await this.context |
| 3156 | |
| 3157 | if (el && !el.getProperty) { |
| 3158 | // Fallback to body |
| 3159 | el = await this.context.$('body') |
| 3160 | } |
| 3161 | |
| 3162 | allText = [await el.getProperty('innerText').then(p => p.jsonValue())] |
| 3163 | description = 'web application' |
| 3164 | } else { |
| 3165 | const locator = new Locator(context, 'css') |
| 3166 | description = `element ${locator.toString()}` |
| 3167 | const els = await this._locate(locator) |
| 3168 | assertElementExists(els, locator.toString()) |
| 3169 | allText = await Promise.all(els.map(el => el.getProperty('innerText').then(p => p.jsonValue()))) |
| 3170 | } |
| 3171 | |
| 3172 | if (store?.currentStep?.opts?.ignoreCase === true) { |
| 3173 | text = text.toLowerCase() |
| 3174 | allText = allText.map(elText => elText.toLowerCase()) |
| 3175 | } |
| 3176 | |
| 3177 | if (strict) { |
| 3178 | return allText.map(elText => equals(description)[assertType](text, elText)) |
| 3179 | } |
| 3180 | return stringIncludes(description)[assertType](normalizeSpacesInString(text), normalizeSpacesInString(allText.join(' | '))) |
| 3181 | } |
| 3182 | |
| 3183 | async function findCheckable(locator, context) { |
| 3184 | let contextEl = await this.context |
nothing calls this directly
no test coverage detected