Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you install chrome for cypress in CI

I have written some cypress tests which I am running on CI using Electron browser. I would like to use chrome browser for running these tests in Jenkins instead. Below is how I cypress is set up to run in Jenkins.

            stage("Setup Cypress") {
                echo "SETUP CYPRESS"
                sh "curl --fail https://chromium-blinger.cf.berw-agb-01.cloud.uk.aeee/cypress-4.2.0-linux64.zip > cypress.zip"
                sh "CYPRESS_INSTALL_BINARY=${workspacePath}/${env.repositoryFolder}/cypress.zip npm install cypress && npm run cypress:verify"
            }

CYPRESS_BASE_URL=$ABGENV CYPRESS_ENV=development cypress run --browser chrome **/*.features

Error I am getting in console is below:

Can't run because you've entered an invalid browser name.

Browser: 'chrome' was not found on your system.

Available browsers found are: electron
like image 954
favored Avatar asked Nov 15 '22 09:11

favored


1 Answers

When running in CI , i always prefer to use docker image. That has resolved my issues with regards to browser.

agent { docker { image 'cypress/base:10' } }

like image 122
Sowmya Avatar answered Jan 02 '23 02:01

Sowmya