Skip to content
This repository has been archived by the owner on Sep 25, 2019. It is now read-only.

Use Chrome Headless by default to run unit tests 😑 #379

Merged
merged 11 commits into from
Jul 19, 2017

Conversation

npejo
Copy link
Member

@npejo npejo commented Jul 14, 2017

Currently Sagui uses PhantomJS to run the tests. Since Chrome Headless is available in the stable release of Chrome 59, we can switch to use it by default.

This PR makes sure that we fallback to PhanthomJS if Chrome is not installed on the machine and preserves the option for consumers to override the browser by setting value for additionalKarmaConfig.browsers in sagui.config.js

Copy link
Member

@pirelenito pirelenito left a comment

Choose a reason for hiding this comment

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

This is awesome! Weirdly, it is no longer running the Chrome tests properly in Travis (it is always running in PhantomJS). 😢

We can look at it together tomorrow.

@npejo
Copy link
Member Author

npejo commented Jul 18, 2017

hm... 😕

const isChromeAvailable = availableBrowser.indexOf('Chrome') > -1
const isTravisChromeAvailable = (process.env['TRAVIS_STACK_FEATURES'] || '').indexOf('google-chrome') !== -1

if (isChromeAvailable && (!isTravis || (isTravis && isTravisChromeAvailable))) {
Copy link
Member

Choose a reason for hiding this comment

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

Me and @npejo just paired on this solution, a custom detection to work-around Travis.

@pirelenito pirelenito merged commit 434fe28 into v11 Jul 19, 2017
@pirelenito pirelenito deleted the use-chrome-headless-to-run-unit-tests-by-default branch July 19, 2017 09:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants