MCPcopy
hub / github.com/codeceptjs/CodeceptJS / seeElement

Method seeElement

lib/helper/Appium.js:1730–1752  ·  view source on GitHub ↗

* {{> seeElement }} *

(locator, context = null)

Source from the content-addressed store, hash-verified

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 }}

Callers 13

AppiumWeb_test.jsFile · 0.45
Appium_ios_test.jsFile · 0.45
WebDriver_test.jsFile · 0.45
Appium_test.jsFile · 0.45
testsFunction · 0.45
coverage_test.jsFile · 0.45
AppiumTs.types.tsFile · 0.45
Appium.types.tsFile · 0.45

Calls 6

_isDisplayedSafeMethod · 0.95
truthFunction · 0.90
dontSeeElementErrorFunction · 0.90
pushMethod · 0.80
assertMethod · 0.80
_locateMethod · 0.45

Tested by

no test coverage detected