Skip to content

Commit

Permalink
Filename
Browse files Browse the repository at this point in the history
  • Loading branch information
hannesa2 committed Nov 14, 2022
1 parent 4b3ec86 commit 3a47fb8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions sample/src/androidTest/java/com/sample/app/ADTTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ import java.io.IOException
@RunWith(AndroidJUnit4::class)
class ADTTest {

// a handy JUnit rule that stores the method name, so it can be used to generate unique
// screenshot files per test method
// a handy JUnit rule that stores the method name, so it can be used to generate unique screenshot files per test method
@get:Rule
var nameRule = TestName()

Expand Down Expand Up @@ -70,15 +69,15 @@ class ADTTest {
fun changeTextSameActivity() {
Espresso.onView(ViewMatchers.isRoot())
.captureToBitmap()
.writeToTestStorage("${javaClass.simpleName}_${nameRule.methodName} Start")
.writeToTestStorage("${javaClass.simpleName}_${nameRule.methodName}-Start")
// Type text and then press the button.
onView(ViewMatchers.withId(R.id.editTextUserInput)).perform(ViewActions.typeText(STRING_TO_BE_TYPED), ViewActions.closeSoftKeyboard())
onView(ViewMatchers.withId(R.id.changeTextBt)).perform(ViewActions.click())
// Check that the text was changed.
onView(ViewMatchers.withId(R.id.textToBeChanged)).check(matches(ViewMatchers.withText(STRING_TO_BE_TYPED)))
Espresso.onView(ViewMatchers.isRoot())
.captureToBitmap()
.writeToTestStorage("${javaClass.simpleName}_${nameRule.methodName} End")
.writeToTestStorage("${javaClass.simpleName}_${nameRule.methodName}-End")
}

companion object {
Expand Down

0 comments on commit 3a47fb8

Please sign in to comment.