use of android.support.test.espresso.ViewInteraction in project boxing by Bilibili.
the class PickerFragmentTest method showMedia.
@Test
public void showMedia() {
ViewInteraction container = onView(withId(R.id.container));
container.check(new ViewAssertion() {
@Override
public void check(View view, NoMatchingViewException noViewFoundException) {
assertNotNull(view);
assertTrue(view.getVisibility() == View.VISIBLE);
}
});
ViewInteraction empty = onView(withId(R.id.empty_txt));
empty.check(new ViewAssertion() {
@Override
public void check(View view, NoMatchingViewException noViewFoundException) {
assertNotNull(view);
}
});
}
use of android.support.test.espresso.ViewInteraction in project ChipsLayoutManager by BelooS.
the class FewChipsRowTest method deleteItemInTheFirstLine_ItemHasMaximumHeight_SameStartPadding.
@Test
public void deleteItemInTheFirstLine_ItemHasMaximumHeight_SameStartPadding() throws Exception {
//arrange
//just adapt input items list to required start values
items.remove(1);
activity.runOnUiThread(() -> activity.initialize());
ViewInteraction recyclerView = onView(withId(R.id.rvTest)).check(matches(isDisplayed()));
InstrumentalUtil.waitForIdle();
View second = layoutManager.getChildAt(1);
int startHeight = second.getHeight();
double expectedY = second.getY();
//act
recyclerView.perform(actionDelegate(((uiController, view) -> items.remove(1))), notifyItemRemovedAction(1));
InstrumentalUtil.waitForIdle();
second = layoutManager.getChildAt(1);
int endHeight = second.getHeight();
double resultY = second.getY();
//assert
//check test behaviour
assumeTrue(startHeight > endHeight);
assertNotEquals(0, expectedY, 0.01);
assertNotEquals(0, resultY, 0.01);
assertEquals(resultY, expectedY, 0.01);
}
use of android.support.test.espresso.ViewInteraction in project dobby-android by InceptAi.
the class WifiExpertUITests method wifiExpertRunWifiAnalysisOnly.
@Test
public void wifiExpertRunWifiAnalysisOnly() {
// Added a sleep statement to match the app's execution delay.
// The recommended way to handle such scenarios is to use Espresso idling resources:
// https://google.github.io/android-testing-support-library/docs/espresso/idling-resource/index.html
Utils.safeSleep(5000);
checkIdleState(true);
//Press slow internet
ViewInteraction button4 = onView(allOf(withText("Slow internet"), withParent(allOf(withId(R.id.action_menu), withParent(withId(R.id.scrollview_buttons))))));
button4.perform(scrollTo(), click());
Utils.safeSleep(2000);
checkShowingWifiAnalysisState();
//Press yes for running full tests
ViewInteraction button7 = onView(allOf(withText("No"), withParent(allOf(withId(R.id.action_menu), withParent(withId(R.id.scrollview_buttons))))));
button7.perform(scrollTo(), click());
Utils.safeSleep(1000);
checkDecliningFullSpeedTestState();
}
use of android.support.test.espresso.ViewInteraction in project dobby-android by InceptAi.
the class WifiExpertUITests method checkShowingWifiAnalysisState.
private void checkShowingWifiAnalysisState() {
captureScreenshot("wifi_analysis_state");
ViewInteraction frameLayout = onView(withId(R.id.net_cardview));
frameLayout.check(matches(isDisplayed()));
ViewInteraction textView2 = onView(allOf(withId(R.id.dobbyTextTv), withText(containsString("You are"))));
textView2.check(matches(withText(containsString("You are connected and online via wifi network:"))));
textView2.check(matches(isDisplayed()));
ViewInteraction button5 = onView(allOf(withText("Yes"), childAtPosition(allOf(withId(R.id.action_menu), childAtPosition(withId(R.id.scrollview_buttons), 0)), 0), isDisplayed()));
button5.check(matches(isDisplayed()));
ViewInteraction button6 = onView(allOf(withText("No"), childAtPosition(allOf(withId(R.id.action_menu), childAtPosition(withId(R.id.scrollview_buttons), 0)), 1), isDisplayed()));
button6.check(matches(isDisplayed()));
}
use of android.support.test.espresso.ViewInteraction in project dobby-android by InceptAi.
the class WifiExpertUITests method checkShowingDetailedSuggestionState.
private void checkShowingDetailedSuggestionState() {
captureScreenshot("detailed_suggestion_state");
ViewInteraction frameLayout = onView(withId(R.id.custom));
frameLayout.check(matches(isDisplayed()));
ViewInteraction button4 = onView(withId(R.id.more_suggestions_dismiss_button));
button4.check(matches(isDisplayed()));
ViewInteraction listView = onView(withId(R.id.more_suggest_listview));
listView.check(matches(isDisplayed()));
ViewInteraction textView = onView(withText(containsString("Summary and suggestions")));
textView.check(matches(isDisplayed()));
}
Aggregations