cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
47.07k stars 3.19k forks source link

cypress info does not detect firefox (snap installation) if started via linux cronjob #28611

Open FrankL-git opened 10 months ago

FrankL-git commented 10 months ago

Current behavior

Running cypress info in a bash detects firefox:

$ cd /home/fl/project_dir
$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/local/ssl/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
$ npx cypress info
...
Detected 2 browsers installed:

1. Chrome
  - Name: chrome
  - Channel: stable
  - Version: 120.0.6099.129
  - Executable: google-chrome
  - Profile: /home/fl/.config/Cypress/cy/production/browsers/chrome-stable

2. Firefox
  - Name: firefox
  - Channel: stable
  - Version: 120.0
  - Executable: firefox
  - Profile: /home/fl/snap/firefox/current/Cypress/firefox-stable

  ...
  Proxy Settings: none detected
  Environment Variables: none detected

  Application Data: /home/fl/.config/cypress/cy/development
  Browser Profiles: /home/fl/.config/cypress/cy/development/browsers
  Binary Caches: /home/fl/.cache/Cypress

  Cypress Version: 13.6.2 (stable)
  System Platform: linux (Ubuntu - 22.04)
  System Memory: 8.2 GB free 3.49 GB

This crontab

SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/usr/local/ssl/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
* * * * * cd /home/fl/project_dir && npx cypress info &> /tmp/cronjob.log

does not detect firefox as the content of /tmp/cronjob.log shows:

...
Detected 1 browser installed:

1. Chrome
  - Name: chrome
  - Channel: stable
  - Version: 120.0.6099.129
  - Executable: google-chrome
  - Profile: /home/fl/.config/Cypress/cy/production/browsers/chrome-stable
...
Proxy Settings: none detected
Environment Variables: none detected

Application Data: /home/fl/.config/cypress/cy/development
Browser Profiles: /home/fl/.config/cypress/cy/development/browsers
Binary Caches: /home/fl/.cache/Cypress

Cypress Version: 13.6.2 (stable)
System Platform: linux (Ubuntu - 22.04)
System Memory: 8.2 GB free 3.48 GB

Desired behavior

firefox should be detected.

Test code to reproduce

See above

Cypress Version

13.6.2 (stable)

Node version

v20.10.0

Operating System

linux (Ubuntu - 22.04)

Debug Logs

No response

Other

As as workaround I use the -b option of cypress run:

npx cypress run -b /snap/firefox/current/usr/lib/firefox/firefox

Many thanks in advance.

thearchitector commented 6 months ago

confirming this is a problem i see as well

cypress-app-bot commented 2 days ago

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.