GitHunt
ST

storenth/android-diceroller

Basic activity app covered with tests using CI/CD practice

android-diceroller

Basic activity app covered with tests using CI/CD practice

First time Android

  • android SDK 34
  • android build tools
  • android emulator
  • google processor APIs

Usage

  • Use ./gradlew connectedAndroidTest to run the tests on a connected emulator or device.
  • Use ./gradlew test to run the unit test on your local host.

Roadmap

  1. Use UI Automator locally
  2. Use UI Automator on CI
  3. BeforTest with build task
  4. BeforTest with prebuilt app

UI tests (Instrumented tests)

Instrumented tests run on Android devices, whether physical or emulated. As such, they can take advantage of the Android framework APIs.
Instrumented tests therefore provide more fidelity than local tests, though they run much more slowly.
UI tests are usually Instrumented tests that verify the correct behavior of the UI.

CI integration

Set up continuous integration
To run tests as part of the build, you need to either configure your continuous integration server to use the
Android Emulator or use Firebase Test Lab to run your tests, so
Gradle Managed Devices or GMD improve consistency, performance, and reliability for your automated instrumented tests. This feature, available for API levels 27 and higher, allows you to configure virtual test devices in your project's Gradle files.
The build system uses the configurations to fully manage—that is, create, deploy, and tear down—those devices when executing your automated tests.
GMD runs with hardware acceleration by default (additional setup needed), but to avoid settings use Automated Test Device (ATD).
[Accept Licence]

./gradlew build
./gradlew pixel3api30DebugAndroidTest
  1. Emulator acceleration
  2. Manifest files
  3. UI Automator article
    UiAutomator does just that, by delivering input events in a way a regular user would, but more consistent.
  4. Write automated tests with UI Automator

Known issues

  1. Unresolved reference after changing SDK versions: File > Invalidate Caches

Languages

Kotlin100.0%

Contributors

MIT License
Created June 10, 2023
Updated August 10, 2023
storenth/android-diceroller | GitHunt