You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
As discussed with @bleege we're gonna start working on adding Espresso UI testing to the SDK Test App. This will let us simulate user interactions on the TestApp UI to test the SDK and minimize regressions.
Some advantages of Espresso:
Supported by Google as part of the Android Testing Support Library (JUnit 4-compatible).
Supported by Android Studio (you can also run the tests from the command line).
Supported by AWS Device Farm which will give us access to a large list of devices.
Broad API compatibility: Android 2.2 (API level 8) or higher.
Basic Espresso tests are now set up. Dependencies are included in the Gradle file, a simple testSanity() method passes both locally and on AWD Device Farm. Documentation is available in the root folder of the test app.
We now have 25+ Espresso tests working both locally and on AWS. They have a new screenshot utility to be able to keep post-test images for all or certain tests.
I also had time to add pure JUnit tests to target POJO (like some geometry classes) or any other object without Android dependencies. These tests run directly on the JVM and are considerably faster than Espresso to run. README is now updated with these new tests too.
Activity
zugaldia commentedon Sep 14, 2015
Work is on this branch: https://github.com/zugaldia/mapbox-gl-native/tree/2317-espresso
zugaldia commentedon Sep 14, 2015
Basic Espresso tests are now set up. Dependencies are included in the Gradle file, a simple
testSanity()method passes both locally and on AWD Device Farm. Documentation is available in the root folder of the test app.zugaldia commentedon Sep 15, 2015
Now that basic testing is up and running, it's now time to write some tests. I'll explore as well test coverage and screenshots options.
bleege commentedon Sep 15, 2015
👍
zugaldia commentedon Sep 15, 2015
We now have 25+ Espresso tests working both locally and on AWS. They have a new screenshot utility to be able to keep post-test images for all or certain tests.
I also had time to add pure JUnit tests to target POJO (like some
geometryclasses) or any other object without Android dependencies. These tests run directly on the JVM and are considerably faster than Espresso to run. README is now updated with these new tests too.zugaldia commentedon Sep 16, 2015
Screenshots were failing on the actual map because
SurfaceViewneeds extra care to be captured. The code now handles that: https://github.com/zugaldia/mapbox-gl-native/blob/2317-espresso/android/java/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxgl/testapp/utils/ScreenshotUtil.java#L52Also, we now have tests for the second activity.
bleege commentedon Sep 28, 2015
Merged as of #2324 .
mapbox#2317 - README to set up and run Espresso testing
mapbox#2317 - added testing dependencies