Java Examples for android.support.test.espresso.matcher.ViewMatchers.isFocusable

The following java examples will help you to understand the usage of android.support.test.espresso.matcher.ViewMatchers.isFocusable. These source code samples are taken from different open source projects.

Example 1
Project: Catroid-master  File: StageTestSimple.java View source code
@Test
public void checkForBlueSpriteColor() {
    createProjectWithBlueSprite("blueProject");
    baseActivityTestRule.launchActivity(null);
    byte[] blue = { 0, (byte) 162, (byte) 232, (byte) 255 };
    //color matcher only accepts a GL20View, this can be aquired by getting the only focusable element in the stage
    onView(isFocusable()).check(matches(StageMatchers.isColorAtPx(blue, 1, 1)));
}
Example 2
Project: WatchTower-master  File: DetailActivityTest.java View source code
@Test
public void testViewBeaconCompleteForm() {
    Beacon beacon = MockModelsUtil.createMockRegisteredBeacon();
    Diagnostics diagnostics = new Diagnostics();
    diagnostics.alerts = new Diagnostics.Alert[0];
    diagnostics.beaconName = "";
    diagnostics.estimatedLowBatteryDate = null;
    when(component.getMockWatchTowerService().beaconDiagnostics(beacon.beaconName)).thenReturn(Observable.just(diagnostics));
    Intent i = new Intent(DetailActivity.getStartIntent(InstrumentationRegistry.getTargetContext(), beacon));
    main.launchActivity(i);
    onView(withId(R.id.text_title_beacon_name)).check(matches(isDisplayed()));
    onView(withId(R.id.edit_text_beacon_name)).check(matches(isDisplayed())).check(matches(not(isFocusable())));
    onView(withId(R.id.text_title_advertised_id)).check(matches(isDisplayed()));
    onView(withId(R.id.edit_text_advertised_id)).check(matches(isDisplayed())).check(matches(not(isFocusable())));
    onView(withId(R.id.text_advertised_id_error_message)).check(matches(not(isDisplayed())));
    onView(withId(R.id.text_title_description)).perform(scrollTo()).check(matches(isDisplayed()));
    onView(withId(R.id.edit_text_description)).perform(scrollTo()).check(matches(isDisplayed())).check(matches(not(isFocusable())));
    onView(withId(R.id.text_title_type)).perform(scrollTo()).check(matches(isDisplayed()));
    onView(withId(R.id.spinner_type)).check(matches(not(isEnabled())));
    onView(withId(R.id.text_title_status)).perform(scrollTo()).check(matches(isDisplayed()));
    onView(withId(R.id.spinner_status)).check(matches(not(isEnabled())));
    onView(withId(R.id.text_status_error_message)).check(matches(not(isDisplayed())));
    onView(withId(R.id.text_title_stability)).perform(scrollTo()).check(matches(isDisplayed()));
    onView(withId(R.id.spinner_stability)).check(matches(not(isEnabled())));
    onView(withId(R.id.text_title_location)).perform(scrollTo()).check(matches(isDisplayed()));
    onView(withId(R.id.edit_text_latitude)).perform(scrollTo()).check(matches(isDisplayed())).check(matches(not(isFocusable())));
    onView(withId(R.id.edit_text_longitude)).perform(scrollTo()).check(matches(isDisplayed())).check(matches(not(isFocusable())));
    onView(withId(R.id.text_title_place_id)).perform(scrollTo()).check(matches(isDisplayed()));
    onView(withId(R.id.edit_text_place_id)).perform(scrollTo()).check(matches(isDisplayed())).check(matches(not(isFocusable())));
}
Example 3
Project: android-topeka-master  File: SignInActivityTest.java View source code
@Test
public void avatar_notFocusable() {
    checkOnAvatar(not(isFocusable()));
}