Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Viewport tests failing in headless Chrome 130.0.6723.69. #2788

Open
AfafRH19 opened this issue Dec 5, 2024 Discussed in #2787 · 0 comments
Open

Viewport tests failing in headless Chrome 130.0.6723.69. #2788

AfafRH19 opened this issue Dec 5, 2024 Discussed in #2787 · 0 comments

Comments

@AfafRH19
Copy link

AfafRH19 commented Dec 5, 2024

Discussed in https://github.com/orgs/teamcapybara/discussions/2787

Originally posted by AfafRH19 December 5, 2024
Hey everyone!
I’m encountering some issues with the viewport since upgrading WebDriver to version 130.0.6723.69.
I have an integration test with a component that has the class "map-container." We used the following function to check if the component is within the viewport:
def in_viewport?(element, top_margin = 0)
evaluate_script(
"(function(el) {
var rect = el.getBoundingClientRect();
return (
rect.top >= #{top_margin} && rect.left >= 0 &&
rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&
rect.right <= (window.innerWidth || document.documentElement.clientWidth)
);
})(arguments[0]);",
element
)
end
However, since the recent upgrade, this check always returns false when running in HEADLESS mode. Any insights or suggestions on how to resolve this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant