MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / grabNumberOfVisibleElements

Method grabNumberOfVisibleElements

lib/helper/Appium.js:1640–1654  ·  view source on GitHub ↗

* {{> grabNumberOfVisibleElements }}

(locator)

Source from the content-addressed store, hash-verified

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")

Callers 8

Appium_ios_test.jsFile · 0.45
Appium_test.jsFile · 0.45
testsFunction · 0.45
AppiumTs.types.tsFile · 0.45
Appium.types.tsFile · 0.45

Calls 3

_isDisplayedSafeMethod · 0.95
pushMethod · 0.80
_locateMethod · 0.45

Tested by

no test coverage detected