[BUG] `page.locator.isVisible` returns `true` on hidden element
See original GitHub issueContext:
System:
- OS: Windows 10 10.0.19044
- Memory: 926.38 MB / 15.78 GB
Binaries:
- Node: 18.0.0 - C:\Program Files\nodejs\node.EXE
- npm: 8.7.0 - C:\Program Files\nodejs\npm.CMD
Languages:
- Bash: 5.0.17 - C:\WINDOWS\system32\bash.EXE
npmPackages:
- playwright: ^1.23.0 => 1.23.0
Code Snippet
test('test', async ({ page }) => {
await page.goto('C:\\page.html')
const selector = '.sapUiLocalBusyIndicatorAnimStandard'
const isVisible = await page.locator(selector).isVisible()
console.log(isVisible) // true
await page.waitForSelector(selector, {state: 'hidden'}) // success
})
Describe the bug
this SAPUI5 busy indicator is not visible, and page.waitForSelector(selector, {state: 'hidden'})
succeeds, however page.locator.isVisible
incorrectly returns true
. the bounding box seems to also be empty:
unfortunately i’m not able to share the full html as it’s for an internal site, though i’m open to suggestions to try and provide a minimal example.
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Check if element is visible in Playwright - Stack Overflow
2 for testing and facing a problem with elements' visibility. I want to check if a modal is visible on screen so I...
Read more >Intent to Prototype: Element.isVisible method - Google Groups
isVisible() returns true if the element is visible, and false if it is not. It checks a variety of factors that would make...
Read more >Locator | Playwright - CukeTest
Locator represents a view to the element(s) on the page. It captures the logic sufficient to retrieve the element at any given moment....
Read more >Playwright.Locator — playwright v1.18.0-alpha.1 - HexDocs
Locator represents a view to the element(s) on the page. ... Returns whether the element is visible. ... ElementHandle.t() | {:error, Playwright.Channel.
Read more >Element.isVisible method - Chrome Platform Status
Element.isVisible() returns true if the element is visible, and false if it is not. It checks a variety of factors that would make...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks for the report! isVisible was not working correctly for elements that are inside <button> (role=button in your case).
@pavelfeldman
ok i was able to reproduce it with the example elements on the sapui5 docs