当前位置: 首页>>代码示例>>Java>>正文


Java Solo.clickOnButton方法代码示例

本文整理汇总了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();
	}
 
开发者ID:CMPUT301F13T02,项目名称:ChooseYourAdventure,代码行数:29,代码来源:TestViewStoriesActivity.java

示例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;
}
 
开发者ID:sebiva,项目名称:TouchDeck,代码行数:34,代码来源:PileViewMoveTest.java

示例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());
}
 
开发者ID:KoljaTM,项目名称:HoebApp,代码行数:13,代码来源:AcceptEulaTest.java

示例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());
}
 
开发者ID:KoljaTM,项目名称:HoebApp,代码行数:10,代码来源:AcceptEulaTest.java


注:本文中的com.jayway.android.robotium.solo.Solo.clickOnButton方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。