Skip to content
Latest commit c120ca1 Nov 28, 2019

README.md

Appium Server Side + Webdriver.io

This directory contains simple test scenario using Appium + Webdriver.io + Mocha.

Note: For now it's Android only example.

Structure

.
├── package.json
├── package-lock.json
├── run-tests.sh
├── test
│   └── specs
│       └── main.js
└── wdio.conf.js
  • package.json and package-lock.json is obvious for everyone familiar with Node.js. Shortly for those who doesn't know: it contains information about project and what's more important - dependenencies.
  • run-tests.sh - starting point for Bitbar Cloud executor
  • test/specs/main.js - Test itself
  • wdio.conf.js - Config for Webdriver.io Testrunner

Dependencies

  • @wdio/appium-service - Appium Service
  • @wdio/cli - Webdriver.io (and Testrunner)
  • @wdio/junit-reporter - JUnit reporter, because Bitbar Cloud reads JUnit reports to fetch information about i.a. test cases
  • @wdio/local-runner - To run test "locally" (because from server perspective it's locally)
  • @wdio/mocha-framework - Mocha support
  • @wdio/spec-reporter - Default spec reporter
  • @wdio/sync - To be able to enable sync mode
  • chai - Chai for Mocha (because I wanted to use should [BDD style])

Usage

Prepare package

As always for server side execution you need to create zip package. Zip all files mentioned in Structure section above.

You can do in either manually (with your OS file explorer) or by command line. Linux example:

zip sample-test.zip \
    package.json \
    package-lock.json \
    run-tests.sh \
    test/specs/main.js \
    wdio.conf.js

Upload Test and Create Test Run

The simplest way to do that would be using Bitbar Cloud UI. Especially if you don't know your API key. Click here to check out documentation.

This test is using Android bitbar-sample-app.apk. Download it and use it with prepared test package.

FAQ

To use Chai's should you need to run proper code. Where it's done?

It's in wdio.conf.js's before hook.

There is global function takeScreenshot in test - where it came from?

It's in wdio.conf.js's before hook.

Links

You can’t perform that action at this time.