Appium: Webdriverio part of getting-started document is out of date.

Created on 28 Dec 2018  路  3Comments  路  Source: appium/appium

The problem

I just spended some hours to write very first test with appium, webdriverio by reading this guide,
and found that this guide is for webdriverio v4. 馃槩
Please update guide using webdriverio v5.

Environment

  • Appium version (or git revision) that exhibits the issue: 1.10.0
  • Last Appium version that did not exhibit the issue (if applicable):
  • Desktop OS/version used to run Appium: macOS High Sierra
  • Node.js version (unless using Appium.app|exe): v8.11.4
  • Mobile platform/version under test: android 9.0
  • Real device or emulator/simulator:
  • Appium CLI or Appium.app|exe: Appium CLI

Details

In webdriverio v5,

Link to Appium logs

Code To Reproduce Issue [ Good To Have ]

  1. install webdriverio
npm install webdriverio
  1. writing test code
const opts = {
  port: 4723,
  desiredCapabilities: {
    platformName: "Android",
    platformVersion: "8.0",
    deviceName: "Android Emulator",
    app: "/path/to/the/downloaded/ApiDemos.apk",
    automationName: "UiAutomator2"
  }
};

const client = wdio.remote(opts);
  1. run test
node test.js

result:

2018-12-28T01:56:19.188Z DEBUG wdio-config: wdio-sync not found, running tests asynchronous

node_modules/webdriverio/src/utils.js:199
        (typeof caps['appium-version'] !== 'undefined') ||
                    ^
TypeError: Cannot read property 'appium-version' of undefined
    at mobileDetector (/Users/dali/project/mathpedia-prototype/reactAim/node_modules/webdriverio/src/utils.js:199:21)
    at Object.remote (/Users/dali/project/mathpedia-prototype/reactAim/node_modules/webdriverio/src/index.js:35:29)
    at Object.<anonymous> (/Users/dali/project/mathpedia-prototype/reactAim/test/e2e/login.test.js:15:21)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:191:16)
Documentation

Most helpful comment

This is updated now. Thanks for jumping on this @saikrishna321 and thanks @iwonrimath for bringing this to our attention.

All 3 comments

This is updated now. Thanks for jumping on this @saikrishna321 and thanks @iwonrimath for bringing this to our attention.

This guide is still out of date. There's an await in the sample code that is not within an async function. The guide should not present this sample code and simply say "You can try and run this test on your own. "Simply save it and execute it using node" because obviously it won't run. I'd say it is quite confusing for a complete n00b.

This has been updated on Github (https://github.com/appium/appium/blob/master/docs/en/about-appium/getting-started.md) but needs to be synced to appium.io

Was this page helpful?
0 / 5 - 0 ratings