pozklundw
pozklundw

Reputation: 525

"Could not launch activity" in espresso test

Here is my full code, when I test following code with "Android Tests", it raise error "Could not launch activity"

//TestPlayer.kt
public class PlayerTest : ActivityInstrumentationTestCase2<Player>(Player::class.java) {
    override fun setUp() {
        super.setUp()
        getActivity()
    }

    fun testPlayer() {
        onView(withId(R.id.player)).perform(doubleClick())
    }
}

I doesn't find any output in android monitor, how to debug it?

Upvotes: 1

Views: 3390

Answers (1)

miensol
miensol

Reputation: 41598

You need to declare Player activity in AndroidManifest.xml like so:

<activity
    android:name=".Player"
    android:theme="@style/AppTheme.NoActionBar">
</activity>

Upvotes: 8

Related Questions