當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。