summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/utils/ViewUtils.java
blob: 188e75edc7ae150dd5ab8c30afed4c4125d57735 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package com.mapbox.mapboxsdk.testapp.utils;

import android.support.annotation.IdRes;

import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.action.ViewActions.click;
import static android.support.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
import static android.support.test.espresso.matcher.ViewMatchers.withId;

public class ViewUtils {

    public static void clickView(@IdRes int viewRes) {
        onView(withId(viewRes))
                .perform(click());
    }

    public static void checkViewIsDisplayed(int id) {
        onView(withId(id))
                .check(matches(isDisplayed()));
    }
}