The environment is Node.js. For client, I chose WebdriverIO. It is one of the two clients Appium website recommends for Node.js, so it seems a safe choice.
I created this test package based on the WebdriverIO Getting Started tutorial’s sample test:
I diverged from the tutorial, for service, I chose appium instead of chromedriver.
Then I made the following changes:
devDependencies
to dependencies
in package.json
so that npm-bundle
correctly includes them in the bundle.wdio.conf.js
:
browserName: 'firefox'
capability.connectionRetryCount: 10
(was 3).appium
from services
so that wdio won’t try to start the Appium service, since it is already running on the DeviceFarm instances.These changes are visible in this commit:
minor modifications on wdio.config.js: · gmatt/devicefarm-web-nodejs-test@d135910 · GitHub
To run the package on DeviceFarm, I followed this tutorial:
Working with Appium Node.js for Web Applications and AWS Device Farm - AWS Device Farm
Ran these commands:
npm-bundle
zip -r /MyTests.zip/ *.tgz
Then on DeviceFarm web console:
[Select project] > Create a new run
Web Application icon > Next
Test: Appium Node.js
[Upload the zip file]
Edit YAML:
replace
node YOUR_TEST_FILENAME.js
with
./node_modules/.bin/wdio wdio.conf.js
I saved the yaml as wdio-testspec.yml
.
It is available as an upload here:
And here:
Next step > [Set device pool] > Next step > Confirm and start run