本文整理匯總了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("")));
}
示例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)));
}
示例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()));
}
示例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()));
}
示例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)));
}
示例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)));
}
示例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()));
}
示例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")));
}