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

Commit

Permalink
doc(browser-support) improved Firefox documentation (#4553)
Browse files Browse the repository at this point in the history
* docs(browser-support)

Added documentation on headless Firefox setup.

* docs(browser-support)

Documented Firefox-specific options.
  • Loading branch information
marklagendijk authored and qiyigg committed Oct 26, 2017
1 parent 8ac0f47 commit b204a83
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion docs/browser-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,19 @@ capabilities: {
},
```

Adding Firefox-Specific Options
------------------------------

Firefox options are nested in the `moz:firefoxOptions` object. A full list of options is at the [GeckoDriver](https://github.com/mozilla/geckodriver#firefox-capabilities) Github page. For example, to run in safe mode, your configuration would look like this:

```javascript
capabilities: {
'browserName': 'firefox',
'moz:firefoxOptions': {
'args': ['--safe-mode']
}
},
```

Testing Against Multiple Browsers
---------------------------------
Expand Down Expand Up @@ -118,7 +131,10 @@ browser2.$('.css').click();

Setting up PhantomJS
--------------------
PhantomJS is [no longer officially supported](https://groups.google.com/forum/#!topic/phantomjs/9aI5d-LDuNE). Instead, we recommend either [running Chrome in Xvfb](http://www.tothenew.com/blog/protractor-with-jenkins-and-headless-chrome-xvfb-setup/) or using Chrome's [headless mode](https://developers.google.com/web/updates/2017/04/headless-chrome).
PhantomJS is [no longer officially supported](https://groups.google.com/forum/#!topic/phantomjs/9aI5d-LDuNE). Instead, we recommend to use one of the following alternatives:
1. Chrome with [headless mode](https://developers.google.com/web/updates/2017/04/headless-chrome). Available in Chrome 59+ on Linux/Mac OS X, and in Chrome 60+ on Windows.
2. Firefox with [headless mode](https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options#-headless). Available in Firefox 55+ on Linux, and in Firefox 56+ on Windows/Mac OS X.
3. Chrome with [Xvfb](http://www.tothenew.com/blog/protractor-with-jenkins-and-headless-chrome-xvfb-setup/).


Using headless Chrome
Expand All @@ -138,3 +154,17 @@ capabilities: {
}
}
```

Using headless Firefox
---------------------
To start Firefox in headless mode, start Firefox with the [`--headless` flag](https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options#-headless).

```javascript
capabilities: {
browserName: 'firefox',

'moz:firefoxOptions': {
args: [ "--headless" ]
}
}
```

0 comments on commit b204a83

Please sign in to comment.