本文整理汇总了Java中com.jayway.android.robotium.solo.Solo类的典型用法代码示例。如果您正苦于以下问题:Java Solo类的具体用法?Java Solo怎么用?Java Solo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Solo类属于com.jayway.android.robotium.solo包,在下文中一共展示了Solo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialRel
import com.jayway.android.robotium.solo.Solo; //导入依赖的package包/类
public void initialRel() {
mFmRadioActivity = (FmRadioActivity) mSolo.getCurrentActivity();
mSolo = new Solo(mInstrumentation, mFmRadioActivity);
mContext = mFmRadioActivity.getApplicationContext();
assertNotNull(mFmRadioActivity);
mButtonPrevStation = (ImageButton) mFmRadioActivity.findViewById(R.id.button_prevstation);
mButtonNextStation = (ImageButton) mFmRadioActivity.findViewById(R.id.button_nextstation);
mButtonDecrease = (ImageButton) mFmRadioActivity.findViewById(R.id.button_decrease);
mButtonIncrease = (ImageButton) mFmRadioActivity.findViewById(R.id.button_increase);
mButtonAddToFavorite = (ImageButton) mFmRadioActivity
.findViewById(R.id.button_add_to_favorite);
mTextViewFrequency = (TextView) mFmRadioActivity
.findViewById(R.id.station_value);
}
示例2: swipeToPanel
import com.jayway.android.robotium.solo.Solo; //导入依赖的package包/类
private void swipeToPanel(final int panelDirection) {
fAssertTrue("Swiping in a valid direction",
panelDirection == Solo.LEFT || panelDirection == Solo.RIGHT);
assertVisible();
final int panelIndex = getHomePagerView().getCurrentItem();
mSolo.scrollViewToSide(getHomePagerView(), panelDirection, SWIPE_PERCENTAGE);
// The panel on the left is a lower index and vice versa.
final int unboundedPanelIndex = panelIndex + (panelDirection == Solo.LEFT ? -1 : 1);
final int maxPanelIndex = PANEL_ORDERING.size() - 1;
final int expectedPanelIndex = Math.min(Math.max(0, unboundedPanelIndex), maxPanelIndex);
waitForPanelIndex(expectedPanelIndex);
}
示例3: testFailedSearch
import com.jayway.android.robotium.solo.Solo; //导入依赖的package包/类
public void testFailedSearch(){
solo.clickOnActionBarItem(R.id.menu_search);
String query = "aeorohiergiouegriuegriuregqioherghoegr";
solo.enterText(0, query);
solo.sendKey(Solo.ENTER);
try {
Thread.sleep(3505);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
Log.e("Wait", "Error when waiting in testFailedSearch");
}
assertFalse(solo.searchText(query));
}
示例4: setUp
import com.jayway.android.robotium.solo.Solo; //导入依赖的package包/类
@Override
public void setUp() throws Exception {
super.setUp();
solo = new Solo(getInstrumentation(), getActivity());
solo.assertCurrentActivity("Not " + AuthenticationActivity.class.getName(), AuthenticationActivity.class);
EditText editTextUsername = (EditText) solo.getView(R.id.username);
solo.clearEditText(editTextUsername);
solo.enterText(editTextUsername, USER);
((CheckBox) solo.getView(R.id.organization)).setChecked(true);
solo.getView(R.id.octocat).performClick();
solo.sleep(2000);
solo.assertCurrentActivity("Not " + ReposActivity.class.getName(), ReposActivity.class);
}
示例5: setUp
import com.jayway.android.robotium.solo.Solo; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
super.setUp();
mSolo = new Solo(getInstrumentation(), getActivity());
mInstrumentation = getInstrumentation();
mFmRadioFavorite = (FmRadioFavorite) getActivity();
mContext = mFmRadioFavorite.getApplicationContext();
}
示例6: setUp
import com.jayway.android.robotium.solo.Solo; //导入依赖的package包/类
@Override
protected void setUp() {
try {
super.setUp();
} catch (Exception e) {
e.printStackTrace();
}
setActivityInitialTouchMode(false);
mInstrumentation = this.getInstrumentation();
assertNotNull(mInstrumentation);
mFmRadioActivity = getActivity();
assertNotNull(mFmRadioActivity);
mSolo = new Solo(getInstrumentation(), mFmRadioActivity);
mContext = mFmRadioActivity.getApplicationContext();
mAudioManager =
(AudioManager) mFmRadioActivity.getSystemService(mContext.AUDIO_SERVICE);
waitForPowerupWithTimeout(TIMEOUT);
//waitForInitedWithTimeout(TIMEOUT);
mButtonDecrease = (ImageButton) mFmRadioActivity.findViewById(R.id.button_decrease);
mButtonPrevStation = (ImageButton) mFmRadioActivity.findViewById(R.id.button_prevstation);
mButtonNextStation = (ImageButton) mFmRadioActivity.findViewById(R.id.button_nextstation);
mButtonIncrease = (ImageButton) mFmRadioActivity.findViewById(R.id.button_increase);
mButtonAddToFavorite = (ImageButton) mFmRadioActivity
.findViewById(R.id.button_add_to_favorite);
mButtonRecord = (ImageButton) mFmRadioActivity.findViewById(R.id.btn_record);
mButtonStop = (ImageButton) mFmRadioActivity.findViewById(R.id.btn_stop);
mButtonPlayback = (ImageButton) mFmRadioActivity.findViewById(R.id.btn_playback);
mTextViewFrequency = (TextView) mFmRadioActivity
.findViewById(R.id.station_value);
}
示例7: setUp
import com.jayway.android.robotium.solo.Solo; //导入依赖的package包/类
@Override
public void setUp() throws Exception {
super.setUp();
Log.i(TAG, "setUp");
setActivityInitialTouchMode(false);
mFmRadioActivity = getActivity();
assertNotNull(mFmRadioActivity);
mInstrumentation = getInstrumentation();
assertNotNull(mInstrumentation);
mSolo = new Solo(getInstrumentation(), mFmRadioActivity);
Context mContext = mFmRadioActivity.getApplicationContext();
mAudioManager = (AudioManager) mFmRadioActivity.getSystemService(mContext.AUDIO_SERVICE);
// Makesure FmRadio is playing and initialed
waitForPowerupWithTimeout(TIMEOUT);
boolean isPlaying = getBooleanFromVariable(mFmRadioActivity, "mIsPlaying");
assertTrue(isPlaying);
waitForInitedWithTimeout(TIMEOUT);
boolean isInited = getBooleanFromVariable(mFmRadioActivity, "mIsServiceBinded");
assertTrue(isInited);
mButtonDecrease = (ImageButton) mFmRadioActivity.findViewById(R.id.button_decrease);
mButtonPrevStation = (ImageButton) mFmRadioActivity.findViewById(R.id.button_prevstation);
mButtonNextStation = (ImageButton) mFmRadioActivity.findViewById(R.id.button_nextstation);
mButtonIncrease = (ImageButton) mFmRadioActivity.findViewById(R.id.button_increase);
// mButtonPlayStop = (ImageButton) mFmRadioActivity.findViewById(R.id.button_play_stop);
mButtonAddToFavorite = (ImageButton) mFmRadioActivity.findViewById(R.id.button_add_to_favorite);
mTextViewFrequency = (TextView) mFmRadioActivity.findViewById(R.id.station_value);
}
示例8: setUp
import com.jayway.android.robotium.solo.Solo; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
super.setUp();
// Intent intent = new Intent();
// intent.putExtra(ProfileActivity.SELECTED_TAB,1);
// setActivityIntent(intent);
solo = new Solo(getInstrumentation(),getActivity());
activity = (ProfileActivity) solo.getCurrentActivity();
}
示例9: setUp
import com.jayway.android.robotium.solo.Solo; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
super.setUp();
Intent intent = new Intent();
intent.putExtra(AuthActivity.SKIP_ACTIVITY, ProfileActivity.class);
intent.putExtra(AuthActivity.PASSED_ACTIVITY, ProfileActivity.class);
setActivityIntent(intent);
solo = new Solo(getInstrumentation(),getActivity());
etLogin = (EditText) solo.getView(R.id.etLogin);
etPassword = (EditText) solo.getView(R.id.etPassword);
}
示例10: rotate
import com.jayway.android.robotium.solo.Solo; //导入依赖的package包/类
public void rotate() {
if (getActivity().getRequestedOrientation () == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) {
mSolo.setActivityOrientation(Solo.PORTRAIT);
} else {
mSolo.setActivityOrientation(Solo.LANDSCAPE);
}
}
示例11: commitEditingMode
import com.jayway.android.robotium.solo.Solo; //导入依赖的package包/类
public ToolbarComponent commitEditingMode() {
assertIsEditing();
WaitHelper.waitForPageLoad(new Runnable() {
@Override
public void run() {
mSolo.sendKey(Solo.ENTER);
}
});
waitForNotEditing();
return this;
}
示例12: getString
import com.jayway.android.robotium.solo.Solo; //导入依赖的package包/类
public String getString(final Solo solo) {
if (stringResource == null) {
stringResource = solo.getString(resourceID);
}
return stringResource;
}
示例13: openAppMenu
import com.jayway.android.robotium.solo.Solo; //导入依赖的package包/类
private void openAppMenu() {
assertMenuIsNotOpen();
// This is a hack needed for tablets where the OverflowMenuButton is always in the GONE state,
// so we press the menu key instead.
if (HardwareUtils.hasMenuButton() || DeviceHelper.isTablet()) {
mSolo.sendKey(Solo.MENU);
} else {
pressOverflowMenuButton();
}
waitForMenuOpen();
}
示例14: testJoiningChannel
import com.jayway.android.robotium.solo.Solo; //导入依赖的package包/类
/**
* Scenario: Join a channel
*
* - Connect to server
* - Enter command: /j #yaaic-test
* - A new conversation with text #yaaic-test appears
* - Disconnect
*/
public void testJoiningChannel()
{
// Join channel
solo.enterText(0, "/j #yaaic-test");
solo.sendKey(Solo.ENTER);
solo.sleep(1500);
// Assert channel joined
assertTrue(solo.searchText("#yaaic-test"));
}
示例15: setUp
import com.jayway.android.robotium.solo.Solo; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
// TODO Auto-generated method stub
super.setUp();
activity = getActivity();
solo = new Solo(getInstrumentation(), activity);
}