Superior web automation now becomes portable, with high-performance ARM-based devices.
This repository contains code of Getting Started with Webdriverio compatible to run as a service on balenaCloud with any balenaOS ARM device such as BalenaFin, Raspberrypi3 and more. Tested on balenaFin running balenaOS 2.48.0+rev1
Illustration Source: WebdriverIO docs
Chromedriver and Selenium not being available for the ARM architecture. Lead us to work with WebDriverIO for our web automation and testing needs, which uses Chrome DevTools protocol by default. Using Chrome Devtools protocol natively and replacing legacy Webdriver Protocol comes with many benefits. Some being:
- Lesser dependencies to manage
- Works natively with major browsers without the need for a driver (even Firefox)
- Faster, more efficient performance (The communication happens without any proxy, directly to the browser using WebSockets)
- Be able to test browser performance and much more.
It has cons too which are better explained on WebdriverIO Automation protocols page. Mainly, it can't be used remotely which works out for us as we run everything in containers. Let's get started.
- Grab a balenaFin, flash with the configuration for the application you just deployed, connect it, and wait for the magic to happen.
- Head over to the balenaCloud application to see if your device is online (It take at most 2-5 minutes)
- When done, the device would automatically start downloading the latest docker image and when done will run the tests.
- You can check the output in the logs on your balenaCloud dashboard
Webdriverio Testrunner running on BalenaFin over on Balena Cloud
The tests will run, open Chromium browser with the arguments provided in the wdio.conf.js file, connect puppeteer with the browser, and execute the tests. In the end, you would see test results over on the terminal. That's about it, now you can modify your tests from the tests folder (Written using Mocha) and explore more into Web automation and Webdriverio. If you are new to balenaCloud as well, we got you covered.
For any queries or bug reports, feel free to open an issue. Thanks to Christian Bromann for his help!
All source code under this repository is MIT licensed.