dlenroc / appium-roku-driver

WebDriver for testing channels / screensavers on roku devices
MIT License
10 stars 0 forks source link

Appium 2 not able to load Roku Driver #53

Closed gshah30 closed 2 years ago

gshah30 commented 2 years ago

Installed Appium 2.0.0-beta.38

[gshah@workstation node_modules]$ sudo npm install -g appium@next

added 444 packages, and audited 445 packages in 37s

64 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
[gshah@workstation node_modules]$ appium -v
2.0.0-beta.38
[gshah@workstation node_modules]$ appium driver list
✔ Listing available drivers
- uiautomator2 [not installed]
- xcuitest [not installed]
- youiengine [not installed]
- windows [not installed]
- mac [not installed]
- mac2 [not installed]
- espresso [not installed]
- tizen [not installed]
- flutter [not installed]
- safari [not installed]
- gecko [not installed]

Installed Appium Roku Driver but got a warning that the roku driver may be incompatible.

[gshah@workstation node_modules]$ appium driver install --source npm @dlenroc/appium-roku-driver
✔ Installing '@dlenroc/appium-roku-driver'
⚠ Driver "roku" has 1 potential problem: 
  - Driver "roku" (package `@dlenroc/appium-roku-driver`) may be incompatible with the current version of Appium (v2.0.0-beta.38) due to an invalid or missing peer dependency on Appium. Please ask the developer of `@dlenroc/appium-roku-driver` to add a peer dependency on `^appium@2.0.0-beta.38`.
ℹ Driver roku@0.8.2 successfully installed
- automationName: Roku
- platformNames: ["Roku"]

Listing drivers also gives the same warning.

[gshah@workstation node_modules]$ appium driver list
WARN Appium Appium encountered 2 warnings while validating drivers found in manifest /home/gshah/.appium/node_modules/.cache/appium/extensions.yaml
WARN Appium Driver "roku" has 1 potential problem: 
WARN Appium   - Driver "roku" (package `@dlenroc/appium-roku-driver`) may be incompatible with the current version of Appium (v2.0.0-beta.38) due to an invalid or missing peer dependency on Appium. Please ask the developer of `@dlenroc/appium-roku-driver` to add a peer dependency on `^appium@2.0.0-beta.38`.
✔ Listing available drivers
- roku@0.8.2 [installed (NPM)]
- uiautomator2 [not installed]
- xcuitest [not installed]
- youiengine [not installed]
- windows [not installed]
- mac [not installed]
- mac2 [not installed]
- espresso [not installed]
- tizen [not installed]
- flutter [not installed]
- safari [not installed]
- gecko [not installed]

But starting Appium throws an error while loading the Roku driver.

[gshah@workstation node_modules]$ appium
WARN Appium Appium encountered 2 warnings while validating drivers found in manifest /home/gshah/.appium/node_modules/.cache/appium/extensions.yaml
WARN Appium Driver "roku" has 1 potential problem: 
WARN Appium   - Driver "roku" (package `@dlenroc/appium-roku-driver`) may be incompatible with the current version of Appium (v2.0.0-beta.38) due to an invalid or missing peer dependency on Appium. Please ask the developer of `@dlenroc/appium-roku-driver` to add a peer dependency on `^appium@2.0.0-beta.38`.
[Appium] Welcome to Appium v2.0.0-beta.38
[Appium] Attempting to load driver roku...
[debug] [Appium] Requiring driver at /home/gshah/.appium/node_modules/@dlenroc/appium-roku-driver
[Appium] Could not load driver 'roku', so it will not be available. Error in loading the driver was: Cannot find module 'log-symbols'
[Appium] Require stack:
[Appium] - /home/gshah/.appium/node_modules/@dlenroc/appium-roku-driver/node_modules/@appium/support/build/lib/console.js
[Appium] - /home/gshah/.appium/node_modules/@dlenroc/appium-roku-driver/node_modules/@appium/support/build/lib/index.js
[Appium] - /home/gshah/.appium/node_modules/@dlenroc/appium-roku-driver/node_modules/@appium/support/index.js
[Appium] - /home/gshah/.appium/node_modules/@dlenroc/appium-roku-driver/node_modules/@appium/base-driver/build/lib/basedriver/logger.js
[Appium] - /home/gshah/.appium/node_modules/@dlenroc/appium-roku-driver/node_modules/@appium/base-driver/build/lib/basedriver/desired-caps.js
[Appium] - /home/gshah/.appium/node_modules/@dlenroc/appium-roku-driver/node_modules/@appium/base-driver/build/lib/basedriver/capabilities.js
[Appium] - /home/gshah/.appium/node_modules/@dlenroc/appium-roku-driver/node_modules/@appium/base-driver/build/lib/basedriver/driver.js
[Appium] - /home/gshah/.appium/node_modules/@dlenroc/appium-roku-driver/node_modules/@appium/base-driver/build/lib/index.js
[Appium] - /home/gshah/.appium/node_modules/@dlenroc/appium-roku-driver/node_modules/@appium/base-driver/index.js
[Appium] - /home/gshah/.appium/node_modules/@dlenroc/appium-roku-driver/dist/index.js
[Appium] - /usr/lib/node_modules/appium/build/lib/extension/extension-config.js
[Appium] - /usr/lib/node_modules/appium/build/lib/cli/extension-command.js
[Appium] - /usr/lib/node_modules/appium/build/lib/cli/driver-command.js
[Appium] - /usr/lib/node_modules/appium/build/lib/cli/extension.js
[Appium] - /usr/lib/node_modules/appium/build/lib/main.js
[Appium] - /usr/lib/node_modules/appium/index.js
[debug] [Appium] Error: Cannot find module 'log-symbols'
[debug] [Appium] Require stack:
[debug] [Appium] - /home/gshah/.appium/node_modules/@dlenroc/appium-roku-driver/node_modules/@appium/support/build/lib/console.js
[debug] [Appium] - /home/gshah/.appium/node_modules/@dlenroc/appium-roku-driver/node_modules/@appium/support/build/lib/index.js
[debug] [Appium] - /home/gshah/.appium/node_modules/@dlenroc/appium-roku-driver/node_modules/@appium/support/index.js
[debug] [Appium] - /home/gshah/.appium/node_modules/@dlenroc/appium-roku-driver/node_modules/@appium/base-driver/build/lib/basedriver/logger.js
[debug] [Appium] - /home/gshah/.appium/node_modules/@dlenroc/appium-roku-driver/node_modules/@appium/base-driver/build/lib/basedriver/desired-caps.js
[debug] [Appium] - /home/gshah/.appium/node_modules/@dlenroc/appium-roku-driver/node_modules/@appium/base-driver/build/lib/basedriver/capabilities.js
[debug] [Appium] - /home/gshah/.appium/node_modules/@dlenroc/appium-roku-driver/node_modules/@appium/base-driver/build/lib/basedriver/driver.js
[debug] [Appium] - /home/gshah/.appium/node_modules/@dlenroc/appium-roku-driver/node_modules/@appium/base-driver/build/lib/index.js
[debug] [Appium] - /home/gshah/.appium/node_modules/@dlenroc/appium-roku-driver/node_modules/@appium/base-driver/index.js
[debug] [Appium] - /home/gshah/.appium/node_modules/@dlenroc/appium-roku-driver/dist/index.js
[debug] [Appium] - /usr/lib/node_modules/appium/build/lib/extension/extension-config.js
[debug] [Appium] - /usr/lib/node_modules/appium/build/lib/cli/extension-command.js
[debug] [Appium] - /usr/lib/node_modules/appium/build/lib/cli/driver-command.js
[debug] [Appium] - /usr/lib/node_modules/appium/build/lib/cli/extension.js
[debug] [Appium] - /usr/lib/node_modules/appium/build/lib/main.js
[debug] [Appium] - /usr/lib/node_modules/appium/index.js
[debug] [Appium]     at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
[debug] [Appium]     at Function.Module._load (node:internal/modules/cjs/loader:778:27)
[debug] [Appium]     at Module.require (node:internal/modules/cjs/loader:999:19)
[debug] [Appium]     at require (node:internal/modules/cjs/helpers:102:18)
[debug] [Appium]     at Object.<anonymous> (/home/gshah/.appium/node_modules/@dlenroc/appium-roku-driver/node_modules/@appium/support/lib/console.js:5:1)
[debug] [Appium]     at Module._compile (node:internal/modules/cjs/loader:1097:14)
[debug] [Appium]     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1151:10)
[debug] [Appium]     at Module.load (node:internal/modules/cjs/loader:975:32)
[debug] [Appium]     at Function.Module._load (node:internal/modules/cjs/loader:822:12)
[debug] [Appium]     at Module.require (node:internal/modules/cjs/loader:999:19)
[debug] [Appium]     at require (node:internal/modules/cjs/helpers:102:18)
[debug] [Appium]     at Object.<anonymous> (/home/gshah/.appium/node_modules/@dlenroc/appium-roku-driver/node_modules/@appium/support/lib/index.js:16:1)
[debug] [Appium]     at Module._compile (node:internal/modules/cjs/loader:1097:14)
[debug] [Appium]     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1151:10)
[debug] [Appium]     at Module.load (node:internal/modules/cjs/loader:975:32)
[debug] [Appium]     at Function.Module._load (node:internal/modules/cjs/loader:822:12)
[debug] [Appium]     at Module.require (node:internal/modules/cjs/loader:999:19)
[debug] [Appium]     at require (node:internal/modules/cjs/helpers:102:18)
[debug] [Appium]     at Object.<anonymous> (/home/gshah/.appium/node_modules/@dlenroc/appium-roku-driver/node_modules/@appium/support/index.js:1:18)
[debug] [Appium]     at Module._compile (node:internal/modules/cjs/loader:1097:14)
[debug] [Appium]     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1151:10)
[debug] [Appium]     at Module.load (node:internal/modules/cjs/loader:975:32)
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[Appium] Available drivers:
[Appium]   - roku@0.8.2 (automationName 'Roku')
[Appium] No plugins have been installed. Use the "appium plugin" command to install the one(s) you want to use.
^C[Appium] Received SIGINT - shutting down
[debug] [AppiumDriver@0539] There are no active sessions for cleanup
[HTTP] Waiting until the server is closed
[HTTP] Received server close event

Can we fix this error and make appium capable of loading the roku driver ?

dlenroc commented 2 years ago

The issue was fixed in the latest Appium 2 Beta version, tried with the Appium v2.0.0-beta.40 and Node.js 16 LTS, and everything worked well.

PS: In https://github.com/dlenroc/appium-roku-driver/pull/54 I have updated the dependencies and pinned their state which should help avoid such situations.