Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Commit

Permalink
fix(release): Pin CircleCI to Chrome v74
Browse files Browse the repository at this point in the history
We can't upgrade the version of Selenium without transitioning off the
control flow and breaking a bunch of people. Chrome v75 introduced the
new W3C actions API. Unfortunately, we can't update to support that
API without introducing other breakages, so v74 is the last version
of Chrome that will work with Protractor 5.

You can download a Chrome v74 snapshot from https://commondatastorage.googleapis.com/chromium-browser-snapshots/Linux_x64/638880/chrome-linux.zip

You might also need to pass "--no-sandbox" flag to Chrome
  • Loading branch information
heathkit committed Jan 27, 2020
1 parent efe7fdd commit d77731c
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 74 deletions.
76 changes: 76 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
version: 2
jobs:
build:
docker:
- image: circleci/node:6.14-browsers
environment:
# Fix issue with selenium-server in containers.
# See http://github.com/SeleniumHQ/docker-selenium/issues/87
DBUS_SESSION_BUS_ADDRESS: /dev/null
# Chrome v74 is the last version that works perfectly with Protractor.
CHROME_REVISION: 638880
CHROMEDRIVER_VERSION: 74.0.3729.6
# To find this revision number:
# 1. Find the exact chrome version you want: https://en.wikipedia.org/wiki/Google_Chrome_version_history
# 2. Put that version in this tool: https://omahaproxy.appspot.com/
# 3. Take the bumber from "Branch Base Position"
# 4. Look for the closest number to that revision in the snapshots: https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Linux_x64/
# CHROME 74 - 638880
# CHROME 75 - 652421
# CHROME 79 - 706915
steps:
- checkout
- run:
name: Install Dependencies
command: |
sudo apt-get update
sudo apt-get install python-pip openjdk-8-jdk tcpdump
# Install a specific version of Chrome (not latest)
sudo rm -rf /opt/google
sudo rm /usr/local/bin/chromedriver
wget -q -O chrome.zip https://commondatastorage.googleapis.com/chromium-browser-snapshots/Linux_x64/${CHROME_REVISION}/chrome-linux.zip
unzip chrome.zip
rm chrome.zip
sudo ln -sf ${PWD}/chrome-linux/chrome /usr/bin/chromium
sudo ln -sf /usr/bin/chromium /usr/bin/chromium-browser
sudo groupadd -r chrome && sudo useradd -r -g chrome -G audio,video chrome
sudo mkdir -p /home/chrome/reports
sudo chown -R chrome:chrome /home/chrome
- restore_cache:
key: node_modules-{{ .Branch }}-{{ checksum "package-lock.json" }}

- run:
name: NPM Install
command: |
npm i
cd testapp && npm i
- save_cache:
key: node_modules-{{ .Branch }}-{{ checksum "package-lock.json" }}
paths:
- "node_modules"
- "testapp/node_modules"

- run:
name: Lint
command: ./node_modules/.bin/gulp lint

- run:
name: Selenium Start
background: true
command: |
./node_modules/.bin/webdriver-manager update --versions.standalone=3.141.59 --versions.chrome=${CHROMEDRIVER_VERSION} --versions.gecko=v0.26.0
sudo cp ./node_modules/webdriver-manager/selenium/chromedriver_${CHROMEDRIVER_VERSION} /usr/local/bin/chromedriver
./node_modules/.bin/webdriver-manager start --versions.standalone=3.141.59 --versions.chrome=${CHROMEDRIVER_VERSION} --versions.gecko=v0.26.0
- run:
name: TestApp Start
background: true
command: |
npm start
- run:
name: Test
command: npm test
72 changes: 0 additions & 72 deletions circle.yml

This file was deleted.

9 changes: 7 additions & 2 deletions spec/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ module.exports = {
'browserName':
(process.env.TEST_BROWSER_NAME || 'chrome'),
'version':
(process.env.TEST_BROWSER_VERSION || 'ANY')
(process.env.TEST_BROWSER_VERSION || 'ANY'),
'chromeOptions': {
args: [
"--no-sandbox"
]
}
},

// Default http port to host the web server
Expand All @@ -25,4 +30,4 @@ module.exports = {
'http://' + (process.env.HTTP_HOST || 'localhost') +
':' + (process.env.HTTP_PORT || webServerDefaultPort)

};
};

0 comments on commit d77731c

Please sign in to comment.