Skip to content

Commit 0a910fd

Browse files
authored
feat: add appium:showChromedriverLog support (#66)
* feat: add appium:showChromedriverLog support * tweak tyoe
1 parent f2067c4 commit 0a910fd

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ package in your `package.json`)
3939
|`appium:appId`|[Required] The app package ID, if you want Appium to use an app already on the TV. Exclusive with `appium:app`|
4040
|`appium:app`|[Optional] An absolute path to your `.ipk` app file, if you want Appium to install the app.|
4141
|`appium:debuggerPort`|[Optional; default `9998`] The port on the device exposed for remote Chromium debugging.|
42+
| `appium:showChromedriverLog` | If set to `true` then all the output from chromedriver binary will be forwarded to the Appium server log. `false` by default. |
4243
|`appium:chromedriverExecutable`(*)|[Optional] Most LG TVs run a very old version of Chrome. Because this driver uses Chromedriver under the hood, you'll need to have a very old version of Chromedriver handy that works with the version of Chrome backing the apps on your TV. In our testing, we've found Chromedriver 2.36 to work with most TVs. You need to tell the driver where you've installed this version of Chromedriver using the `appium:chromedriverExecutable` capability, passing in an absolute path to the Chromedriver binary.|
4344
| `appium:chromedriverExecutableDir`(*) | [Optional] Full path to the folder where chromedriver executables are located. This folder is used then to store the downloaded chromedriver executables if automatic download is enabled with `chromedriver_autodownload` security flag. Please read [Automatic Discovery of Compatible Chromedriver in appium-uiautomator2-driver](https://github.com/appium/appium-uiautomator2-driver?tab=readme-ov-file#automatic-discovery-of-compatible-chromedriver) for more details. If the chrome version on the TV is lower than v63 major version, the using chrome version will be `Chrome/63.0.3239.0` forcefully to use chromedriver 2.36 for the session. Lower chromedriver could raise `cannot find Chrome binary` error, which prevent starting chromedriver session. |
4445
|`appium:websocketPort`|[Optional; default `3000`] The websocket port on the device exposed for remote control|

lib/constraints.js

+3
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ export const CAP_CONSTRAINTS = Object.freeze(
5757
keyCooldown: {
5858
isNumber: true,
5959
},
60+
showChromedriverLog: {
61+
isBoolean: true
62+
},
6063
})
6164
);
6265

lib/driver.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ export class WebOSDriver extends BaseDriver {
123123
fullReset,
124124
deviceHost,
125125
debuggerPort,
126+
showChromedriverLog,
126127
chromedriverExecutable,
127128
chromedriverExecutableDir,
128129
appLaunchCooldown,
@@ -201,6 +202,7 @@ export class WebOSDriver extends BaseDriver {
201202
executable: /** @type {string} */ (chromedriverExecutable),
202203
executableDir: /** @type {string} */ (chromedriverExecutableDir),
203204
isAutodownloadEnabled: /** @type {Boolean} */ (this.#isChromedriverAutodownloadEnabled()),
205+
verbose: /** @type {Boolean | undefined} */ (showChromedriverLog),
204206
});
205207

206208
log.info('Waiting for app launch to take effect');
@@ -298,7 +300,7 @@ export class WebOSDriver extends BaseDriver {
298300
/**
299301
* @param {StartChromedriverOptions} opts
300302
*/
301-
async startChromedriver({debuggerHost, debuggerPort, executable, executableDir, isAutodownloadEnabled}) {
303+
async startChromedriver({debuggerHost, debuggerPort, executable, executableDir, isAutodownloadEnabled, verbose}) {
302304
const debuggerAddress = `${debuggerHost}:${debuggerPort}`;
303305

304306

@@ -332,7 +334,8 @@ export class WebOSDriver extends BaseDriver {
332334
executableDir,
333335
isAutodownloadEnabled,
334336
// @ts-ignore
335-
details: {info: result}
337+
details: {info: result},
338+
verbose
336339
});
337340

338341
// XXX: goog:chromeOptions in newer versions, chromeOptions in older

lib/types.ts

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export interface StartChromedriverOptions {
5353
executable?: string;
5454
executableDir?: string;
5555
isAutodownloadEnabled: boolean;
56+
verbose?: boolean;
5657
}
5758

5859
/**

0 commit comments

Comments
 (0)