Appium Server Side + Webdriver.io
Note: For now it's Android only example.
. ├── package.json ├── package-lock.json ├── run-tests.sh ├── test │ └── specs │ └── main.js └── wdio.conf.js
package-lock.jsonis 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
@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])
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
This test is using Android bitbar-sample-app.apk. Download it and use it with prepared test package.
To use Chai's
shouldyou need to run proper code. Where it's done?
There is global function
takeScreenshotin test - where it came from?