use of androidx.test.espresso.ViewInteraction in project PocketHub by pockethub.
the class CreateGistActivityTest method testCreateWithNoInitialText.
/**
* Create Gist with no initial text
*
* @throws Throwable
*/
@Test
public void testCreateWithNoInitialText() throws Throwable {
activityTestRule.launchActivity(new Intent());
ViewInteraction createMenu = onView(withId(R.id.create_gist));
ViewInteraction content = onView(withId(R.id.et_gist_content));
createMenu.check(ViewAssertions.matches(not(isEnabled())));
content.perform(ViewActions.typeText("gist content"));
createMenu.check(ViewAssertions.matches(isEnabled()));
}
use of androidx.test.espresso.ViewInteraction in project fdroidclient by f-droid.
the class MainActivityEspressoTest method startSwap.
@LargeTest
@Test
public void startSwap() {
if (!BuildConfig.FLAVOR.startsWith("full")) {
return;
}
ViewInteraction nearbyBottonNavButton = onView(allOf(withText(R.string.main_menu__swap_nearby), isDisplayed()));
nearbyBottonNavButton.perform(click());
ViewInteraction findPeopleButton = onView(allOf(withId(R.id.find_people_button), withText(R.string.nearby_splash__find_people_button), isDisplayed()));
findPeopleButton.perform(click());
onView(withText(R.string.swap_send_fdroid)).check(matches(isDisplayed()));
}
use of androidx.test.espresso.ViewInteraction in project fdroidclient by f-droid.
the class MainActivityEspressoTest method showUpdates.
@LargeTest
@Test
public void showUpdates() {
ViewInteraction updatesBottonNavButton = onView(allOf(withText(R.string.main_menu__updates), isDisplayed()));
updatesBottonNavButton.perform(click());
onView(withText(R.string.main_menu__updates)).check(matches(isDisplayed()));
}
use of androidx.test.espresso.ViewInteraction in project BetterBatteryStats by asksven.
the class ShareActivityTestCancel method shareActivityTest.
@Test
public void shareActivityTest() {
// https://google.github.io/android-testing-support-library/docs/espresso/idling-resource/index.html
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
e.printStackTrace();
}
ViewInteraction actionMenuItemView = onView(allOf(withId(R.id.share), withContentDescription("Share"), isDisplayed()));
actionMenuItemView.perform(click());
// https://google.github.io/android-testing-support-library/docs/espresso/idling-resource/index.html
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
e.printStackTrace();
}
ViewInteraction appCompatButton2 = onView(withText("Cancel"));
appCompatButton2.perform(click());
}
use of androidx.test.espresso.ViewInteraction in project quickstart-android by firebase.
the class MainActivityTest method mainActivityTest.
@Test
public void mainActivityTest() {
// Select favorite food if the dialog appears
selectFavoriteFoodIfPossible("Hot Dogs");
// Initial title
checkTitleText(R.string.pattern1_title);
// Swipe, make sure we see the right titles
ViewInteraction viewPager = onView(withId(R.id.viewPager));
viewPager.check(matches(isDisplayed()));
// Swipe left
viewPager.perform(swipeLeft());
checkTitleText(R.string.pattern2_title);
// Swipe left
viewPager.perform(swipeLeft());
checkTitleText(R.string.pattern3_title);
// Swipe back right
viewPager.perform(swipeRight());
checkTitleText(R.string.pattern2_title);
}
Aggregations