Open dakur opened 2 years ago
We ran into this issue as well. For us, the failure happened on CI using yarn cypress run
, but our tests would pass when using yarn cypress open
. We fixed it with the workaround in #3200, by adding the following after cy.visit
:
cy.document().then(document => {
const htmlElement = document.querySelector('html');
if (htmlElement) {
htmlElement.style.scrollBehavior = 'inherit';
}
});
https://github.com/cypress-io/cypress/issues/3200#issuecomment-757994356
We thought it strange that we were still experiencing that issue, since it was fixed in 6.7.1
. We saw the problem on 9.5.4
as well as 10.3.0
.
This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.
Don't close, I'll check it first.
I still experience this with cypress 12.12.0.
@dakur thank you for confirming. I will update the ticket accordingly.
@dakur I reproduced this using this repo (https://github.com/warrensplayer/cypress_20607) with the latest version of Cypress and will forward this ticket to the appropriate team. They will soon evaluate the priority of this ticket and consider their capacity to pick it up. Please note that this does not guarantee that this issue will be resolved. The ticket will indicate status changes during evaluation, so we ask that you please refrain from asking for updates. Thanks!
Current behavior
When
html
tag hasscroll-behavior: smooth
and there is a sticky positioned element in the page (e.g. header), an element can't be queried. Test ends withTypeError: Timed out retrying after 4050ms: $el.get(...).scrollIntoView is not a function
Desired behavior
To pass the test. When you remove the
scroll-behavior: smooth
rule, it passes.Test code to reproduce
test:
tested HTML:
Cypress Version
9.5.1
Other
This is probably the same issue as #19038 which has been closed as not being an issue for the issuer anymore. Also probably related to #3200, but that fix didn't count with
position: sticky
. I've run into this issue when upgraded bootstrap v4 to v5 which has that style rule applied.