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

Trying to use Chromium on 4.0.0 results in an error #6357

Closed
obartra opened this issue Feb 7, 2020 · 5 comments · Fixed by #6358
Closed

Trying to use Chromium on 4.0.0 results in an error #6357

obartra opened this issue Feb 7, 2020 · 5 comments · Fixed by #6358

Comments

@obartra
Copy link
Contributor

obartra commented Feb 7, 2020

Hey there, I just wanted to give the new version a try and ran into this issue. I don't think it's test specific but let me know if I'm missing something. Thanks for your hard work on v4!

I suspect the issue is a typo on this line

Current behavior:

  1. Download and install Chromium 80.0.3987.87 for Mac OS
  2. npx cypress open
  3. Select "Chromium 80"
  4. start a test
  5. browser crashes with the following error:
npx cypress open
Error: spawn /Applications/Chromium.app/Contents/DMacOS/Chromium ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
    at onErrorNT (internal/child_process.js:456:16)
    at processTicksAndRejections (internal/process/task_queues.js:77:11)
 {
  errno: 'ENOENT',
  code: 'ENOENT',
  syscall: 'spawn /Applications/Chromium.app/Contents/DMacOS/Chromium',
  path: '/Applications/Chromium.app/Contents/DMacOS/Chromium',
  spawnargs: [
    'about:blank',
    '--test-type',
    '--ignore-certificate-errors',
    '--start-maximized',
    '--silent-debugger-extension-api',
    '--no-default-browser-check',
    '--no-first-run',
    '--noerrdialogs',
    '--enable-fixed-layout',
    '--disable-popup-blocking',
    '--disable-password-generation',
    '--disable-save-password-bubble',
    '--disable-single-click-autofill',
    '--disable-prompt-on-repos',
    '--disable-background-timer-throttling',
    '--disable-renderer-backgrounding',
    '--disable-renderer-throttling',
    '--disable-restore-session-state',
    '--disable-translate',
    '--disable-new-profile-management',
    '--disable-new-avatar-menu',
    '--allow-insecure-localhost',
    '--reduce-security-for-testing',
    '--enable-automation',
    '--disable-device-discovery-notifications',
    '--disable-infobars',
    '--autoplay-policy=no-user-gesture-required',
    '--disable-site-isolation-trials',
    '--metrics-recording-only',
    '--disable-prompt-on-repost',
    '--disable-hang-monitor',
    '--disable-sync',
    '--disable-web-resources',
    '--safebrowsing-disable-auto-update',
    '--safebrowsing-disable-download-protection',
    '--disable-client-side-phishing-detection',
    '--disable-component-update',
    '--disable-default-apps',
    '--use-fake-ui-for-media-stream',
    '--use-fake-device-for-media-stream',
    '--disable-ipc-flooding-protection',
    '--disable-backgrounding-occluded-window',
    '--disable-breakpad',
    '--password-store=basic',
    '--use-mock-keychain',
    '--proxy-server=http://localhost:54313',
    '--proxy-bypass-list=<-loopback>',
    '--remote-debugging-port=54328',
    '--remote-debugging-address=127.0.0.1',
    '--load-extension=/Users/obartra/Library/Application Support/Cypress/cy/production/browsers/chromium/interactive/CypressExtension,/Users/obartra/Library/Caches/Cypress/4.0.0/Cypress.app/Contents/Resources/app/packages/extension/theme',
    '--user-data-dir=/Users/obartra/Library/Application Support/Cypress/cy/production/browsers/chromium/interactive',
    '--disk-cache-dir=/Users/obartra/Library/Application Support/Cypress/cy/production/browsers/chromium/interactive/CypressCache'
  ]
}
Error: spawn /Applications/Chromium.app/Contents/DMacOS/Chromium ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
    at onErrorNT (internal/child_process.js:456:16)
    at processTicksAndRejections (internal/process/task_queues.js:77:11)

Desired behavior:

  • Tests run

Test code to reproduce

  • Use cypress@3.8.3 and run steps described above
  • cypress doesn't crash
  • Upgrade to cypress@4.0.0 cypress crashes

Versions

From npx envinfo:

System:
OS: macOS Mojave 10.14.6
CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Memory: 641.25 MB / 32.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 12.13.0 - ~/.nvm/versions/node/v12.13.0/bin/node
Yarn: 1.21.1 - ~/.yarn/bin/yarn
npm: 6.13.6 - ~/.nvm/versions/node/v12.13.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Utilities:
CMake: 3.16.2 - /usr/local/bin/cmake
Make: 3.81 - /usr/bin/make
GCC: 4.2.1 - /usr/bin/gcc
Git: 2.25.0 - /usr/local/bin/git
Clang: 1100.0.33.12 - /usr/bin/clang
Subversion: 1.10.4 - /usr/bin/svn

@cypress-bot cypress-bot bot added stage: work in progress stage: needs review The PR code is done & tested, needs review and removed stage: work in progress labels Feb 7, 2020
@jennifer-shehane
Copy link
Member

jennifer-shehane commented Feb 7, 2020

I also get this error when trying to open Chromium (78) in 4.0.0. This exact download worked in 3.8.3. I have the same path described of /Applications/Chromium.app/Contents/DMacOS/Chromium when logging the browser object.

index.js

module.exports = (on, config) => {
  on('before:browser:launch', (browser = {}, launchOptions) => {
    console.log(browser)
  })
}

3.8.3 browser object

{
  displayName: 'Chromium',
  family: 'chrome',
  isChosen: true,
  majorVersion: 78,
  name: 'chromium',
  path: '/Applications/Chromium.app/Contents/MacOS/Chromium',
  version: '78.0.3904.0',
  isHeaded: true,
  isHeadless: false
}

4.0.0 browser object

{
  channel: 'stable',
  displayName: 'Chromium',
  family: 'chromium',
  isChosen: true,
  majorVersion: 78,
  name: 'chromium',
  path: '/Applications/Chromium.app/Contents/DMacOS/Chromium',
  version: '78.0.3904.0',
  isHeaded: true,
  isHeadless: false
}

Workaround

Find the location that Chromium is installed in and run that with the --browser flag. It's a little tricky and I show how to do this in MacOS in the Gif below. (I'm not sure this drag and drop works on all terminals tbh, I'm using iTerm2)

My path was /Applications/Chromium.app/Contents/MacOS/Chromium

This will pre-select the found browser and it's called Custom Edge 79.

Screen Shot 2020-02-07 at 12 18 42 PM

Similarly for cypress run --browser, this will launch and run the tests in Chromium.

For debugging

Logging the browser object after this launch gives the following object.

plugins/index.js

module.exports = (on, config) => {
  on('before:browser:launch', (browser = {}, launchOptions) => {
    console.log(browser)
  })
}
{
  channel: 'stable',
  custom: true,
  displayName: 'Custom Chromium',
  family: 'chromium',
  info: 'Loaded from /Applications/Chromium.app/Contents/MacOS/Chromium',
  isChosen: true,
  majorVersion: 78,
  name: 'chromium',
  path: '/Applications/Chromium.app/Contents/MacOS/Chromium',
  version: '78.0.3904.0',
  isHeaded: true,
  isHeadless: false
}

@leichteckig
Copy link

Hello!

I ran into a similar issue using Chrome 80 when playing around with cypress/included:4.0.0 or Chromium 79 on Ubuntu locally. If I try to run my tests using Chrome, the browser won't start and all I see is the following error:
grafik

My tests run perfectly fine when using the following configuration:

  • cypress/included:4.0.0 with Electron and Firefox
  • cypress/included:3.8.1with Chrome

Unfortunately I can't log browser object to debug. Could that be related, should I create an own issue or do I miss something?
Either way, thank you for your work and help! <3

@flotwig
Copy link
Contributor

flotwig commented Feb 7, 2020

@leichteckig Have you updated your plugins file according to the migration guide? There were some breaking changes to args in 4.0.0:

https://docs.cypress.io/guides/references/migration-guide.html#Migrating-to-Cypress-4-0

@cypress-bot cypress-bot bot added stage: pending release and removed stage: needs review The PR code is done & tested, needs review labels Feb 7, 2020
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Feb 7, 2020

The code for this is done in cypress-io/cypress#6358, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Feb 8, 2020

Released in 4.0.1.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v4.0.1, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Feb 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants