File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 7575 " html"
7676 ],
7777 "statements" : 95 ,
78- "branches" : 92 ,
78+ "branches" : 91 ,
7979 "functions" : 94 ,
8080 "lines" : 95 ,
8181 "exclude" : [
Original file line number Diff line number Diff line change @@ -118,6 +118,24 @@ const cli = async (
118118 console . error ( error ( 'Error: %s' ) , e . message ) ;
119119 console . log ( `The timeout is currently configured to be ${ timeout } seconds (you can change it with --timeout).` )
120120 process . exit ( 2 ) ;
121+ }
122+ // Provide a more user-friendly error message when there's a ChromeDriver/Chrome version mismatch.
123+ else if (
124+ e instanceof selenium_error . SessionNotCreatedError &&
125+ e . message . includes (
126+ 'This version of ChromeDriver only supports'
127+ // This string has to match the error message printed by chromedriver, see
128+ // https://chromium.googlesource.com/chromium/src/+/refs/tags/110.0.5481.194/chrome/test/chromedriver/chrome_launcher.cc#300.
129+ )
130+ ) {
131+ console . error ( error ( 'Error: %s' ) , e . message ) ;
132+ console . log ( `\nPlease install a matching version of ChromeDriver and run axe with the --chromedriver-path option:
133+
134+ $ npm install -g chromedriver@<version>
135+ $ axe --chromedriver-path $(npm root -g)/chromedriver/bin/chromedriver <url...>
136+
137+ (where <version> is the first number of the "current browser version" reported above.)` ) ;
138+ process . exit ( 2 ) ;
121139 } else {
122140 throw e ;
123141 }
You can’t perform that action at this time.
0 commit comments