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

Method isVisible

lib/element/WebElement.js:140–154  ·  view source on GitHub ↗

* Check if element is visible * @returns {Promise } True if element is visible

()

Source from the content-addressed store, hash-verified

138 * @returns {Promise<boolean>} True if element is visible
139 */
140 async isVisible() {
141 switch (this.helperType) {
142 case 'playwright':
143 return this.element.isVisible()
144 case 'webdriver':
145 return this.element.isDisplayed()
146 case 'puppeteer':
147 return this.element.evaluate(el => {
148 const style = window.getComputedStyle(el)
149 return style.display !== 'none' && style.visibility !== 'hidden' && style.opacity !== '0'
150 })
151 default:
152 throw new Error(`Unsupported helper type: ${this.helperType}`)
153 }
154 }
155
156 /**
157 * Check if element is enabled

Callers 9

describeMethod · 0.95
seeElementMethod · 0.80
dontSeeElementMethod · 0.80
waitForVisibleMethod · 0.80
getVisibleElementsFunction · 0.80
WebElement_test.jsFile · 0.80
els_test.jsFile · 0.80

Calls 1

evaluateMethod · 0.80

Tested by 1

describeMethod · 0.76