本文整理汇总了Java中com.jayway.android.robotium.solo.Solo.clickOnButton方法的典型用法代码示例。如果您正苦于以下问题:Java Solo.clickOnButton方法的具体用法?Java Solo.clickOnButton怎么用?Java Solo.clickOnButton使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jayway.android.robotium.solo.Solo
的用法示例。
在下文中一共展示了Solo.clickOnButton方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testAddNew
import com.jayway.android.robotium.solo.Solo; //导入方法依赖的package包/类
public void testAddNew() {
Solo solo = new Solo(getInstrumentation(), activity);
getInstrumentation().waitForIdleSync();
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
addNewButton.performClick();
}
});
//Find dialog, and create a new story
assertTrue("Couldn't find dialog", solo.searchText("Create New"));
solo.enterText(0, "Test Story -- SOLO");
solo.clickOnButton("Save");
//Wait for Edit Story Activity to start
ActivityMonitor monitor = new ActivityMonitor(EditStoryActivity.class.getName(), null, false);
getInstrumentation().addMonitor(monitor);
Activity nextActivity = monitor.waitForActivityWithTimeout(5 * 1000);
assertNotNull("Activity was not started", nextActivity);
//Verify state properly set
assertTrue(((ApplicationController)activity.getApplication()).getStoryController().getStory().getTitle().equals("Test Story -- SOLO"));
nextActivity.finish();
}
示例2: setUp
import com.jayway.android.robotium.solo.Solo; //导入方法依赖的package包/类
@Override
public void setUp() throws Exception {
super.setUp();
setActivityInitialTouchMode(false); // Turn off touch mode in the emulator.
// Go through the startscreen
startScreen = getActivity(); // Get the Activity under test, starting it if necessary.
soloStart = new Solo(getInstrumentation(), startScreen);
soloStart.clickOnButton(startScreen.getResources().getString(R.string.create_btn));
// Go through the tableView to a pileView, while creating a new pile
soloStart.waitForActivity(TableView.class);
tableView = (TableView) soloStart.getCurrentActivity();
soloTable = new Solo(getInstrumentation(), tableView);
secondPileName = "MyPile";
secondPilePos = deckPos + 7;
// Create a new pile
soloTable.clickOnView(tableView.findViewById(secondPilePos));
soloTable.enterText(0, secondPileName);
soloTable.clickOnButton("OK");
soloTable.clickOnButton(deckPos);
// Prepare for testing the pileview
soloTable.waitForActivity(PileView.class);
pileView = (PileView) soloTable.getCurrentActivity();
gc = GuiController.getInstance();
deckPos = Constant.MidOfTable;
}
示例3: testDisplayAndAcceptEula
import com.jayway.android.robotium.solo.Solo; //导入方法依赖的package包/类
public void testDisplayAndAcceptEula() throws Exception {
setAcceptedEula(0);
solo = new Solo(getInstrumentation(), getActivity());
assertTrue(solo.searchText("Nutzungsbedingungen"));
solo.clickOnButton("Ja, ich kenne das Risiko");
assertTrue(solo.searchText("HÖB-Fans"));
solo.assertCurrentActivity("should call app info page",
HoebAppActivity_.class);
assertTrue(solo.getCurrentActivity().hasWindowFocus());
assertEquals(HoebAppActivity.EULA_VERSION, getAcceptedEula());
}
示例4: testDisplayAndDeclineEula
import com.jayway.android.robotium.solo.Solo; //导入方法依赖的package包/类
public void testDisplayAndDeclineEula() throws Exception {
setAcceptedEula(0);
solo = new Solo(getInstrumentation(), getActivity());
assertTrue(solo.searchText("Nutzungsbedingungen"));
solo.clickOnButton("Nein, Danke.");
assertFalse(solo.getCurrentActivity().hasWindowFocus());
assertEquals(0, getAcceptedEula());
}