Incorrect "CSS property: 'position: fixed'" error for elements that don't have position: fixed at all
See original GitHub issueCurrent behavior:
Currently one of my tests (which is identical to a previous test in this regard) fails on an error that is simply incorrect. It’s showing:
CypressError: Timed out retrying: expected 'button.btn--secondary.w-full.sm:w-auto.md:mx-1.md:w-auto.md:w-1/3.lg:w-1/4.xl:w-1/5.btn' to be 'visible'` with `This element 'button.btn--secondary.w-full.sm:w-auto.md:mx-1.md:w-auto.md:w-1/3.lg:w-1/4.xl:w-1/5.btn' is not visible because it has CSS property: 'position: fixed' and its being covered by another element:
which isn’t at all true.
I don’t have fixed positioned buttons at all, so this error is completely incorrect.
The stacktrace also shows “undefined” which is curious at best:
undefined at Object.cypressErr (http://local.canvaspop.com/__cypress/runner/cypress_runner.js:85348:11) at Object.throwErr (http://local.canvaspop.com/__cypress/runner/cypress_runner.js:85303:18) at Object.throwErrByPath (http://local.canvaspop.com/__cypress/runner/cypress_runner.js:85335:17) at retry (http://local.canvaspop.com/__cypress/runner/cypress_runner.js:77321:16) at onFailFn (http://local.canvaspop.com/__cypress/runner/cypress_runner.js:68422:16) at tryCatcher (http://local.canvaspop.com/__cypress/runner/cypress_runner.js:118962:23) at Promise._settlePromiseFromHandler (http://local.canvaspop.com/__cypress/runner/cypress_runner.js:116898:31) at Promise._settlePromise (http://local.canvaspop.com/__cypress/runner/cypress_runner.js:116955:18) at Promise._settlePromise0 (http://local.canvaspop.com/__cypress/runner/cypress_runner.js:117000:10) at Promise._settlePromises (http://local.canvaspop.com/__cypress/runner/cypress_runner.js:117075:18) at Async../node_modules/bluebird/js/release/async.js.Async._drainQueue (http://local.canvaspop.com/__cypress/runner/cypress_runner.js:113687:16) at Async../node_modules/bluebird/js/release/async.js.Async._drainQueues (http://local.canvaspop.com/__cypress/runner/cypress_runner.js:113697:10) at Async.drainQueues (http://local.canvaspop.com/__cypress/runner/cypress_runner.js:113571:14) at
Desired behavior:
My test to pass, like it does locally (same version, same browser).
Test code to reproduce
Versions
3.4.1 Electron 61 Docker (Alpine)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Problem with position fixed property - HTML-CSS
Your header needs to have a fixed position . The position of the header with be zero pixels from the top and zero...
Read more >Element is not visible because it has CSS property: 'position
The element you are asserting is not visible within the viewport and probably have to be scrolled to in order to be visible....
Read more >CSS Fixed Position | Kevin Chisholm - Blog
With CSS fixed position, the element is completely removed from the document flow, but positioned absolutely in relation to the view-port.
Read more >Interacting with Elements - Cypress Documentation
You will usually get an error explaining why the element was not found to be ... Its CSS property is position: fixed and...
Read more >Positioning - Learn web development | MDN
If no ancestor elements have their position property explicitly defined, then by default all ancestor elements will have a static position.
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 FreeTop 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
Top GitHub Comments
Alright, after a long, long session with Jess to track down the issue, we were able to get relatively close to the issue(s) and it seems to be a combination of:
.should('be.visible')
to not sufficiently support z-index and probably return false negatives on the clickability of an element.click({ force: true })
circumvented my problem, but it’s not a real solution.There’s a layer with disabled pointer events underneath the fixed element with the button and that seems to return a false negative.
Do we have a solution to it?