ADEFA stands for AWS Device Farm which is a CLI to help test developer running UI tests on AWS Device Farm.
-
AWS Credentials
export AWS_ACCESS_KEY_ID=<id> export AWS_SECRET_ACCESS_KEY=<secret>
-
Python 3
pip3 install -e git+https://github.com/budtmo/adefa.git#egg=adefa
adefa -h
-
Create project
export PROJECT_ID=$(adefa create myFirstProject)
-
Upload app
export APP_ID=$(adefa upload --name sample.apk --project $PROJECT_ID --type ANDROID_APP --file https://github.com/budtmo/adefa/blob/master/test-app/sample_apk_debug.apk?raw=true)
-
Upload test scripts
export TEST_ID=$(adefa upload --name myTestScript --project $PROJECT_ID --type APPIUM_PYTHON_TEST_PACKAGE --file https://github.com/budtmo/adefa/blob/master/test-app/appium-python/test_scripts_app.zip?raw=true)
-
Create device group
For example we want to create device group from following devices:
- Samsung Galaxy S7 Edge - arn:aws:devicefarm:us-west-2::device:270E0E7C4512409A81CF7F8CE48B814B
- HTC One M8 (AT&T) - arn:aws:devicefarm:us-west-2::device:784D54EA42DF4030B669587FC2B5184E
- LG Nexus 5 - arn:aws:devicefarm:us-west-2::device:DAFD5E60762748C98D662E0320E3FE66
export GROUP_ID=$(adefa group --name myDeviceGroup --project $PROJECT_ID --device arn:aws:devicefarm:us-west-2::device:270E0E7C4512409A81CF7F8CE48B814B --device arn:aws:devicefarm:us-west-2::device:784D54EA42DF4030B669587FC2B5184E --device arn:aws:devicefarm:us-west-2::device:DAFD5E60762748C98D662E0320E3FE66)
-
Run test
export RUN_ID=$(adefa run --name firstRun --project $PROJECT_ID --app $APP_ID --type APPIUM_PYTHON --test $TEST_ID --group $GROUP_ID)
-
Get test result
adefa result $RUN_ID --total-attempts 15 --delay 30 --json-output
Run the unit tests with this command:
nosetests -v