Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Add Espresso UI testing #2317

Closed
Closed

Description

@zugaldia

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.

Activity

  1. added
    Android
    on Sep 14, 2015
  2. added this to the milestone on Sep 14, 2015
  3. zugaldia commented on Sep 14, 2015

    @zugaldia
    MemberAuthor

    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.

  4. zugaldia commented on Sep 15, 2015

    @zugaldia
    MemberAuthor

    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.

  5. bleege commented on Sep 15, 2015

    @bleege
    Contributor

    👍

  6. zugaldia commented on Sep 15, 2015

    @zugaldia
    MemberAuthor

    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.

  7. zugaldia commented on Sep 16, 2015

    @zugaldia
    MemberAuthor

    Screenshots were failing on the actual map because SurfaceView needs 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#L52

    Also, we now have tests for the second activity.

  8. bleege commented on Sep 28, 2015

    @bleege
    Contributor

    Merged as of #2324 .

  9. added 2 commits that reference this issue on Nov 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Android

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions