Skip to content

Commit

Permalink
Install newest Chrome browser before running tests (#6115)
Browse files Browse the repository at this point in the history
* Install newest Chrome browser when needed

* Create command for installing Chrome

* Install Chrome without any conditions in run-e2e-tests. Browser is always defined.

* Install newest Chrome in e2e tests only if it is needed.

* Add condition to install the latest chrome only for chrome e2e tests

* Add description to install-latest-chrome. Browser parameter becomes an enum.

* Update circle.yml

- Add a descriptive name to the install step, so the script doesn't get printed out twice
- Let `browser` be any string - we have more browsers on the way 😄

Co-authored-by: Jennifer Shehane <shehane.jennifer@gmail.com>
Co-authored-by: Zach Bloomquist <github@chary.us>
  • Loading branch information
3 people authored Jan 31, 2020
1 parent d816772 commit 81555fc
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,30 @@ executors:
PLATFORM: mac

commands:
install-latest-chrome:
description: Install latest Google Chrome (stable)
parameters:
browser:
default: "electron"
description: browser shortname to target
type: string
steps:
- run:
name: Install latest Google Chrome (stable)
command: |
if [ << parameters.browser >> == "chrome" ]; then
echo "**** Running Chrome tests. Installing latest stable version of Google Chrome. ****"
apt-get update
apt-get install google-chrome-stable -y
echo "**** Location of Google Chrome Installation: "`which google-chrome`" ****"
echo "**** Google Chrome Version: "`google-chrome --version`" ****"
else
echo "**** Not updating Chrome. Running tests in '<< parameters.browser >>' ****"
fi
run-e2e-tests:
parameters:
browser:
default: "electron"
description: browser shortname to target
type: string
chunk:
Expand All @@ -66,6 +87,8 @@ commands:
steps:
- attach_workspace:
at: ~/
- install-latest-chrome:
browser: << parameters.browser >>
- run:
command: npm run test-e2e -- --chunk << parameters.chunk >> --browser << parameters.browser >>
working_directory: packages/server
Expand Down Expand Up @@ -493,6 +516,8 @@ jobs:
steps:
- attach_workspace:
at: ~/
- install-latest-chrome:
browser: chrome
- run:
command: npm start
background: true
Expand Down

4 comments on commit 81555fc

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 81555fc Jan 31, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux x64 version of the Test Runner.

You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.

You will need to use custom CYPRESS_INSTALL_BINARY url and install Cypress using an url instead of the version.

export CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/3.8.4/linux-x64/circle-develop-81555fc7ee87da4f3c11fd2c7831e90fb8272fff-241022/cypress.zip
npm install https://cdn.cypress.io/beta/npm/3.8.4/circle-develop-81555fc7ee87da4f3c11fd2c7831e90fb8272fff-241011/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 81555fc Jan 31, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AppVeyor has built the win32 ia32 version of the Test Runner.

You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.

You will need to use custom CYPRESS_INSTALL_BINARY url and install Cypress using an url instead of the version.

Instructions are included below, depending on the shell you are using.

In Command Prompt (cmd.exe):

set CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/3.8.4/win32-ia32/appveyor-develop-81555fc7ee87da4f3c11fd2c7831e90fb8272fff-30494571/cypress.zip
npm install https://cdn.cypress.io/beta/npm/3.8.4/appveyor-develop-81555fc7ee87da4f3c11fd2c7831e90fb8272fff-30494571/cypress.tgz

In PowerShell:

$env:CYPRESS_INSTALL_BINARY = https://cdn.cypress.io/beta/binary/3.8.4/win32-ia32/appveyor-develop-81555fc7ee87da4f3c11fd2c7831e90fb8272fff-30494571/cypress.zip
npm install https://cdn.cypress.io/beta/npm/3.8.4/appveyor-develop-81555fc7ee87da4f3c11fd2c7831e90fb8272fff-30494571/cypress.tgz

In Git Bash:

export CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/3.8.4/win32-ia32/appveyor-develop-81555fc7ee87da4f3c11fd2c7831e90fb8272fff-30494571/cypress.zip
npm install https://cdn.cypress.io/beta/npm/3.8.4/appveyor-develop-81555fc7ee87da4f3c11fd2c7831e90fb8272fff-30494571/cypress.tgz

Using cross-env:

If the above commands do not work for you, you can also try using cross-env:

npm i -g cross-env
cross-env CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/3.8.4/win32-ia32/appveyor-develop-81555fc7ee87da4f3c11fd2c7831e90fb8272fff-30494571/cypress.zip npm install https://cdn.cypress.io/beta/npm/3.8.4/appveyor-develop-81555fc7ee87da4f3c11fd2c7831e90fb8272fff-30494571/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 81555fc Jan 31, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin x64 version of the Test Runner.

You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.

You will need to use custom CYPRESS_INSTALL_BINARY url and install Cypress using an url instead of the version.

export CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/3.8.4/darwin-x64/circle-develop-81555fc7ee87da4f3c11fd2c7831e90fb8272fff-241059/cypress.zip
npm install https://cdn.cypress.io/beta/npm/3.8.4/circle-develop-81555fc7ee87da4f3c11fd2c7831e90fb8272fff-241054/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 81555fc Jan 31, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AppVeyor has built the win32 x64 version of the Test Runner.

You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.

You will need to use custom CYPRESS_INSTALL_BINARY url and install Cypress using an url instead of the version.

Instructions are included below, depending on the shell you are using.

In Command Prompt (cmd.exe):

set CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/3.8.4/win32-x64/appveyor-develop-81555fc7ee87da4f3c11fd2c7831e90fb8272fff-30494571/cypress.zip
npm install https://cdn.cypress.io/beta/npm/3.8.4/appveyor-develop-81555fc7ee87da4f3c11fd2c7831e90fb8272fff-30494571/cypress.tgz

In PowerShell:

$env:CYPRESS_INSTALL_BINARY = https://cdn.cypress.io/beta/binary/3.8.4/win32-x64/appveyor-develop-81555fc7ee87da4f3c11fd2c7831e90fb8272fff-30494571/cypress.zip
npm install https://cdn.cypress.io/beta/npm/3.8.4/appveyor-develop-81555fc7ee87da4f3c11fd2c7831e90fb8272fff-30494571/cypress.tgz

In Git Bash:

export CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/3.8.4/win32-x64/appveyor-develop-81555fc7ee87da4f3c11fd2c7831e90fb8272fff-30494571/cypress.zip
npm install https://cdn.cypress.io/beta/npm/3.8.4/appveyor-develop-81555fc7ee87da4f3c11fd2c7831e90fb8272fff-30494571/cypress.tgz

Using cross-env:

If the above commands do not work for you, you can also try using cross-env:

npm i -g cross-env
cross-env CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/3.8.4/win32-x64/appveyor-develop-81555fc7ee87da4f3c11fd2c7831e90fb8272fff-30494571/cypress.zip npm install https://cdn.cypress.io/beta/npm/3.8.4/appveyor-develop-81555fc7ee87da4f3c11fd2c7831e90fb8272fff-30494571/cypress.tgz

Please sign in to comment.