android使用分层架构企业应用(一)(3)
来源:未知 责任编辑:责任编辑 发表时间:2015-03-01 01:33 点击:次
private Solo solo;
public LoginActivityTest() {
super("com.goosun.view", LoginActivity.class);
}
public void setUp() throws Exception {
solo = new Solo(getInstrumentation(), getActivity());
}
public void testLogin() throws Exception {
solo.clearEditText(0);
solo.enterText(0, "admin");
solo.clearEditText(1);
solo.enterText(1, "admin");
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
ImageButton btn = (ImageButton) getActivity().findViewById(
com.tianque.seed.R.id.login_option);
btn.requestFocus();
}
});
solo.clickOnImageButton(0);
Activity f = getInstrumentation().waitForMonitorWithTimeout(
getInstrumentation().addMonitor(MainGrid.class.getName(), null,
false), 9);
assertNotNull(f);
assertEquals(getActivity().getString(R.string.main_grid), solo
.getCurrentActivity().getTitle().toString());
Assert.assertTrue(solo.searchText("泡妞管理系统"));
}
@Override
public void tearDown() throws Exception {
getActivity().finish();
}
}
作者“qnlpkuge”
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>