This is a collection of sample Appium Python tests written for the AWS Device Farm Android sample app. This test suite uses the Appium page model to separate the tests from the page logic. You may use these tests as a starting reference for writing your own AWS Device Farm Appium Python Tests. Note: Your tests may be different than these and it is not a hard requirement that they exactly follow this model. This is an example for lookup.
Download and install the Appium GUI. [Windows Download]. [OS X Download].
Currently, AWS Device Farm supports Appium version 1.4.16. Using a different version locally may cause unexpected results when running Appium tests on AWS Device Farm.
Note: It would be always helpful to check the AWS Forums for checking the latest supported version and to use the same version in the steps below.
Read the Appium GUI documentation.
Follow the official Appium getting started guide and install the Appium server and dependencies.
Currently, AWS Device Farm supports Appium version 1.4.16. Using a different version locally may cause unexpected results when running Appium tests on AWS Device Farm.
Note: It would be always helpful to check the AWS Forums for checking the latest supported version and to use the same version in the steps below.
In order to use 1.4.16, download Appium through NPM with this command:
$ npm install -g appium@1.4.16
Verify that you have Appium installed with this command:
$ appium -v
You should get "1.4.16" as the output
We recommend setting up Python's virtualenv for developing and packaging tests so that unnecessary dependencies are not including in the bundled zip file.
Create your workspace and install py.test in your virtual environment. For example:
$ virtualenv workspace
$ cd workspace
$ source bin/activate
$ pip install pytest
$ pip install Appium-Python-Client
Put all Python test scripts under a tests/ folder in your workspace.
- workspace
└─ tests/ (tests go here)
Certain desired capabilities must be set when running locally. Refer to BaseTest.java
Start the Appium server.
Navigate into your workspace project directory in the terminal and activate the virtualenv.
$ source bin/activate
Verify that your test cases are discoverable by the following command, which should be run from your workspace folder.
$ py.test --collect-only tests/
Run your tests.
$ py.test tests/
Start the Appium server.
Navigate into your workspace project directory in the terminal and activate the virtualenv.
$ source bin/activate
Verify that your test cases are discoverable by the following command, which should be run from your workspace folder.
$ py.test --collect-only tests/
Run your tests.
$ py.test tests/
$ source bin/activate
$ ./package_tests.sh
Follow these instructions and upload test_bundle.zip on Step 9.