Automated test trial
Description
In December 2020, January & february 2021 I (@vincent) worked on a POC to get a way to run automatic test. Every details can be found in Qualification project's wiki
This MR add some UI tests that were designed to be run on a real android device. It also add a "Test suite" which contains every tests, so they can be all run from a single command.
Integrating those tests allow, to make a special build flashed on real device thanks to an automatic test hardware (aka "test station"). The MR for this special build s is bound to android_prebuilts_prebuiltapks!140 (closed)
The tests were very simple in order to be able to be run very quickly.
Considering that:
- this has been written nearly 1 years ago and still not validated
- Work on test stations did not continue further. Consequently the special build aren't used, and those tests are never run.
- The UI has been updated
We should answer those questions:
-
Are the tests still working? -
Should we still merge/consider this merge request?
Test procedures
Those tests are espresso test consequently they should be able to be run through android studio or command line
They should be run on a real device at the moment as emulator isn't ready to run /e/ OS.
From Android studio:
To run an Espresso test, use the Project window on the left side of the Android Studio IDE:
1. Open the desired app module folder and navigate to the test you want to run. The test’s location depends on the location of your instrumentation test root and the package name of the launched activity. The following examples demonstrate where a test would save for the Notes testing app:
If you are using the Android view within the window, navigate to java > com.example.username.appname (androidTest).
If you are using the Project view inside the window, navigate to src > androidTest > java > com.example.username.appname within the module folder.
2. Right-click on the test and click Run ‘testName.’
Alternatively, you can open the test file and right-click on the generated test class or method. Read more about how to run tests on the Test Your App page.
3. In the Select Deployment Target window, choose the device on which you want to run the test. If necessary, create a new Android Virtual Device. Click OK.
Android doc on how to run espresso test
Technical details
Test descriptions:
Test 1 :
- perform a swipe (left to right) to display left panel
- Check that UI's element are present:
- Search's input field
- list of recommanded apps
- Weather widget
- Edit button
Test 2 :
- perform a swipe (left to right) to display left panel
- perform a "tap" on the search's input field
- Check that soft keyboard is displayed
- enter Calendar into the search field
- Check that Calendar is written in the field
- Check that list of suggested app contains only one item
- Check that this single item is the Calendar application (check icon & label)
Check list
-
Self review -
Test procedure explained -
Tested on fresh install -
Tested applied as an update -
License -
Internal documentation -
User documentation