Skip to content

Commit

Permalink
ci: 🎡 Make TravisCI run with headless chrome
Browse files Browse the repository at this point in the history
  • Loading branch information
ikedam committed Feb 23, 2020
1 parent b932d81 commit fe962eb
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ before_install:
- echo 'Europe/Bratislava' | sudo tee /etc/timezone
- sudo dpkg-reconfigure --frontend noninteractive tzdata
- export CHROME_BIN=/usr/bin/google-chrome
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- sudo apt-get update
- sudo apt-get install -y libappindicator1 fonts-liberation
- wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
Expand Down
6 changes: 5 additions & 1 deletion gulp/e2e-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ function runProtractor (done) {

gulp.src(path.join(conf.paths.e2e, '/**/*.spec.js'))
.pipe($.protractor.protractor({
configFile: 'protractor.conf.js',
configFile: (
!process.env.TRAVIS
? 'protractor.conf.js'
: 'protractor-headless.conf.js'
),
args: args
}))
.on('error', function (err) {
Expand Down
15 changes: 15 additions & 0 deletions protractor-headless.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// https://angular.io/guide/testing#configure-cli-for-ci-testing-in-chrome
const config = require('./protractor.conf').config;
config.capabilities = {
browserName: 'chrome',
chromeOptions: {
args: [
"--headless",
"--disable-gpu",
"--no-sandbox",
"--disable-dev-shm-usage",
"--window-size=800,600"
]
}
};
exports.config = config;

0 comments on commit fe962eb

Please sign in to comment.