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


Java ViewAssertions类代码示例

本文整理汇总了Java中com.google.android.apps.common.testing.ui.espresso.assertion.ViewAssertions的典型用法代码示例。如果您正苦于以下问题:Java ViewAssertions类的具体用法?Java ViewAssertions怎么用?Java ViewAssertions使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ViewAssertions类属于com.google.android.apps.common.testing.ui.espresso.assertion包,在下文中一共展示了ViewAssertions类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testInfoTextViewText_isEmpty

import com.google.android.apps.common.testing.ui.espresso.assertion.ViewAssertions; //导入依赖的package包/类
@MediumTest
public void testInfoTextViewText_isEmpty() {
    // Verify that the mInfoTextView is initialized with the correct default
    // value

    Espresso.onView(ViewMatchers.withId(R.id.info_text_view))
            .check(ViewAssertions.matches(ViewMatchers.withText("")));
}
 
开发者ID:sergiotorresperez,项目名称:AndroidUnitTestsAlternatives,代码行数:9,代码来源:ClickFunActivityTest.java

示例2: testClickMeButton_clickButtonAndExpectInfoText2

import com.google.android.apps.common.testing.ui.espresso.assertion.ViewAssertions; //导入依赖的package包/类
@MediumTest
public void testClickMeButton_clickButtonAndExpectInfoText2() {
    Espresso.onView(ViewMatchers.withId(R.id.launch_next_activity_button))
            .perform(ViewActions.click());

    Espresso.onView(ViewMatchers.withId(R.id.info_text_view))
            .check(ViewAssertions.matches(ViewMatchers.isDisplayed()));

    Espresso.onView(ViewMatchers.withId(R.id.info_text_view))
            .check(ViewAssertions.matches(ViewMatchers.withText(R.string.info_text)));
}
 
开发者ID:sergiotorresperez,项目名称:AndroidUnitTestsAlternatives,代码行数:12,代码来源:ClickFunActivityTest.java

示例3: testLoadingPhotos

import com.google.android.apps.common.testing.ui.espresso.assertion.ViewAssertions; //导入依赖的package包/类
@MediumTest
public void testLoadingPhotos() throws InterruptedException {
    VolleyIdlingResource volleyResources;
    try {
        volleyResources = new VolleyIdlingResource(mActivity, "VolleyCalls");
        Espresso.registerIdlingResources(volleyResources);
    } catch (SecurityException | NoSuchFieldException e) {
        fail(e.getMessage());
    }

    Espresso.onView(ViewMatchers.withId(android.R.id.list))
            .check(ViewAssertions.matches(ViewMatchers.isDisplayed()));
}
 
开发者ID:MostafaGazar,项目名称:soas,代码行数:14,代码来源:PhotosListActivityEspressoTest.java

示例4: testOpenAndCloseDrawer

import com.google.android.apps.common.testing.ui.espresso.assertion.ViewAssertions; //导入依赖的package包/类
@MediumTest
public void testOpenAndCloseDrawer() {
    // Drawer should not be open to start.
    Espresso.onView(ViewMatchers.withId(R.id.drawer)).check(ViewAssertions.matches(DrawerMatchers.isClosed()));

    DrawerActions.openDrawer(R.id.drawer);

    // The drawer should now be open.
    Espresso.onView(ViewMatchers.withId(R.id.drawer)).check(ViewAssertions.matches(DrawerMatchers.isOpen()));

    DrawerActions.closeDrawer(R.id.drawer);

    // Drawer should be closed again.
    Espresso.onView(ViewMatchers.withId(R.id.drawer)).check(ViewAssertions.matches(DrawerMatchers.isClosed()));
}
 
开发者ID:MostafaGazar,项目名称:soas,代码行数:16,代码来源:PhotosListActivityEspressoTest.java

示例5: testClickMeButton_labelText

import com.google.android.apps.common.testing.ui.espresso.assertion.ViewAssertions; //导入依赖的package包/类
@MediumTest
public void testClickMeButton_labelText() {
    Espresso.onView(ViewMatchers.withId(R.id.launch_next_activity_button))
            .check(ViewAssertions.matches(ViewMatchers.withText(R.string.label_click_me)));
}
 
开发者ID:sergiotorresperez,项目名称:AndroidUnitTestsAlternatives,代码行数:6,代码来源:ClickFunActivityTest.java

示例6: testMyFirstTestTextView_labelText

import com.google.android.apps.common.testing.ui.espresso.assertion.ViewAssertions; //导入依赖的package包/类
/**
 * Tests the correctness of the initial text.
 */
public void testMyFirstTestTextView_labelText() {
    Espresso.onView(ViewMatchers.withId(R.id.my_first_test_text_view))
            .check(ViewAssertions.matches(ViewMatchers.withText(R.string.my_first_test)));
}
 
开发者ID:sergiotorresperez,项目名称:AndroidUnitTestsAlternatives,代码行数:8,代码来源:MyFirstTestActivityTest.java

示例7: testPreconditions

import com.google.android.apps.common.testing.ui.espresso.assertion.ViewAssertions; //导入依赖的package包/类
public void testPreconditions() {
    Espresso.onView(ViewMatchers.withId(R.id.celsius_label)).check(ViewAssertions.matches(isDisplayed()));
}
 
开发者ID:filipmaelbrancke,项目名称:devoxxuk-2014-android-app-dev,代码行数:4,代码来源:EspressoTests.java

示例8: testCheckingLabels

import com.google.android.apps.common.testing.ui.espresso.assertion.ViewAssertions; //导入依赖的package包/类
public void testCheckingLabels() {
    Espresso.onView(ViewMatchers.withId(R.id.celsius_label))
            .check(ViewAssertions.matches(ViewMatchers.withText("Celsius")));
}
 
开发者ID:filipmaelbrancke,项目名称:devoxxuk-2014-android-app-dev,代码行数:5,代码来源:EspressoTests.java


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