File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ var cucumberJunit = require('cucumber-junit');
2424 */
2525function getDriverInstance ( ) {
2626
27+ var driver ;
2728 switch ( browserName || '' ) {
2829
2930 case 'firefox' : {
@@ -48,8 +49,7 @@ function getDriverInstance() {
4849
4950 } break ;
5051
51- // default to chrome
52- default : {
52+ case 'chrome' : {
5353
5454 driver = new selenium . Builder ( ) . withCapabilities ( {
5555 browserName : 'chrome' ,
@@ -60,6 +60,15 @@ function getDriverInstance() {
6060 } ,
6161 path : chromedriver . path
6262 } ) . build ( ) ;
63+ } break ;
64+
65+ // try to load from file
66+ default : {
67+ var driverFileName = path . resolve ( process . cwd ( ) , browserName ) ;
68+ if ( ! fs . isFileSync ( driverFileName ) ) {
69+ throw "Could not find driver file: " + driverFileName ;
70+ }
71+ driver = require ( driverFileName ) ( ) ;
6372 }
6473 }
6574
You can’t perform that action at this time.
0 commit comments