Skip to content

Commit

Permalink
change to activity test rule
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiomartins8 committed Jan 11, 2024
1 parent 73a1bb8 commit 71d2680
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package com.onfido.evergreen

import android.content.Intent
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.ext.junit.rules.ActivityScenarioRule
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
import androidx.test.rule.ActivityTestRule
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
Expand All @@ -16,10 +17,11 @@ import org.junit.runner.RunWith
class OpenAppTest {

@get:Rule
val activityScenarioRule = ActivityScenarioRule(MainActivity::class.java)
val activityScenarioRule = ActivityTestRule(MainActivity::class.java)

@Test
fun openApp() {
activityScenarioRule.launchActivity(Intent())
onView(withId(R.id.webview)).check(matches(isDisplayed()))
}
}

0 comments on commit 71d2680

Please sign in to comment.