Skip to content
This repository has been archived by the owner on Jul 3, 2023. It is now read-only.

Bug reproduction project to demonstrate an issue with espresso multi-activity tests on robolectric

Notifications You must be signed in to change notification settings

libon/RobolectricMultipleActivityTestIssue

Repository files navigation

Sample project to demonstrate multi-activity espresso/robolectric issue

This project provides an app with two screens:

  • MainActivity: contains a button which when clicked, opens SecondScreenActivity
  • SecondScreenActivity: contains a text which says "You're in screen 2"

The project contains an espresso test which:

  • Launches MainActivity with the ActivityScenario api.
  • Taps on the button
  • Verifies that the text "You're in screen 2" appears.

The espresso test passes when run on an emulator or device: ./gradlew cAT

The espresso test fails when run on the jvm/robolectric: ./gradlew testDebugUnitTest:

androidx.test.espresso.NoMatchingViewException: No views in hierarchy found matching: with id: com.example.multipleactivitytest:id/text2

About

Bug reproduction project to demonstrate an issue with espresso multi-activity tests on robolectric

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages