{"id":29071380,"url":"https://github.com/selectel/mobile-farm-autotest-example","last_synced_at":"2025-06-27T13:30:29.170Z","repository":{"id":281841080,"uuid":"896091421","full_name":"selectel/mobile-farm-autotest-example","owner":"selectel","description":"Android CI Testing with Selectel Mobile Farm","archived":false,"fork":false,"pushed_at":"2025-03-11T11:53:30.000Z","size":108,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T20:39:08.562Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/selectel.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":"2024-11-29T14:25:02.000Z","updated_at":"2025-03-11T11:53:33.000Z","dependencies_parsed_at":"2025-03-11T12:47:42.650Z","dependency_job_id":null,"html_url":"https://github.com/selectel/mobile-farm-autotest-example","commit_stats":null,"previous_names":["selectel/mobile-farm-autotest-example"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/selectel/mobile-farm-autotest-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selectel%2Fmobile-farm-autotest-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selectel%2Fmobile-farm-autotest-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selectel%2Fmobile-farm-autotest-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selectel%2Fmobile-farm-autotest-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/selectel","download_url":"https://codeload.github.com/selectel/mobile-farm-autotest-example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selectel%2Fmobile-farm-autotest-example/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262264830,"owners_count":23284400,"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","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":"2025-06-27T13:30:24.529Z","updated_at":"2025-06-27T13:30:29.151Z","avatar_url":"https://github.com/selectel.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Android CI Testing Example with Selectel Mobile Farm\nThis project provides an example setup for running automated Android tests using Selectel Mobile Farm, integrated with CI/CD pipelines such as GitHub Actions or GitLab CI. This setup allows you to run tests on real Android devices in the cloud using `Espresso` framework.\n\n# CI/CD Configuration Files\nCI/CD Configuration Files include steps to set up the Android SDK, obtain authentication tokens, and connect to a remote device in Selectel Mobile Farm.  \n\nThis repository includes the following CI configuration files:\n## GitHub Actions\n[ci.yml](./.github/workflows/ci.yml): This file is designed to run Android tests using GitHub Actions.\n## GitLab CI (Optional)\n[.gitlab-ci.yml](./.gitlab-ci.yml): If you are using GitLab CI instead of GitHub Actions, you can use this file.\n\n# Key Considerations\n## Environment variables\nEnsure you have properly set up all of the tokens used inside CI/CD file. These include your service user's `USER_NAME` and `PASSWORD`, `PROJECT_NAME`, `ACCOUNT_NAME`, `DEVICE_SERIAL`.\n## Selectel Authorization Tokens:\n- Mobile Farm supports only Selectel Keystone authorization tokens.\n- Provided tokens are valid for one day. Be careful when exposing tokens inside pipeline.\n- You can always refer to the [docs](https://docs.selectel.ru/api/authorization/) about Selectel authorization if you having any troubles obtaining the X-Auth-Token.\n## ADB keys  \nTo successfully use ADB for remote device connections, you must meet the following requirements:\n\n1. Default Key Pair Location:\nEnsure the ADB key pair is stored in the default location. For example on Ubuntu:\n   - `~/.android/adbkey` - default private key location,\n   - `~/.android/adbkey.pub` - default public key location.\n2. Store Public Key in Mobile Farm:\nThe ADB public key must be uploaded and stored in the Mobile Farm system. Refer to the [Swagger documentation](https://docs.selectel.ru/api/mobile-farm/#tag/ADB-keys/paths/~1api~1v2~1keys~1adb/post) for details required for storing the key.\n3. Unique Public Key:\nEach ADB public key must be unique within the Mobile Farm. Attempting to upload a duplicate key will result in errors.\n4. Device Assignment:\nThe device must be assigned to the user initiating the connection within the Mobile Farm.  Refer to the [Swagger documentation](https://docs.selectel.ru/api/mobile-farm/#tag/User-devices/paths/~1api~1v1~1user~1devices/post) for details required for assigning a device to user.\n5. Remote connection:\nThe device must have it's ADB remote connection session to be started. Refer to the [Swagger documentation](https://docs.selectel.ru/api/mobile-farm/#tag/User-devices/paths/~1api~1v1~1user~1devices~1%7Bserial%7D~1remoteConnect/post) for details required for starting remote connect session.\n## Device Screen State:\nEnsure that the device screen is not locked before running the tests. Ensure that no other activities or pop-ups are blocking the device screen during testing, as this might interfere with the tests.\n## Espresso Testing:\n- Espresso tests do not support the execution of tests in the middle of a user's journey.\n- Ensure your tests follow a clear sequence without interruption.\n## Device Assignment:\nWhen assigning devices, make sure you are using the correct device serial number (provided as an environment variable `DEVICE_SERIAL`) which is present inside the project you specify by an environment variable `PROJECT_NAME`.\n## Remote Device Considerations:\nSince the device is hosted remotely, there may be a slight delay when communicating with the device, especially if the CI runner is geographically distant from the device. During ADB operations, such as adb connect and adb devices, it may take extra time for the command to reach the device and receive a response. This is normal, and you may want to adjust the timeouts in your CI pipeline if you notice delays in the connection or device readiness.\nEnsure that your CI pipeline has sufficient wait times (e.g., sleep 1) between device commands to avoid timing issues related to latency.\n\n## Pipeline customization\nYou can modify CI/CD configuration file by your needs. For example: \n- Use multiple devices.\n- Store ADB keys inside the repository so you won't have to generate them every time during pipeline execution.\n- Add devices to a farm during pipeline execution.\n- For more information checkout our [Swagger documentation](https://docs.selectel.ru/api/mobile-farm/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fselectel%2Fmobile-farm-autotest-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fselectel%2Fmobile-farm-autotest-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fselectel%2Fmobile-farm-autotest-example/lists"}