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

Commit 235dd4c

Browse files
jfroomjuliemr
authored andcommitted
docs(browser-setup): add PhantomJS setup info
- Add notes about PhantomJS setup. - May require further documentation. Contributes to #189
1 parent b363431 commit 235dd4c

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

docs/browser-setup.md

+23-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ capabilities: {
2323

2424
You may need to install a separate binary to run another browser, such as IE or Android.
2525

26-
Adding chrome-specific options
27-
------------------------------
26+
### Adding chrome-specific options
2827

2928
Chrome options are nested in the `chromeOptions` object. A full list of options is at [the chromedriver site](https://sites.google.com/a/chromium.org/chromedriver/capabilities). For example, to show an FPS counter in the upper right, your configuration would look like this:
3029

@@ -36,3 +35,25 @@ capabilities: {
3635
}
3736
},
3837
```
38+
39+
PhantomJS
40+
-------------------------------------
41+
In order to test locally with [PhantomJS](http://phantomjs.org/), you'll need to either have it installed globally, or relative to your project. For global install see the [PhantomJS download page](http://phantomjs.org/download.html). For relative install run: `npm install --save-dev phantomjs`.
42+
43+
Add phantomjs to the driver capabilities, and include a path to the binary if using local installation:
44+
```javascript
45+
capabilities: {
46+
'browserName': 'phantomjs',
47+
48+
// should be able to omit this property if phantomjs installed globally
49+
'phantomjs.binary.path':'./node_modules/phantomjs/bin/phantomjs'
50+
}
51+
```
52+
53+
Jasmine tests should work without further customization. If you are using Mocha, or another framework, the driver will need to be adjusted accordingly:
54+
```javascript
55+
driver = new webdriver.Builder().
56+
usingServer('http://localhost:4444/wd/hub').withCapabilities(webdriver.Capabilities.phantomjs()).build();
57+
```
58+
59+

0 commit comments

Comments
 (0)