* {{> dontSeeElement }}
(locator, context = null)
| 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 }} |
nothing calls this directly
no test coverage detected