Skip to content
Valeria Rogatchevskikh edited this page Nov 15, 2020 · 7 revisions

Once the new test has been added to the Google Sheet, create the json files by using the Custom Utilities scripts.

  1. Generate the dashboard JSON: Export Dashboard JSON Paste the contents of the popup into a file called caddisfly-tests-v2-dev.json Upload this file to s3 public bucket using the admin account. akvoflow-dev2 is the only instance that uses this file, most of the other instances use caddisfly-tests-v2.json. You can now create a survey with your new tests and download them to your app.

  2. Generate the caddisfly app's JSON: Export tests JSON Replace the contents of the apps src/main/assets/tests.json by this one. Add drawable/images if required. Add strings to the correct strings file. Strings can be found in the Instruction Text sheet tab.

  3. Run the Android UI Tests with the screenshot option "on" on a real device.

buildConfigField "Boolean", "TAKE_SCREENSHOTS", "true"

./gradlew connectedMainExtInspectAndroidTest

you can also run specific tests, for example: ./gradlew connectedMainExtInspectAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=org.akvo.caddisfly.instruction.ManualInstructionsTest#manual_AllInstructions

If the tests succeed pull the screenshots from the device:

adb pull sdcard/Akvo\ Caddisfly/screenshots .

resize the screenshots, for example in Linux this can be easily done with this command: mogrify -resize 250x444 *.png

Clone the akvo-caddisfly-screenshots repo and paste the screenshots inside the correct language folder, then push to have the site updated with the new screenshots.

  1. If you want to test how your test behaves and see all the instructions without having an external device like the MD610, it is possible to enable the diagnostics mode by tapping the version number at least 10 times in the About Screen.

You can then start your test instructions with:

adb shell am start -a android.intent.action.VIEW -d "akvo://caddisfly?id=2456d482-dbec-466c-8387-411a4093f6b6" org.akvo.caddisfly

Clone this wiki locally