本文整理汇总了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")));
}