|
1 | 1 | package org.wordpress.aztec.demo; |
2 | 2 |
|
| 3 | +import android.support.test.espresso.DataInteraction; |
3 | 4 | import android.support.test.espresso.ViewInteraction; |
4 | 5 |
|
| 6 | +import static android.support.test.espresso.Espresso.onData; |
5 | 7 | import static android.support.test.espresso.Espresso.onView; |
6 | 8 | import static android.support.test.espresso.action.ViewActions.click; |
7 | 9 | import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; |
8 | 10 | import static android.support.test.espresso.matcher.ViewMatchers.withId; |
9 | | -import static android.support.test.espresso.matcher.ViewMatchers.withText; |
10 | 11 | import static org.hamcrest.Matchers.allOf; |
| 12 | +import static org.hamcrest.Matchers.hasToString; |
11 | 13 |
|
12 | 14 | /** |
13 | 15 | * Test utilities to be used with instrumentation tests. |
@@ -37,13 +39,13 @@ public class TestUtils { |
37 | 39 | public static ViewInteraction unorderedListButton = onView(withId(R.id.format_bar_button_ul)); |
38 | 40 |
|
39 | 41 | // Heading/Paragraph Format Selectors |
40 | | - public static ViewInteraction headingOneSelector = onView(allOf(withId(android.R.id.title), withText("Heading 1"))); |
41 | | - public static ViewInteraction headingTwoSelector = onView(withText("Heading 2")); |
42 | | - public static ViewInteraction headingThreeSelector = onView(withText("Heading 3")); |
43 | | - public static ViewInteraction headingFourSelector = onView(withText("Heading 4")); |
44 | | - public static ViewInteraction headingFiveSelector = onView(withText("Heading 5")); |
45 | | - public static ViewInteraction headingSixSelector = onView(withText("Heading 6")); |
46 | | - public static ViewInteraction preSelector = onView(withText("Heading 6")); |
| 42 | + public static DataInteraction headingOneSelector = onData(hasToString("Heading 1")); |
| 43 | + public static DataInteraction headingTwoSelector = onData(hasToString("Heading 2")); |
| 44 | + public static DataInteraction headingThreeSelector = onData(hasToString("Heading 3")); |
| 45 | + public static DataInteraction headingFourSelector = onData(hasToString("Heading 4")); |
| 46 | + public static DataInteraction headingFiveSelector = onData(hasToString("Heading 5")); |
| 47 | + public static DataInteraction headingSixSelector = onData(hasToString("Heading 6")); |
| 48 | + public static DataInteraction preSelector = onData(hasToString("Preformat")); |
47 | 49 |
|
48 | 50 | // Link Modal |
49 | 51 | public static ViewInteraction linkOKButton = onView(withId(android.R.id.button1)); |
|
0 commit comments