SeleniumHQ / docker-selenium

Provides a simple way to run Selenium Grid with Chrome, Firefox, and Edge using Docker, making it easier to perform browser automation
http://www.selenium.dev/docker-selenium/
Other
7.9k stars 2.51k forks source link

[🐛 Bug]: Dependencies missing for CSS @media pointer support #2356

Open kristaps-aksjonovs opened 1 month ago

kristaps-aksjonovs commented 1 month ago

What happened?

Hello.

Suspicion is that there is missing dependency that needs to be install for Docker. Our website is using CSS https://developer.mozilla.org/en-US/docs/Web/CSS/@media/pointer. Chrome browser should register pointer:fine when mouse event is sent but it uses pointer:none.

For testing I'm using WebdriverIO.

Javascript injected into page to test

        const style = document.createElement("style");
        style.id = "hoverStyff";
        style.innerText = `@media (pointer: fine) {[data-role="my-button"] {background: red !important;}}@media (pointer: coarse) {[data-role="my-button"] {background: green !important;}}@media (pointer: none) {[data-role="my-button"] {background: blue !important;}}`;        const head = document.querySelector("head");
        if (head) {
            head.appendChild(style);
        }

Expected:

Red Background would appear

@media (pointer: fine) {[data-role="my-button"] {background: red !important;}}

Actual

Blue background appears.

When executing tests against local Chrome on MacOS expected red background is displayed but in container blue. I also tried to add Chrome start arguments:

--blink-settings=primaryHoverType=2,availableHoverTypes=2,primaryPointerType=4,availablePointerTypes=4

but it didn't help.

Command used to start Selenium Grid with Docker (or Kubernetes)

docker run -d -p 4444:4444 -p 7900:7900 --shm-size="2g" selenium/standalone-chrome:108.0

Relevant log output

-

Operating System

macOS Sonoma 14.5

Docker Selenium version (image tag)

selenium/standalone-chrome:108.0

Selenium Grid chart version (chart version)

No response

github-actions[bot] commented 1 month ago

@kristaps-aksjonovs, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

VietND96 commented 1 week ago

macOS Sonoma 14.5

Is this Apple M-series chip? If yes, can you try recently standalone-chromium image tag and confirm. I feel this issue could be related to Chromedriver, and there is no actionable from the docker side.

kristaps-aksjonovs commented 1 week ago

Hello @VietND96 , I checked with latest standalone-chromium same reproducible. I also tried to run on MacBook Intel version, chrome and chromium and also the same.