use of android.support.test.espresso.ViewInteraction in project dobby-android by InceptAi.
the class WifiExpertUITests method checkCancelledTestState.
private void checkCancelledTestState() {
captureScreenshot("cancelled_state");
ViewInteraction textView4 = onView(allOf(withId(R.id.user_text_tv), withText("Cancel"), childAtPosition(childAtPosition(withId(R.id.user_chat_layout), 1), 0), isDisplayed()));
textView4.check(matches(withText("Cancel")));
ViewInteraction textView3 = onView(allOf(withId(R.id.dobbyTextTv), withText("Ok sure. I am cancelling the tests. You can run it anytime by simply typing \"run tests\""), childAtPosition(allOf(withId(R.id.dobbyChatLayout), childAtPosition(withId(R.id.chatRv), 5)), 1), isDisplayed()));
textView3.check(matches(withText("Ok sure. I am cancelling the tests. You can run it anytime by simply typing \"run tests\"")));
checkSlowInternetCheckWifiAndRunSpeedTestButtons();
}
use of android.support.test.espresso.ViewInteraction in project dobby-android by InceptAi.
the class WifiExpertUITests method checkRunningDownloadSpeedTestState.
private void checkRunningDownloadSpeedTestState() {
//Commenting this out to reduce the delay and see if the issues are gone
captureScreenshot("running_download_test_state");
DobbyLog.v("Checking for download guage text value");
onView(allOf(withParent(withId(R.id.cg_download_test)), withId(R.id.gauge_tv), isDisplayed())).check(matches(withText(not(containsString(Utils.ZERO_POINT_ZERO)))));
onView(allOf(withParent(withId(R.id.cg_upload_test)), withId(R.id.gauge_tv), isDisplayed())).check(matches(withText(containsString(Utils.ZERO_POINT_ZERO))));
ViewInteraction linearLayout = onView(allOf(withId(R.id.bw_gauge_ll), childAtPosition(childAtPosition(withId(R.id.placeholder_fl), 0), 0), isDisplayed()));
linearLayout.check(matches(isDisplayed()));
//cancel button
ViewInteraction button3 = onView(allOf(withText("Cancel"), childAtPosition(allOf(withId(R.id.action_menu), childAtPosition(withId(R.id.scrollview_buttons), 0)), 0), isDisplayed()));
button3.check(matches(isDisplayed()));
captureScreenshot("after_checking_running_download_test_state");
}
use of android.support.test.espresso.ViewInteraction in project dobby-android by InceptAi.
the class WifiExpertUITests method checkSlowInternetCheckWifiAndRunSpeedTestButtons.
private void checkSlowInternetCheckWifiAndRunSpeedTestButtons() {
ViewInteraction button = onView(allOf(withText("Slow internet"), childAtPosition(allOf(ViewMatchers.withId(R.id.action_menu), childAtPosition(withId(R.id.scrollview_buttons), 0)), 0), isDisplayed()));
button.check(matches(isDisplayed()));
ViewInteraction button2 = onView(allOf(withText("Run speed test"), childAtPosition(allOf(withId(R.id.action_menu), childAtPosition(withId(R.id.scrollview_buttons), 0)), 1), isDisplayed()));
button2.check(matches(isDisplayed()));
ViewInteraction button3 = onView(allOf(withText("Check wifi"), childAtPosition(allOf(withId(R.id.action_menu), childAtPosition(withId(R.id.scrollview_buttons), 0)), 2), isDisplayed()));
button3.check(matches(isDisplayed()));
}
use of android.support.test.espresso.ViewInteraction in project dobby-android by InceptAi.
the class WifiExpertUITests method checkOneFullRun.
private void checkOneFullRun(boolean initialAppLaunch) {
checkIdleState(initialAppLaunch);
//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("Yes"), withParent(allOf(withId(R.id.action_menu), withParent(withId(R.id.scrollview_buttons))))));
button7.perform(scrollTo(), click());
//Utils.safeSleep(2000);
//checkRunningDownloadSpeedTestState();
Utils.safeSleep(30000);
checkShowingSpeedTestAnalysisState();
//Click yes button
ViewInteraction button11 = onView(allOf(withText("Yes"), withParent(allOf(withId(R.id.action_menu), withParent(withId(R.id.scrollview_buttons))))));
button11.perform(scrollTo(), click());
Utils.safeSleep(2000);
checkShowingDetailedSuggestionState();
ViewInteraction appCompatButton = onView(allOf(withId(R.id.more_suggestions_dismiss_button), withText("DISMISS"), isDisplayed()));
appCompatButton.perform(click());
checkSlowInternetCheckWifiAndRunSpeedTestButtons();
checkDetailsButton(3);
}
use of android.support.test.espresso.ViewInteraction in project chefly_android by chef-ly.
the class RecipeDetailTest method recipeDetailTest.
@Test
public void recipeDetailTest() {
ViewInteraction appCompatButton = onView(allOf(withId(R.id.skipBtn), withText("Skip"), isDisplayed()));
appCompatButton.perform(click());
// https://google.github.io/android-testing-support-library/docs/espresso/idling-resource/index.html
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
ViewInteraction appCompatTextView = onView(allOf(withId(R.id.continueAsGuest), withText("Skip"), withParent(allOf(withId(R.id.activity_main), withParent(withId(android.R.id.content)))), isDisplayed()));
appCompatTextView.perform(click());
// https://google.github.io/android-testing-support-library/docs/espresso/idling-resource/index.html
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
e.printStackTrace();
}
ViewInteraction relativeLayout = onView(allOf(childAtPosition(withId(R.id.list), 0), isDisplayed()));
relativeLayout.perform(click());
// https://google.github.io/android-testing-support-library/docs/espresso/idling-resource/index.html
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
ViewInteraction appCompatImageButton = onView(withId(R.id.directionsDropdown));
appCompatImageButton.perform(scrollTo(), click());
}
Aggregations