]> khamidou — GitHub mirrors - electron.git/commitdiff
Suggest adding arguments when running webdriver
authorMing Luo <mcluo1994@gmail.com>
Tue, 10 Nov 2015 19:55:00 +0000 (14:55 -0500)
committerMing Luo <mcluo1994@gmail.com>
Tue, 10 Nov 2015 19:58:38 +0000 (14:58 -0500)
docs/tutorial/using-selenium-and-webdriver.md

index b87f8f11dac9301224bc8ae120f1225956428216..867e452442b3948cf77de78a89e29e020c2979fd 100644 (file)
@@ -46,9 +46,12 @@ var webdriver = require('selenium-webdriver');
 var driver = new webdriver.Builder()
   // The "9515" is the port opened by chrome driver.
   .usingServer('http://localhost:9515')
-  .withCapabilities({chromeOptions: {
-    // Here is the path to your Electron binary.
-    binary: '/Path-to-Your-App.app/Contents/MacOS/Atom'}})
+  .withCapabilities({
+    chromeOptions: {
+      // Here is the path to your Electron binary.
+      binary: '/Path-to-Your-App.app/Contents/MacOS/Atom',
+    }
+  })
   .forBrowser('electron')
   .build();
 
@@ -96,7 +99,10 @@ var options = {
     port: 9515,        // "9515" is the port opened by chrome driver.
     desiredCapabilities: {
         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)
 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/