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


Java Intents.release方法代码示例

本文整理汇总了Java中android.support.test.espresso.intent.Intents.release方法的典型用法代码示例。如果您正苦于以下问题:Java Intents.release方法的具体用法?Java Intents.release怎么用?Java Intents.release使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.support.test.espresso.intent.Intents的用法示例。


在下文中一共展示了Intents.release方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: startNewLocalConnection

import android.support.test.espresso.intent.Intents; //导入方法依赖的package包/类
private void startNewLocalConnection(String name) {
	onView(withId(R.id.add_host_button)).perform(click());
	onView(withId(R.id.protocol_text)).perform(click());
	onView(withText("local")).perform(click());
	onView(withId(R.id.quickconnect_field)).perform(typeText(name));
	onView(withId(R.id.save)).perform(click());

	Intents.init();
	try {
		onView(withId(R.id.list)).perform(actionOnHolderItem(
				withHostNickname(name), click()));
		intended(hasComponent(ConsoleActivity.class.getName()));
	} finally {
		Intents.release();
	}

	onView(withId(R.id.console_flip)).check(matches(
			hasDescendant(allOf(isDisplayed(), withId(R.id.terminal_view)))));
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:20,代码来源:StartupTest.java

示例2: checkActivityOnViewClicked

import android.support.test.espresso.intent.Intents; //导入方法依赖的package包/类
/**
 * Check if the activity is changed when any view is clicked.
 *
 * @param context          instance of the caller.
 * @param viewId           id of the view.
 * @param nextActivityName Name of the next activity.
 */
public static void checkActivityOnViewClicked(Context context,
                                              int viewId,
                                              String nextActivityName) {
    Intents.init();

    //set intent package
    intending(toPackage(context.getString(R.string.package_name)));

    // Perform click operation on FAB
    onView(withId(viewId)).perform(click());

    // Assert that if the opened activity is Quiz activity.
    intended(hasComponent(nextActivityName));

    Intents.release();
}
 
开发者ID:kevalpatel2106,项目名称:smart-lens,代码行数:24,代码来源:IntentTestUtils.java

示例3: shouldLoadUsersAndTriggerIntent

import android.support.test.espresso.intent.Intents; //导入方法依赖的package包/类
@Test
public void shouldLoadUsersAndTriggerIntent() {
    serverRule
            .enqueueGET(200, "users.json")
            .assertPathIs("/2.2/users")
            .assertHasQuery("order", "desc")
            .assertHasQuery("sort", "reputation")
            .assertHasQuery("site", "stackoverflow");

    Intents.init();
    activityRule.launchActivity(new Intent(Intent.ACTION_MAIN));

    onView(withId(R.id.recyclerView))
            .perform(scrollToPosition(3));

    TestUtils.rotateScreen(activityRule);

    onView(withId(R.id.recyclerView))
            .perform(actionOnItemAtPosition(2, click()));

    intended(allOf(
            hasAction(Intent.ACTION_VIEW),
            hasData(Uri.parse("http://stackoverflow.com/users/157882/balusc"))
    ));
    Intents.release();
}
 
开发者ID:rafaeltoledo,项目名称:android-keep-testing,代码行数:27,代码来源:HomeActivityTest.java

示例4: testTapItem

import android.support.test.espresso.intent.Intents; //导入方法依赖的package包/类
public void testTapItem() {
    Intents.init();
    addInitialData();

    pause();

    // DO UI INTERACTION
    onView(withId(R.id.recycler)).perform(RecyclerViewActions.actionOnItemAtPosition(1, click
            ()));

    pause();

    // Confirm that the TodoListActivity was started!
    intended(hasComponent(TodoListActivity.class.getName()));
    Intents.release();
}
 
开发者ID:vanadium-archive,项目名称:todos,代码行数:17,代码来源:MainActivityTest.java

示例5: destroy

import android.support.test.espresso.intent.Intents; //导入方法依赖的package包/类
@After
public void destroy() {
    Intents.release();
    try {
        BlockChain.getInstance(null).disconnect();
    } catch (Exception e) {
        e.printStackTrace();
    }
    activity.finish();
}
 
开发者ID:digital-voting-pass,项目名称:polling-station-app,代码行数:11,代码来源:ElectionChoiceActivityTest.java

示例6: destroy

import android.support.test.espresso.intent.Intents; //导入方法依赖的package包/类
@After
public void destroy() {
    Intents.release();
    try {
        BlockChain.getInstance(null).disconnect();
    } catch (Exception e) {
        e.printStackTrace();
    }
    resultActivity.finish();
}
 
开发者ID:digital-voting-pass,项目名称:polling-station-app,代码行数:11,代码来源:TestResultActivity.java

示例7: destroy

import android.support.test.espresso.intent.Intents; //导入方法依赖的package包/类
@After
public void destroy() {
    Intents.release();
    try {
        BlockChain.getInstance(null).disconnect();
    } catch (Exception e) {
        e.printStackTrace();
    }
    electionActivity.finish();
}
 
开发者ID:digital-voting-pass,项目名称:polling-station-app,代码行数:11,代码来源:TestElectionChoice.java

示例8: tearDown

import android.support.test.espresso.intent.Intents; //导入方法依赖的package包/类
@After
public void tearDown() {
    Intents.release();

    if (mIdlingResource != null) {
        IdlingRegistry.getInstance().unregister(mIdlingResource);
    }
}
 
开发者ID:CMPUT301F17T13,项目名称:cat-is-a-dog,代码行数:9,代码来源:AuthTest.java

示例9: onFinishTest

import android.support.test.espresso.intent.Intents; //导入方法依赖的package包/类
@OnFinishTest()
public void onFinishTest(String featureName, String scenarioName) {
    getInstrumentation().waitForIdleSync();

    if (LoginScreen.ActivityInstance != null) {

        if (Build.VERSION.SDK_INT > 20) {
            LoginScreen.ActivityInstance.finishAndRemoveTask();
        }
    }

    Intents.release();
}
 
开发者ID:andrewjc,项目名称:kheera-testrunner-android,代码行数:14,代码来源:LoginPageFeatureFile.java

示例10: apply

import android.support.test.espresso.intent.Intents; //导入方法依赖的package包/类
@Override
public Statement apply(final Statement base, Description description) {
	return new Statement() {
		@Override
		public void evaluate() throws Throwable {
			try {
				Intents.init();
				base.evaluate();
			} catch (Exception e) {
				Intents.release();
			}
		}
	};
}
 
开发者ID:ByteWelder,项目名称:Spork,代码行数:15,代码来源:ImmediateIntentsTestRule.java

示例11: after

import android.support.test.espresso.intent.Intents; //导入方法依赖的package包/类
@SuppressWarnings("UnusedParameters")
@After
public static void after(Scenario scenario) {
    ActivityUtils.finishOpenActivities();
    Intents.release();
}
 
开发者ID:zawadz88,项目名称:material-activity-chooser,代码行数:7,代码来源:SampleListStepDefinitions.java

示例12: loginWithRightCredentials

import android.support.test.espresso.intent.Intents; //导入方法依赖的package包/类
@Test
public void loginWithRightCredentials(){
    Intents.init();

    onView(withId(org.hisp.dhis.android.sdk.R.id.server_url)).perform(replaceText(SDKTestUtils.HNQIS_DEV_CI));
    onView(withId(org.hisp.dhis.android.sdk.R.id.username)).perform(replaceText(SDKTestUtils.TEST_USERNAME_WITH_PERMISSION));
    onView(withId(org.hisp.dhis.android.sdk.R.id.password)).perform(replaceText(SDKTestUtils.TEST_PASSWORD_WITH_PERMISSION));
    onView(withId(org.hisp.dhis.android.sdk.R.id.login_button)).perform(click());

    intended(hasComponent(ProgressActivity.class.getName()));

    //Waiting for pull to finish in order to clear the state of the app
    waitForPull(DEFAULT_WAIT_FOR_PULL);
    Intents.release();
}
 
开发者ID:EyeSeeTea,项目名称:EDSApp,代码行数:16,代码来源:LoginTest.java

示例13: after

import android.support.test.espresso.intent.Intents; //导入方法依赖的package包/类
@After
public void after() {
    // Release intents
    Intents.release();

    // Idling resource
    if (mUploadIdlingResource != null) {
        Espresso.unregisterIdlingResources(mUploadIdlingResource);
    }
}
 
开发者ID:firebase,项目名称:quickstart-android,代码行数:11,代码来源:MainActivityTest.java

示例14: tearDown

import android.support.test.espresso.intent.Intents; //导入方法依赖的package包/类
@After
public void tearDown() throws Exception {
    Intents.release();
    if (idlingResource != null) {
        Espresso.unregisterIdlingResources(idlingResource);
    }
    RepositoryProvider.provideKeyValueStorage().clear();
    Realm.getDefaultInstance().executeTransaction(realm -> realm.deleteAll());
}
 
开发者ID:ArturVasilov,项目名称:AndroidSchool,代码行数:10,代码来源:RepositoriesActivityTest.java

示例15: wipeDataOnLogout

import android.support.test.espresso.intent.Intents; //导入方法依赖的package包/类
@Test
public void wipeDataOnLogout(){
    //Given
    Intents.init();

    onView(withId(org.hisp.dhis.android.sdk.R.id.server_url)).perform(replaceText(SDKTestUtils.HNQIS_DEV_CI));
    onView(withId(org.hisp.dhis.android.sdk.R.id.username)).perform(replaceText(SDKTestUtils.TEST_USERNAME_WITH_PERMISSION));
    onView(withId(org.hisp.dhis.android.sdk.R.id.password)).perform(replaceText(SDKTestUtils.TEST_PASSWORD_WITH_PERMISSION));
    onView(withId(org.hisp.dhis.android.sdk.R.id.login_button)).perform(click());

    intended(hasComponent(ProgressActivity.class.getName()));

    //Waiting for pull to finish in order to clear the state of the app
    waitForPull(DEFAULT_WAIT_FOR_PULL);

    //When
    SDKTestUtils.goToLogin();

    //Then

    //Removed sdk data
    assertTrue(EventExtended.count() == 0);
    assertTrue(DataValueExtended.count() == 0);


    //removed app data
    assertTrue(Survey.count() == 0);
    assertTrue(Value.count() == 0);

    Intents.release();
}
 
开发者ID:EyeSeeTea,项目名称:EDSApp,代码行数:32,代码来源:WipeDataOnLogout.java


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