Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to import static android.support.test.espresso.contrib.DrawerMatchers.isOpen;

I am using espresso for testing my android application. When am trying to write test cases for navigation drawer menu am unable to import any of these

import static android.support.test.espresso.contrib.DrawerActions.closeDrawer;
import static android.support.test.espresso.contrib.DrawerActions.openDrawer;
import static android.support.test.espresso.contrib.DrawerMatchers.isClosed;
import static android.support.test.espresso.contrib.DrawerMatchers.isOpen;

So please help me from this

like image 537
venkatesh gowda Avatar asked Dec 01 '22 12:12

venkatesh gowda


1 Answers

You may missing in build.gradle espresso-contribdependencies like below:

androidTestCompile "com.android.support.test.espresso:espresso-core:2.2.2"
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile "com.android.support.test.espresso:espresso-intents:2.2.2"
/**
 * AccessibilityChecks
 * CountingIdlingResource
 * DrawerActions
 * DrawerMatchers
 * PickerActions (Time and Date picker)
 * RecyclerViewActions
 */
androidTestCompile("com.android.support.test.espresso:espresso-contrib:2.2.2") {
    exclude group: 'com.android.support', module: 'appcompat'
    exclude group: 'com.android.support', module: 'support-v4'
    exclude group: 'com.android.support', module: 'support-v7'
    exclude group: 'com.android.support', module: 'design'
    exclude module: 'support-annotations'
    exclude module: 'recyclerview-v7'
}

Hope it will help

like image 162
piotrek1543 Avatar answered Feb 15 '23 07:02

piotrek1543