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

Chromium installed via snap is not available in Cypress #3183

Closed
flotwig opened this issue Jan 22, 2019 · 10 comments
Closed

Chromium installed via snap is not available in Cypress #3183

flotwig opened this issue Jan 22, 2019 · 10 comments

Comments

@flotwig
Copy link
Member

@flotwig flotwig commented Jan 22, 2019

Current behavior:

If Chromium is installed as a snap (snap install chromium), Cypress won't auto-detect it as a supported browser for testing:

image

Desired behavior:

Make Chromium installed as a snap available for testing without additional configuration, like the docs say: "Cypress automatically detects available browsers on your OS."

Steps to reproduce: (app code and test code)

  1. Install Chromium as a snap
  2. Open the Cypress GUI
  3. Try to use it as a browser

Versions

Cypress: latest develop branch
Ubuntu 18.04.1
Chromium 71 stable from https://snapcraft.io/chromium

Potentially related issues

#1400

@flotwig flotwig changed the title Chromium installed via Chromium installed via snap is not available in Cypress Jan 22, 2019
@flotwig flotwig self-assigned this Jan 22, 2019
@jennifer-shehane jennifer-shehane added this to the Sprint 20 milestone Jan 22, 2019
@flotwig flotwig mentioned this issue Jan 23, 2019
14 tasks
@flotwig
Copy link
Member Author

@flotwig flotwig commented Jan 23, 2019

Seems to be a side-effect of being named chromium instead of chromium-browser. I'll think up a nice way to add lists of binary aliases to the launcher tomorrow.

@flotwig
Copy link
Member Author

@flotwig flotwig commented Jan 24, 2019

With support for binary aliases comes the possibility that we'll encounter multiple versions of the same binary. So now the launcher needs to support launching a specific version, at least internally.

@flotwig
Copy link
Member Author

@flotwig flotwig commented Jan 24, 2019

I think that, in order to do this, we need to be passing the Browser objects from the launcher around internally. I did some digging and the server pretty much only identifies the current browser by "name" (chrome, chromium, etc...) and this won't do, especially if we want to eventually support arbitrary browser paths being passed in.

@bahmutov
Copy link
Contributor

@bahmutov bahmutov commented Jan 24, 2019

@cypress-bot
Copy link

@cypress-bot cypress-bot bot commented Mar 15, 2019

Released in 3.2.0.

@hackel
Copy link

@hackel hackel commented Oct 28, 2019

This is not fixed for me. Ubuntu 19.10 forced a migration from the chromium-browser deb package to the chromium snap, and now Chromium does not show up in Cypress 3.5.0.
If I specify the path manually (cypress open --browser /snap/bin/chromium), I get the following:

We could not identify a known browser at the path you provided: /snap/bin/chromium

The output from the command we ran was:
[Try Again]

(there is no output at all)
And for reference:

$ /snap/bin/chromium --version
Chromium 78.0.3904.70 snap
@flotwig
Copy link
Member Author

@flotwig flotwig commented Oct 28, 2019

@hackel Is /snap/bin/chromium a shell script?

@hackel
Copy link

@hackel hackel commented Dec 16, 2019

@flotwig yes, internally. It's a symlink to /usr/bin/snap, which detects the link name and runs "snap run chromium" or something, which then runs the chromium launcher script inside the container.

There is some conflict with snap apps and the way 'execa' / node captures stdout. I'm unable to get it to work with any snap, not just chromium.

If I specify the whole path to the binary /snap/chromium/current/usr/lib/chromium-browser/chrome it does work, but I'm not sure if this is a viable means of running snap apps. Is it even running inside the container? I have no idea.

@IlCallo
Copy link

@IlCallo IlCallo commented May 26, 2020

Same problem here, Cypress 4.6, Linux 18.04, Chromium via snap 81.0.4044.138

Can confirm that using the full path to binary works as expected

@cypress-io cypress-io locked as resolved and limited conversation to collaborators Jul 14, 2020
@jennifer-shehane
Copy link
Member

@jennifer-shehane jennifer-shehane commented Jul 14, 2020

This issue will be closed to further comment as the exact issue here was resolved and tested.

If you're experiencing a bug similar to this in Cypress, please open a new issue with a fully reproducible example that we can run. There may be a specific edge case with the issue that we need more detail to fix.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants