Created
July 10, 2020 17:09
-
-
Save dandvl/d28d79ad5ee373291b8f81b3d4995ca5 to your computer and use it in GitHub Desktop.
UI Test Sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.borrador2 | |
import androidx.recyclerview.widget.RecyclerView | |
import androidx.test.espresso.Espresso.onView | |
import androidx.test.espresso.assertion.ViewAssertions | |
import androidx.test.espresso.contrib.RecyclerViewActions | |
import androidx.test.espresso.matcher.ViewMatchers | |
import androidx.test.espresso.matcher.ViewMatchers.withId | |
import androidx.test.rule.ActivityTestRule | |
import org.junit.Rule | |
import org.junit.Test | |
class ETest { | |
@get:Rule | |
var activity = ActivityTestRule(MainActivity::class.java) | |
@Test | |
fun wasItemLoaded(){ | |
Thread.sleep(1000) | |
onView(withId(R.id.rvPosts)) | |
.perform(RecyclerViewActions.scrollToPosition<RecyclerView.ViewHolder>(2)) | |
onView(ViewMatchers.withText("qui est esse")) | |
.check(ViewAssertions.matches(ViewMatchers.isDisplayed())) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment