{"id":22449186,"url":"https://github.com/davealdon/android-functional-testing-pipeline","last_synced_at":"2026-03-19T22:56:13.081Z","repository":{"id":266285764,"uuid":"611929787","full_name":"DaveAldon/Android-Functional-Testing-Pipeline","owner":"DaveAldon","description":null,"archived":false,"fork":false,"pushed_at":"2023-04-13T18:55:14.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-31T05:55:01.966Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DaveAldon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-09T20:49:14.000Z","updated_at":"2023-03-09T20:49:14.000Z","dependencies_parsed_at":"2024-12-03T14:31:37.524Z","dependency_job_id":"c1b8fe45-6516-4327-9e17-b1b4324bc1d8","html_url":"https://github.com/DaveAldon/Android-Functional-Testing-Pipeline","commit_stats":null,"previous_names":["davealdon/android-functional-testing-pipeline"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DaveAldon/Android-Functional-Testing-Pipeline","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DaveAldon%2FAndroid-Functional-Testing-Pipeline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DaveAldon%2FAndroid-Functional-Testing-Pipeline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DaveAldon%2FAndroid-Functional-Testing-Pipeline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DaveAldon%2FAndroid-Functional-Testing-Pipeline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DaveAldon","download_url":"https://codeload.github.com/DaveAldon/Android-Functional-Testing-Pipeline/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DaveAldon%2FAndroid-Functional-Testing-Pipeline/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28232577,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2026-01-07T02:00:05.975Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-06T05:08:11.659Z","updated_at":"2026-01-07T04:38:41.469Z","avatar_url":"https://github.com/DaveAldon.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Android-Functional-Testing-Pipeline\n\nThe intention of this project is to outline how I've gotten functional testing to be semi-automated, and for this to be a good starting point to fully automate it in a pipeline.\n\nTo succeed, we need the following to happen:\n\n1. Create an MR in gitlab\n2. Pipeline is triggered and pulls in the branch\n3. Normal pipeline actions are performed, but a separate fastlane lane is triggered specifically for functional testing\n4. Pull out the results of the functional tests and display them in the pipeline. Results include\n   1. The html report\n   2. (optional for now) A recording of the emulator running the tests\n\n### Host Machine Requirements\n\n1. Openjdk - `apt-get install openjdk-8-jdk`\n\n2. Ruby and associated dependencies\n   1. `apt-get install ruby-full \u0026\u0026 apt install -y build-essential`\n   2. `gem install bundler \u0026\u0026 gem install fastlane`\n\n\n3. Repo with the espresso test branch. Make sure these env vars are setup as well, as the `security` CLI doesn't exist in Linux and we have to bypass this gradle step:\n\n```bash\nexport CI='something'\nexport ANDROID_STORE_PASSWORD='something'\n```\n\nThen install the repo's dependencies:\n\n```bash\ngit submodule update --init \u0026\u0026 bundle install\n```\n   \n4. Android SDK\n\nHere are commands I use to get this setup. For some reason, the Android command line tools have a problematic installation process that hasn't been updated in a while, so the directories are wrong and must be corrected:\n\n```bash\nexport ANDROID_SDK_ROOT=/usr/lib/android-sdk\n\nmkdir -p $ANDROID_SDK_ROOT\n\ncd $ANDROID_SDK_ROOT\n\nwget https://dl.google.com/android/repository/commandlinetools-linux-9123335_latest.zip\n\nunzip commandlinetools-linux-9123335_latest.zip -d $ANDROID_SDK_ROOT/cmdline-tools\n\nmv $ANDROID_SDK_ROOT/cmdline-tools/cmdline-tools $ANDROID_SDK_ROOT/cmdline-tools/tools\n\nrm*tools*linux*.zip\n```\n\nUpdate the path:\n\n`PATH=$PATH:$ANDROID_SDK_ROOT/cmdline-tools/latest/bin:$ANDROID_SDK_ROOT/cmdline-tools/tools/bin`\n\nAccept the license agreement:\n\n```bash\nyes | $ANDROID_SDK_ROOT/cmdline-tools/tools/bin/sdkmanager --licenses\n```\n\nVerify that the installation worked by running a debug build in the repo:\n\n```bash\ncd \u003cREPO_DIR\u003e\n\n./gradlew assembleDebug\n```\n\nIf it fails because of an issue finding the android sdk, you may need to use a GUI and just run the Android Studio install.\n\n### Connect to the emulator\n\nAt this point, we can run the emulator via Google's container, and connect to it remotely.\n\n```bash\ndocker run \\\n  -e ADBKEY=\"$(cat ~/.android/adbkey)\" \\\n  --device /dev/kvm \\\n  --publish 8554:8554/tcp \\\n  --publish 5555:5555/tcp  \\\n  us-docker.pkg.dev/android-emulator-268719/images/30-google-x64:30.1.2\n```\n\nOnce it is running, which allegedly can be verified via `adb wait-for-device` (not confirmed to be 100% accurate), we can connect to it via:\n\n```bash\nadb connect localhost:5555\n```\n\n`adb` is supposed to come with the Android SDK. If the alias isn't working, it's supposed to be in the `platform-tools` directory of the android sdk.\n\nVerify that the `adb` connection is working, and that the device is online:\n\n```bash\nadb devices\n```\n\nThis should output something like:\n\n```bash\nList of devices attached\nlocalhost:5555 device\n```\n\nNow run the fastlane lane to run the tests:\n\n```bash\ncd \u003cREPO_DIR\u003e\nbundle exec fastlane functionalTests\n```\n\n### Troubleshooting\n\nIf you encounter an error running the fastlane lane, we can bypass some of the build steps by running the tests directly via gradle:\n\n```bash\n./gradlew connectedDebugAndroidTest\n```\n\nIf there's errors installing the build onto the emulator, we can isolate these issues by installing a debug build directly:\n\n```bash\n./gradlew assembleDebug\n\n// This command bypasses the android security check that typically requires GUI interaction on the emulator\nadb shell settings put global verifier_verify_adb_installs 0\n\nadb install -g -r --force-queryable app/build/outputs/apk/debug/WHS-debug.apk\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavealdon%2Fandroid-functional-testing-pipeline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavealdon%2Fandroid-functional-testing-pipeline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavealdon%2Fandroid-functional-testing-pipeline/lists"}