Skip to content

Commit 39f0657

Browse files
author
John Doherty
committed
fixed eslint issues and updated docs to reflect additional electron support
1 parent f13cdab commit 39f0657

File tree

4 files changed

+17
-11
lines changed

4 files changed

+17
-11
lines changed

README.MD

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,15 @@ node ./node_modules/selenium-cucumber-js/index.js -s ./step-definitions
5656

5757
By default tests are run using Google Chrome, to run tests using another browser supply the name of that browser along with the `-b` switch. Available options are:
5858

59-
| Browser | Example
60-
| ---------- | ---------------
61-
| Chrome | `-b chrome`
62-
| Firefox | `-b firefox`
63-
| Phantom JS | `-b phantomjs`
59+
Browser | Example
60+
---------- | ---------------
61+
Chrome | `-b chrome`
62+
Firefox | `-b firefox`
63+
Phantom JS | `-b phantomjs`
64+
Electron | `-b electron`
65+
Custom | `-b customDriver.js`
66+
67+
To use your own driver, create a customDriver.js file in the root of your project and provide the filename with the `-b` switch.
6468

6569
#### Configuration file
6670

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "selenium-cucumber-js",
3-
"version": "1.4.9",
3+
"version": "1.4.10",
44
"description": "JavaScript browser automation framework using official selenium-webdriver and cucumber-js",
55
"main": "index.js",
66
"scripts": {

runtime/electronDriver.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,23 @@
22

33
var selenium = require('selenium-webdriver');
44
var path = require('path');
5+
56
var myapp = path.resolve(process.cwd(), 'MyApp.app/Contents/MacOS/MyApp');
67
/**
78
* Creates a Selenium WebDriver using Firefox as the browser
89
* @returns {ThenableWebDriver} selenium web driver
910
*/
1011
module.exports = function () {
1112

12-
var driver = new global.selenium.Builder()
13+
var driver = new selenium.Builder()
1314
.withCapabilities({
1415
chromeOptions: {
1516
// Here is the path to your Electron binary.
1617
binary: myapp
1718
}
1819
})
1920
.forBrowser('electron')
20-
.build()
21+
.build();
2122

2223
return driver;
2324
};

runtime/world.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ var cucumberJunit = require('cucumber-junit');
1919
// drivers
2020
var FireFoxDriver = require('./firefoxDriver.js');
2121
var PhantomJSDriver = require('./phantomDriver.js');
22-
var electronDriver = require('./electronDriver.js');
22+
var ElectronDriver = require('./electronDriver.js');
2323
var ChromeDriver = require('./chromeDriver');
2424

2525
/**
@@ -41,7 +41,7 @@ function getDriverInstance() {
4141
} break;
4242

4343
case 'electron': {
44-
driver = new electronDriver();
44+
driver = new ElectronDriver();
4545
} break;
4646

4747
case 'chrome': {
@@ -55,6 +55,7 @@ function getDriverInstance() {
5555
if (!fs.isFileSync(driverFileName)) {
5656
throw new Error('Could not find driver file: ' + driverFileName);
5757
}
58+
5859
driver = require(driverFileName)();
5960
}
6061
}
@@ -206,4 +207,4 @@ module.exports = function () {
206207
return driver.quit();
207208
});
208209
});
209-
};
210+
};

0 commit comments

Comments
 (0)