获取junit.framework.AssertionFailedError:com.package.MainActivityTest中未找到测试

时间:2019-06-10 16:57:23

标签: java unit-testing

我尝试运行一个测试,该测试将打开应用程序,然后单击搜索按钮,但是在尝试运行测试时出现错误。错误是 junit.framework.AssertionFailedError:在packagename.MainActivityTest中找不到测试。我在做什么错了?

@RunWith( AndroidJUnit4.class )
@LargeTest
public class MainActivityTest
{

    @Rule
    public ActivityTestRule<MainActivity> mActivityRule = new ActivityTestRule<>(MainActivity.class);

    private Activity mMainActivity;

    @Before
    public void setUp() throws Exception {

}

    @Test
    public void TestOpen() throws Settings.SettingNotFoundException
    {
        Espresso.onView(withId(R.id.action_search)).perform(click());
    }
    @After
    public void tearDown() throws Exception {
    }
}

0 个答案:

没有答案