* {{> dontSeeElement }}
(locator, context = null)
| 1565 | * {{> dontSeeElement }} |
| 1566 | */ |
| 1567 | async dontSeeElement(locator, context = null) { |
| 1568 | if (this.isWeb) return super.dontSeeElement(locator, context) |
| 1569 | |
| 1570 | // For mobile native apps, use safe isDisplayed wrapper |
| 1571 | const parsedLocator = parseLocator.call(this, locator) |
| 1572 | const res = await this._locate(parsedLocator, false) |
| 1573 | |
| 1574 | if (!res || res.length === 0) { |
| 1575 | return truth(`elements of ${Locator.build(parsedLocator)}`, 'to be seen').negate(false) |
| 1576 | } |
| 1577 | |
| 1578 | const selected = [] |
| 1579 | for (const el of res) { |
| 1580 | const displayed = await this._isDisplayedSafe(el) |
| 1581 | if (displayed) selected.push(true) |
| 1582 | } |
| 1583 | |
| 1584 | try { |
| 1585 | return truth(`elements of ${Locator.build(parsedLocator)}`, 'to be seen').negate(selected) |
| 1586 | } catch (err) { |
| 1587 | throw err |
| 1588 | } |
| 1589 | } |
| 1590 | |
| 1591 | /** |
| 1592 | * {{> dontSeeInField }} |
no test coverage detected