(assertType, text, context, strict = false)
| 4339 | } |
| 4340 | |
| 4341 | async function proceedSee(assertType, text, context, strict = false) { |
| 4342 | let description |
| 4343 | let allText |
| 4344 | |
| 4345 | if (!context) { |
| 4346 | const el = await this.context |
| 4347 | |
| 4348 | allText = typeof el.url !== 'function' && typeof el.innerText === 'function' |
| 4349 | ? [await el.innerText()] |
| 4350 | : [await el.locator('body').innerText()] |
| 4351 | |
| 4352 | description = 'web application' |
| 4353 | } else { |
| 4354 | const locator = new Locator(context, 'css') |
| 4355 | description = `element ${locator.toString()}` |
| 4356 | const els = await this._locate(locator) |
| 4357 | assertElementExists(els, locator.toString()) |
| 4358 | allText = await Promise.all(els.map(el => el.innerText())) |
| 4359 | } |
| 4360 | |
| 4361 | if (store?.currentStep?.opts?.ignoreCase === true) { |
| 4362 | text = text.toLowerCase() |
| 4363 | allText = allText.map(elText => elText.toLowerCase()) |
| 4364 | } |
| 4365 | |
| 4366 | if (strict) { |
| 4367 | return allText.map(elText => equals(description)[assertType](text, elText)) |
| 4368 | } |
| 4369 | return stringIncludes(description)[assertType](normalizeSpacesInString(text), normalizeSpacesInString(allText.join(' | '))) |
| 4370 | } |
| 4371 | |
| 4372 | async function findCheckable(locator, context) { |
| 4373 | let contextEl = await this.context |
nothing calls this directly
no test coverage detected