Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(README): add notes about Puppeteer #144

Merged
merged 1 commit into from
Aug 30, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,32 @@ You can pass list of browsers as a CLI argument too:
$ karma start --browsers Chrome,Chrome_without_security
```

## Headless Chrome with Puppeteer

Chrome team made [Puppeteer](https://github.com/GoogleChrome/puppeteer). It will automatically install Chromium for all
platforms, so you can easily use it within your CI. Everything that you need, it's to install package and update your
Karma config.

```bash
$ npm install puppeteer --save-dev
```

```js
// karma.conf.js

const ChromiumRevision = require('puppeteer/package.json').puppeteer.chromium_revision
const Downloader = require('puppeteer/utils/ChromiumDownloader')
const revisionInfo = Downloader.revisionInfo(Downloader.currentPlatform(), revision)

process.env.CHROME_BIN = revisionInfo.executablePath

module.exports = function(config) {
config.set({
browsers: ['ChromeHeadless']
})
}
```

### Available browsers

- Chrome
Expand Down