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

Function proceedSee

lib/helper/Playwright.js:4341–4370  ·  view source on GitHub ↗
(assertType, text, context, strict = false)

Source from the content-addressed store, hash-verified

4339}
4340
4341async 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
4372async function findCheckable(locator, context) {
4373 let contextEl = await this.context

Callers

nothing calls this directly

Calls 5

toStringMethod · 0.95
equalsFunction · 0.90
normalizeSpacesInStringFunction · 0.90
assertElementExistsFunction · 0.70
_locateMethod · 0.45

Tested by

no test coverage detected