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

Method waitForInvisible

lib/helper/Appium.js:1827–1849  ·  view source on GitHub ↗

* {{> waitForInvisible }} *

(locator, sec = null)

Source from the content-addressed store, hash-verified

1825 *
1826 */
1827 async waitForInvisible(locator, sec = null) {
1828 if (this.isWeb) return super.waitForInvisible(locator, sec)
1829
1830 // For mobile native apps, use safe isDisplayed wrapper
1831 const parsedLocator = parseLocator.call(this, locator)
1832 const aSec = sec || this.options.waitForTimeoutInSeconds
1833
1834 return this.browser.waitUntil(
1835 async () => {
1836 const res = await this._res(parsedLocator)
1837 if (!res || res.length === 0) return true
1838
1839 const selected = []
1840 for (const el of res) {
1841 const displayed = await this._isDisplayedSafe(el)
1842 if (displayed) selected.push(true)
1843 }
1844
1845 return selected.length === 0
1846 },
1847 { timeout: aSec * 1000, timeoutMsg: `element (${Locator.build(parsedLocator)}) still visible after ${aSec} sec` },
1848 )
1849 }
1850
1851 /**
1852 * {{> waitForText }}

Callers 9

Playwright_test.jsFile · 0.45
WebDriver_test.jsFile · 0.45
testsFunction · 0.45
AppiumTs.types.tsFile · 0.45
Appium.types.tsFile · 0.45

Calls 3

_isDisplayedSafeMethod · 0.95
_resMethod · 0.80
pushMethod · 0.80

Tested by

no test coverage detected