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

Method dontSeeElement

lib/helper/Puppeteer.js:1215–1233  ·  view source on GitHub ↗

* {{> dontSeeElement }}

(locator, context = null)

Source from the content-addressed store, hash-verified

1213 * {{> dontSeeElement }}
1214 */
1215 async dontSeeElement(locator, context = null) {
1216 let els
1217 if (context) {
1218 const contextPage = await this.context
1219 const contextEls = await findElements.call(this, contextPage, context)
1220 assertElementExists(contextEls, context, 'Context element')
1221 els = await findElements.call(this, contextEls[0], locator)
1222 } else {
1223 els = await this._locate(locator)
1224 }
1225 els = (await Promise.all(els.map(el => el.boundingBox() && el))).filter(v => v)
1226 // Puppeteer visibility was ignored? | Remove when Puppeteer is fixed
1227 els = await Promise.all(els.map(async el => (await el.evaluate(node => window.getComputedStyle(node).visibility !== 'hidden' && window.getComputedStyle(node).display !== 'none')) && el))
1228 try {
1229 return empty('visible elements').assert(els.filter(v => v).fill('ELEMENT'))
1230 } catch (e) {
1231 seeElementError(locator)
1232 }
1233 }
1234
1235 /**
1236 * {{> seeElementInDOM }}

Callers

nothing calls this directly

Calls 7

_locateMethod · 0.95
emptyFunction · 0.90
seeElementErrorFunction · 0.90
filterMethod · 0.80
evaluateMethod · 0.80
assertMethod · 0.80
assertElementExistsFunction · 0.70

Tested by

no test coverage detected