* 检查元素是否可见
(element)
| 154 | * 检查元素是否可见 |
| 155 | */ |
| 156 | function isVisible(element) { |
| 157 | if (!element) return false; |
| 158 | |
| 159 | const style = window.getComputedStyle(element); |
| 160 | const rect = element.getBoundingClientRect(); |
| 161 | |
| 162 | return style.display !== 'none' && |
| 163 | style.visibility !== 'hidden' && |
| 164 | style.opacity !== '0' && |
| 165 | rect.width > 0 && |
| 166 | rect.height > 0; |
| 167 | } |
| 168 | |
| 169 | /** |
| 170 | * 模拟用户输入(增强版,支持 React/Vue 等框架) |
no outgoing calls
no test coverage detected