* {{> grabNumberOfVisibleElements }}
(locator)
| 1638 | * {{> grabNumberOfVisibleElements }} |
| 1639 | */ |
| 1640 | async grabNumberOfVisibleElements(locator) { |
| 1641 | if (this.isWeb) return super.grabNumberOfVisibleElements(locator) |
| 1642 | |
| 1643 | // For mobile native apps, use safe isDisplayed wrapper |
| 1644 | const parsedLocator = parseLocator.call(this, locator) |
| 1645 | const res = await this._locate(parsedLocator) |
| 1646 | |
| 1647 | const selected = [] |
| 1648 | for (const el of res) { |
| 1649 | const displayed = await this._isDisplayedSafe(el) |
| 1650 | if (displayed) selected.push(true) |
| 1651 | } |
| 1652 | |
| 1653 | return selected.length |
| 1654 | } |
| 1655 | |
| 1656 | /** |
| 1657 | * Can be used for apps only with several values ("contentDescription", "text", "className", "resourceId") |
no test coverage detected