use of android.support.test.espresso.ViewInteraction in project dobby-android by InceptAi.
the class WifiExpertUITests method checkShowingSpeedTestAnalysisState.
private void checkShowingSpeedTestAnalysisState() {
captureScreenshot("speed_test_analysis_state");
ViewInteraction frameLayout2 = onView(withId(R.id.bandwidth_results_cardview));
frameLayout2.check(matches(isDisplayed()));
ViewInteraction textView3 = onView(allOf(withId(R.id.dobbyTextTv), withText(containsString("detail"))));
textView3.check(matches(isDisplayed()));
ViewInteraction button9 = onView(allOf(withText("Yes"), childAtPosition(allOf(withId(R.id.action_menu), childAtPosition(withId(R.id.scrollview_buttons), 0)), 0), isDisplayed()));
button9.check(matches(isDisplayed()));
ViewInteraction button10 = onView(allOf(withText("No"), childAtPosition(allOf(withId(R.id.action_menu), childAtPosition(withId(R.id.scrollview_buttons), 0)), 1), isDisplayed()));
button10.check(matches(isDisplayed()));
}
use of android.support.test.espresso.ViewInteraction in project dobby-android by InceptAi.
the class WifiExpertUITests method checkDecliningFullSpeedTestState.
private void checkDecliningFullSpeedTestState() {
captureScreenshot("declining_speed_test_state");
ViewInteraction textView2 = onView(allOf(withId(R.id.user_text_tv), withText("No"), childAtPosition(childAtPosition(withId(R.id.user_chat_layout), 1), 0), isDisplayed()));
textView2.check(matches(withText("No")));
checkSlowInternetCheckWifiAndRunSpeedTestButtons();
ViewInteraction textView = onView(allOf(withId(R.id.dobbyTextTv), withText("Ok no worries. Let me know if you want to run tests at any time.")));
textView.check(matches(isDisplayed()));
checkSlowInternetCheckWifiAndRunSpeedTestButtons();
}
use of android.support.test.espresso.ViewInteraction in project dobby-android by InceptAi.
the class WifiExpertUITests method checkDetailsButton.
private void checkDetailsButton(int positionInScrollView) {
ViewInteraction button = onView(allOf(withText("Details"), childAtPosition(allOf(ViewMatchers.withId(R.id.action_menu), childAtPosition(withId(R.id.scrollview_buttons), 0)), positionInScrollView), isDisplayed()));
button.check(matches(isDisplayed()));
}
use of android.support.test.espresso.ViewInteraction in project appium-espresso-driver by appium.
the class Finder method findBy.
///Find By different strategies
private ViewInteraction findBy(Strategy strategy, String selector) throws InvalidStrategyException {
ViewInteraction matcher;
switch(strategy) {
case // with ID
ID:
// find id from target context
Context context = InstrumentationRegistry.getTargetContext();
int id = context.getResources().getIdentifier(selector, "Id", InstrumentationRegistry.getTargetContext().getPackageName());
matcher = onView(withId(id));
break;
case CLASS_NAME:
// with class name
// TODO: improve this finder with instanceOf
matcher = onView(withClassName(endsWith(selector)));
break;
case TEXT:
// with text
matcher = onView(withText(selector));
break;
case ACCESSIBILITY_ID:
// with content description
matcher = onView(withContentDescription(selector));
break;
default:
throw new InvalidStrategyException("Strategy is not implemented: " + strategy.getStrategyName());
}
return matcher;
}
use of android.support.test.espresso.ViewInteraction in project appium-espresso-driver by appium.
the class ScrollTo method handle.
@Override
@Nullable
public Void handle(ScrollToParams params) throws AppiumException {
try {
ViewInteraction viewInteraction = onView(withText(params.getText()));
viewInteraction.perform(scrollTo());
} catch (NoMatchingViewException e) {
throw new NoSuchElementException("Could not find element with text " + params.getText());
}
return null;
}
Aggregations