Merge pull request #3392 from Mingling94/master

Suggest adding arguments when running webdriver
This commit is contained in:
Cheng Zhao 2015-11-11 22:57:30 +08:00
commit f08bd721f3

View file

@ -46,9 +46,12 @@ var webdriver = require('selenium-webdriver');
var driver = new webdriver.Builder() var driver = new webdriver.Builder()
// The "9515" is the port opened by chrome driver. // The "9515" is the port opened by chrome driver.
.usingServer('http://localhost:9515') .usingServer('http://localhost:9515')
.withCapabilities({chromeOptions: { .withCapabilities({
// Here is the path to your Electron binary. chromeOptions: {
binary: '/Path-to-Your-App.app/Contents/MacOS/Atom'}}) // Here is the path to your Electron binary.
binary: '/Path-to-Your-App.app/Contents/MacOS/Atom',
}
})
.forBrowser('electron') .forBrowser('electron')
.build(); .build();
@ -96,7 +99,10 @@ var options = {
port: 9515, // "9515" is the port opened by chrome driver. port: 9515, // "9515" is the port opened by chrome driver.
desiredCapabilities: { desiredCapabilities: {
browserName: 'chrome', browserName: 'chrome',
chromeOptions: {binary: '/Path-to-Your-App.app/Electron'} // Path to your Electron binary. chromeOptions: {
binary: '/Path-to-Your-App/electron', // Path to your Electron binary.
args: [/* cli arguments */] // Optional, perhaps 'app=' + /path/to/your/app/
}
} }
}; };
@ -119,4 +125,8 @@ To test your application without rebuilding Electron, simply
[place](https://github.com/atom/electron/blob/master/docs/tutorial/application-distribution.md) [place](https://github.com/atom/electron/blob/master/docs/tutorial/application-distribution.md)
your app source into Electron's resource directory. your app source into Electron's resource directory.
Alternatively, pass an argument to run with your electron binary that points to
your app's folder. This eliminates the need to copy-paste your app into
Electron's resource directory.
[chrome-driver]: https://sites.google.com/a/chromium.org/chromedriver/ [chrome-driver]: https://sites.google.com/a/chromium.org/chromedriver/