xref: /aosp_15_r20/frameworks/base/tests/FlickerTests/README.md (revision d57664e9bc4670b3ecf6748a746a57c557b6bc9e)
1*d57664e9SAndroid Build Coastguard Worker# Flicker Test Library
2*d57664e9SAndroid Build Coastguard Worker
3*d57664e9SAndroid Build Coastguard Worker## Motivation
4*d57664e9SAndroid Build Coastguard WorkerThis set of tests use the flickerlib from `platform_testing/libraries/flicker` to execute a set of common UI transitions to detect discontinuous or unpredictable behavior.
5*d57664e9SAndroid Build Coastguard Worker
6*d57664e9SAndroid Build Coastguard WorkerThe tests are organized in packages according to the transitions they test (e.g., `rotation`, `splitscreen`).
7*d57664e9SAndroid Build Coastguard Worker
8*d57664e9SAndroid Build Coastguard Worker## Adding a Test
9*d57664e9SAndroid Build Coastguard Worker
10*d57664e9SAndroid Build Coastguard WorkerBy default, tests should inherit from `TestBase` and override the variable `transition` (Kotlin) or the function `getTransition()` (Java).
11*d57664e9SAndroid Build Coastguard Worker
12*d57664e9SAndroid Build Coastguard WorkerInheriting from this class ensures the common assertions will be executed, namely:
13*d57664e9SAndroid Build Coastguard Worker
14*d57664e9SAndroid Build Coastguard Worker* all regions on the screen are covered
15*d57664e9SAndroid Build Coastguard Worker* status bar is always visible
16*d57664e9SAndroid Build Coastguard Worker* status bar is at the correct position at the start and end of the transition
17*d57664e9SAndroid Build Coastguard Worker* nav bar is always visible
18*d57664e9SAndroid Build Coastguard Worker* nav bar is at the correct position at the start and end of the transition
19*d57664e9SAndroid Build Coastguard Worker
20*d57664e9SAndroid Build Coastguard WorkerThe default tests can be disabled by overriding the respective methods and including an `@Ignore` annotation.
21*d57664e9SAndroid Build Coastguard Worker
22*d57664e9SAndroid Build Coastguard WorkerFor more examples of how a test looks like check `ChangeAppRotationTest` within the `Rotation` subdirectory.
23*d57664e9SAndroid Build Coastguard Worker
24