Skip to content

Commit 3123820

Browse files
authored
chore: leave log message if no browser info was found (#55)
1 parent 61e8131 commit 3123820

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

lib/driver.js

+18-2
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,21 @@ export class WebOSDriver extends BaseDriver {
201201
}
202202

203203

204+
/**
205+
* @typedef BrowserVersionInfo
206+
* @property {string} Browser
207+
* @property {string} Protocol-Version
208+
* @property {string} User-Agent
209+
* @property {string} V8-Version
210+
* @property {string} WebKit-Version
211+
* @property {string} webSocketDebuggerUrl
212+
*/
213+
204214
/**
205215
* Use UserAgent info for "Browser" if the chrome response did not include
206216
* browser name properly.
207-
* @param {object} browserVersionInfo
217+
* @param {BrowserVersionInfo} browserVersionInfo
218+
* @return {BrowserVersionInfo}
208219
*/
209220
useUAForBrowserIfNotPresent(browserVersionInfo) {
210221
if (!_.isEmpty(browserVersionInfo.Browser)) {
@@ -222,6 +233,7 @@ export class WebOSDriver extends BaseDriver {
222233
}
223234

224235
log.info(`The response did not have Browser, thus set the Browser value from UA as ${JSON.stringify(browserVersionInfo)}`);
236+
// @ts-ignore isEmpty already checked as null.
225237
browserVersionInfo.Browser = chromeVersion[0];
226238
return browserVersionInfo;
227239
}
@@ -258,9 +270,13 @@ export class WebOSDriver extends BaseDriver {
258270

259271
// To respect the executableDir.
260272
executable = undefined;
273+
274+
if (_.isEmpty(result.Browser)) {
275+
this.log.info(`No browser version info was available. If no proper chromedrivers exist in ${executableDir}, the session creation will fail.`);
276+
}
261277
} catch (err) {
262278
throw new errors.SessionNotCreatedError(
263-
`Could not get the chrome browser information to detect proper chromedriver version. Is it a debiggable build? Error: ${err.message}`
279+
`Could not get the chrome browser information to detect proper chromedriver version. Is it a debuggable build? Error: ${err.message}`
264280
);
265281
}
266282
}

0 commit comments

Comments
 (0)