新建Activity单元测试类
===============
package com.devilwwj.unittestdemo;
import android.content.Intent;
import android.test.ActivityUnitTestCase;
import android.test.suitebuilder.annotation.MediumTest;
import android.widget.Button;
/**
- Created by wwj_748 on 2016/2/22.17.12
*/
public class LoginActivityTest extends ActivityUnitTestCase {
private Intent mLoginIntent;
// 要这样才不会报错
public LoginActivityTest() {
super(LoginActivity.class);
}
@Override
protected void setUp() throws Exception {
super.setUp();
mLoginIntent = new Intent(getInstrumentation().getTargetContext(), LoginActivity.class);
}
@MediumTest
public void testLoginButton_labelTest() {
startActivity(mLoginIntent, null, null);
fina
版权归原作者 Java极客1024 所有, 如有侵权,请联系我们删除。