Appium is a popular testing framework to catch defects in native, hybrid, and web apps. You can easily integrate your Appium UI tests into your own Bitrise workflow using our Script
Step. This way you can have the whole testing screen recorded and can visually verify if your app is doing what it’s supposed to do.
In this guide we’ll show how to kickstart Appium and run your UI test specified in the test.js
file, then retrieve the test results and view them on bitrise.io.
ADB workaround for Javascript
Javascript does not support the in-built screen recording and screen capturing commands so we’re using ADB shell commands as a workaround. For all the other languages, check out Appium’s Start Recording Screen guide.
We will use our Script and Deploy to Bitrise.io Steps. Here is why:
The Script Step executes what you insert in its input field.
The Deploy to Bitrise.io Step delivers your test result to the Artifacts tab of your Build’s page.
Let’s put this all together!
Insert the Script Step as the first Step in your Workflow.
Insert the following command to the Script content input field.
appium &> $BITRISE_DEPLOY_DIR/logs.txt & disown npm test
You will find the above mentioned logs.txt file in the Bitrise deploy directory (
BITRISE_DEPLOY_DIR
). This logs.txt file contains the outputs of the Appium server. With the help of the Deploy to Bitrise.io Step, you will be able to download this file from the Artifacts tab.Since screen recoding is not supported through Javascript, we advise you to add the screen recording / screen capturing and the file retrieving shell commands to your own
test.js
file.Once you have pulled the test results (which in this case can be videos and screenshots) from the emulator, make sure you move them to the Bitrise deploy directory (
BITRISE_DEPLOY_DIR
).Insert the Deploy to Bitrise.io Step to your workflow so that it can export your test results to the Artifacts tab on your Build’s page.
Start a build!
If all went well, you should be able to view the generated test results on the Artifacts tab of your Build’s page.