* {{> seeElement }} *
(locator, context = null)
| 1728 | * |
| 1729 | */ |
| 1730 | async seeElement(locator, context = null) { |
| 1731 | if (this.isWeb) return super.seeElement(locator, context) |
| 1732 | |
| 1733 | // For mobile native apps, use safe isDisplayed wrapper |
| 1734 | const parsedLocator = parseLocator.call(this, locator) |
| 1735 | const res = await this._locate(parsedLocator, true) |
| 1736 | |
| 1737 | if (!res || res.length === 0) { |
| 1738 | throw new ElementNotFound(parsedLocator) |
| 1739 | } |
| 1740 | |
| 1741 | const selected = [] |
| 1742 | for (const el of res) { |
| 1743 | const displayed = await this._isDisplayedSafe(el) |
| 1744 | if (displayed) selected.push(true) |
| 1745 | } |
| 1746 | |
| 1747 | try { |
| 1748 | return truth(`elements of ${Locator.build(parsedLocator)}`, 'to be seen').assert(selected) |
| 1749 | } catch (e) { |
| 1750 | dontSeeElementError(parsedLocator) |
| 1751 | } |
| 1752 | } |
| 1753 | |
| 1754 | /** |
| 1755 | * {{> seeInField }} |
no test coverage detected