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

Unable to find chromium browser when using 'open --browser' flag #30055

Open
jamesikanos opened this issue Aug 19, 2024 · 3 comments
Open

Unable to find chromium browser when using 'open --browser' flag #30055

jamesikanos opened this issue Aug 19, 2024 · 3 comments
Labels
stage: awaiting response Potential fix was proposed; awaiting response

Comments

@jamesikanos
Copy link

jamesikanos commented Aug 19, 2024

Current behavior

I have a custom build of chromium installed at $HOME/Downloads/Linux_x64_916288_chrome-linux/chrome-linux/chrome

This is "Chromium 95"

When I launch with: cypress open --browser $HOME/Downloads/Linux_x64_916288_chrome-linux/chrome-linux/chrome

It does not detect and simply displays Chrome 121 and Electron.

However, when I sym link 'chromiim' then it is fine and displays 3 browsers (Chrome, Chromium and Electron):

ln -s $HOME/Downloads/Linux_x64_916288_chrome-linux/chrome-linux/chrome $HOME/bin/chromium

However, i don't really desire setting my global chromium PATH to this specific version as it is just used for testing.

How should the --browser flag work?

Debug log attached as a file because I couldn't paste the whole thing:
cypress-missing-browser.log

Desired behavior

Cypress should query the path specified in --browser and launch it?

Test code to reproduce

Download any build of chromium to a path not on $PATH and try and run with --browser

Cypress Version

13.13.3

Node version

v20.16.0

Operating System

Ubuntu 22.04

Debug Logs

Attached as file in main body

Other

No response

@jamesikanos
Copy link
Author

Workaround script, added into my node binaries folder:

#!/bin/bash

# Create a temporary directory
tmpdir=$(mktemp -d)

# Clean up on exit
trap "rm -rf $tmpdir" EXIT

# Create a symlink to the Chrome 95 binary in the temporary directory
ln -s $(which chrome-95) $tmpdir/chromium

# Run Cypress with the temporary directory in the PATH and append any further arguments
# For example, cypress-95 open
PATH=$tmpdir:$PATH cypress $@

@MikeMcC399
Copy link
Contributor

@jamesikanos

I can reproduce this issue. Try instead the following as a workaround:

npx cypress open --e2e --browser $HOME/Downloads/chromium/linux-916288/chrome-linux/chrome

cypress run picks up Custom Chromium 95 without needing any workaround:

npx cypress run --browser $HOME/Downloads/chromium/linux-916288/chrome-linux/chrome

@jennifer-shehane jennifer-shehane added the stage: awaiting response Potential fix was proposed; awaiting response label Aug 19, 2024
@jamesikanos
Copy link
Author

@MikeMcC399

Unfortunately I'm not getting results with that workaround. It is back to 2 browsers (latest Chrome & Electron).

I also sym linked "Chromium" in the same directory to map to "Chrome" and not working either:

cypress open --e2e --browser $HOME/Downloads/Linux_x64_916288_chrome-linux/chrome-linux/chrome

cypress open --e2e --browser $HOME/Downloads/Linux_x64_916288_chrome-linux/chrome-linux/chromium <-- Symlink to chrome in the same directory

As a shortcut, I've just added a "cypress-95" script in my PATH which does the trick for now.

If I get a chance, I might tackle this as a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage: awaiting response Potential fix was proposed; awaiting response
Projects
None yet
Development

No branches or pull requests

3 participants