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


Java Solo类代码示例

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

示例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);
}
 
开发者ID:jrconlin,项目名称:mc_backup,代码行数:17,代码来源:AboutHomeComponent.java

示例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));
}
 
开发者ID:Prosjekt2-09arduino,项目名称:ArduinoStore,代码行数:17,代码来源:SearchTest.java

示例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);
}
 
开发者ID:sahan,项目名称:Travis-Jr,代码行数:19,代码来源:ReposActivityOrganizationTest.java

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

示例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);
}
 
开发者ID:hyperion70,项目名称:android_device_MTS_x2605,代码行数:35,代码来源:FmRadioActivityTest.java

示例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);
    }
 
开发者ID:hyperion70,项目名称:android_device_MTS_x2605,代码行数:29,代码来源:FmRadioPerformanceTest.java

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

示例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);
}
 
开发者ID:active-citizen,项目名称:android.java,代码行数:12,代码来源:AuthActivityTest.java

示例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);
    }
}
 
开发者ID:jrconlin,项目名称:mc_backup,代码行数:8,代码来源:BaseTest.java

示例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;
}
 
开发者ID:jrconlin,项目名称:mc_backup,代码行数:14,代码来源:ToolbarComponent.java

示例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;
}
 
开发者ID:jrconlin,项目名称:mc_backup,代码行数:8,代码来源:AppMenuComponent.java

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

示例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"));
}
 
开发者ID:vurpo,项目名称:Juttele,代码行数:20,代码来源:ConnectionScenarios.java

示例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);
}
 
开发者ID:naver,项目名称:android-utilset,代码行数:9,代码来源:CipherUtilsTestCase.java


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