diff options
Diffstat (limited to 'espresso/espresso-lib-tests/src/androidTest/java/com/google/android/apps/common/testing/ui/espresso/action/AdapterDataIntegrationTest.java')
-rw-r--r-- | espresso/espresso-lib-tests/src/androidTest/java/com/google/android/apps/common/testing/ui/espresso/action/AdapterDataIntegrationTest.java | 93 |
1 files changed, 0 insertions, 93 deletions
diff --git a/espresso/espresso-lib-tests/src/androidTest/java/com/google/android/apps/common/testing/ui/espresso/action/AdapterDataIntegrationTest.java b/espresso/espresso-lib-tests/src/androidTest/java/com/google/android/apps/common/testing/ui/espresso/action/AdapterDataIntegrationTest.java deleted file mode 100644 index fe37fc5..0000000 --- a/espresso/espresso-lib-tests/src/androidTest/java/com/google/android/apps/common/testing/ui/espresso/action/AdapterDataIntegrationTest.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.android.apps.common.testing.ui.espresso.action; - -import static com.google.android.apps.common.testing.ui.espresso.Espresso.onData; -import static com.google.android.apps.common.testing.ui.espresso.Espresso.onView; -import static com.google.android.apps.common.testing.ui.espresso.action.ViewActions.click; -import static com.google.android.apps.common.testing.ui.espresso.assertion.ViewAssertions.matches; -import static com.google.android.apps.common.testing.ui.espresso.matcher.ViewMatchers.hasSibling; -import static com.google.android.apps.common.testing.ui.espresso.matcher.ViewMatchers.withId; -import static com.google.android.apps.common.testing.ui.espresso.matcher.ViewMatchers.withText; -import static org.hamcrest.Matchers.allOf; -import static org.hamcrest.Matchers.hasEntry; -import static org.hamcrest.Matchers.instanceOf; -import static org.hamcrest.Matchers.is; - -import com.google.android.apps.common.testing.ui.testapp.LongListActivity; -import com.google.android.apps.common.testing.ui.testapp.R; - -import android.test.ActivityInstrumentationTestCase2; -import android.test.suitebuilder.annotation.LargeTest; - -import java.util.Map; - -/** - * Integration tests for operating on data displayed in an adapter. - */ -@LargeTest -public class AdapterDataIntegrationTest extends ActivityInstrumentationTestCase2<LongListActivity> { - @SuppressWarnings("deprecation") - public AdapterDataIntegrationTest() { - // Supporting froyo. - super("com.google.android.apps.common.testing.ui.testapp", LongListActivity.class); - } - - @Override - public void setUp() throws Exception { - super.setUp(); - getActivity(); - } - - @SuppressWarnings("unchecked") - public void testClickAroundList() { - onData(allOf(is(instanceOf(Map.class)), hasEntry(is(LongListActivity.STR), is("item: 99")))) - .perform(click()); - onView(withId(R.id.selection_row_value)) - .check(matches(withText("99"))); - - onData(allOf(is(instanceOf(Map.class)), hasEntry(is(LongListActivity.STR), is("item: 1")))) - .perform(click()); - - onView(withId(R.id.selection_row_value)) - .check(matches(withText("1"))); - - onData(allOf(is(instanceOf(Map.class)))) - .atPosition(20) - .perform(click()); - - onView(withId(R.id.selection_row_value)) - .check(matches(withText("20"))); - - // lets operate on a specific child of a row... - onData(allOf(is(instanceOf(Map.class)), hasEntry(is(LongListActivity.STR), is("item: 50")))) - .onChildView(withId(R.id.item_size)) - .perform(click()) - .check(matches(withText(String.valueOf("item: 50".length())))); - - onView(withId(R.id.selection_row_value)) - .check(matches(withText("50"))); - } - - @SuppressWarnings("unchecked") - public void testSelectItemWithSibling() { - onView(allOf(withText("7"), hasSibling(withText("item: 0")))) - .perform(click()); - onView(withId(R.id.selection_row_value)) - .check(matches(withText("0"))); - } -} |