File tree Expand file tree Collapse file tree 5 files changed +24
-2
lines changed Expand file tree Collapse file tree 5 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -384,4 +384,15 @@ describe('cli', () => {
384
384
) ;
385
385
} ) ;
386
386
} ) ;
387
+
388
+ describe ( '--chrome-path' , ( ) => {
389
+ it ( 'should throw error if path does not exist' , async ( ) => {
390
+ const result = await runCLI (
391
+ `file://${ SIMPLE_HTML_FILE } ` ,
392
+ '--chrome-path="someinvalidpath"' ,
393
+ '--show-errors'
394
+ ) ;
395
+ assert . include ( result . stderr , 'no chrome binary at' ) ;
396
+ } ) ;
397
+ } ) ;
387
398
} ) ;
Original file line number Diff line number Diff line change @@ -77,6 +77,10 @@ program
77
77
'--chromedriver-path <path>' ,
78
78
'Absolute path to the desired chromedriver executable'
79
79
)
80
+ . option (
81
+ '--chrome-path <path>' ,
82
+ 'Absolute path to the desired chrome executable'
83
+ )
80
84
. action ( cli ) ;
81
85
82
86
program . parse ( process . argv ) ;
Original file line number Diff line number Diff line change @@ -36,7 +36,8 @@ const cli = async (
36
36
rules,
37
37
disable,
38
38
loadDelay,
39
- chromedriverPath
39
+ chromedriverPath,
40
+ chromePath
40
41
} = args ;
41
42
42
43
const showErrors = args . showErrors === true ;
@@ -67,7 +68,8 @@ const cli = async (
67
68
browser : args . browser ,
68
69
timeout,
69
70
chromeOptions,
70
- chromedriverPath
71
+ chromedriverPath,
72
+ chromePath
71
73
} ;
72
74
73
75
args . driver = startDriver ( driverConfigs ) ;
Original file line number Diff line number Diff line change @@ -21,6 +21,10 @@ const startDriver = async (
21
21
} , options ) ;
22
22
}
23
23
24
+ if ( config . chromePath ) {
25
+ options . setChromeBinaryPath ( config . chromePath ) ;
26
+ }
27
+
24
28
builder = new Builder ( )
25
29
. forBrowser ( 'chrome' )
26
30
. setChromeOptions ( options )
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ export interface WebdriverConfigParams {
23
23
browser : string ;
24
24
timeout : number ;
25
25
chromedriverPath ?: string ;
26
+ chromePath ?: string ;
26
27
path ?: string ;
27
28
chromeOptions ?: string [ ] ;
28
29
builder ?: Builder ;
You can’t perform that action at this time.
0 commit comments