JUnit4 - AssertionFailedError: No tests found

后端 未结 1 1060
心在旅途
心在旅途 2021-02-05 01:29

I\'m using AndroidJUnitRunner with Espresso.

I wrote a simple test but always receive this exception. According to Stackoverflow answers, the problem is messing up the J

1条回答
  •  再見小時候
    2021-02-05 02:00

    I found the problem. It was missed code in build.gradle in the main module. If you have this problem I advise to start with adding this line:

    android {
        ...
    
        defaultConfig {
            ...
    
            testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
        }
    ...
    }
    

    0 讨论(0)
提交回复
热议问题