* With the new AndroidJUnit runner you can run both JUnit3 and JUnit4 tests in a single test * test suite. The {@link AndroidRunnerBuilder} which extends JUnit's {@link * AllDefaultPossibilitiesBuilder} will create a single {@link TestSuite} from all tests and run * them. *
* ActivityInstrumentationTestCase2 will be deprecated soon. Please use {@link ActivityTestRule} * when writing new tests. For an example on how to use {@link ActivityTestRule} please see * {@link CalculatorInstrumentationTest}. */ @LargeTest public class OperationHintLegacyInstrumentationTest extends ActivityInstrumentationTestCase2 { private CalculatorActivity mActivity; public OperationHintLegacyInstrumentationTest() { super(CalculatorActivity.class); } @Override protected void setUp() throws Exception { super.setUp(); // Espresso does not start the Activity for you we need to do this manually here. mActivity = getActivity(); } public void testPreconditions() { assertThat(mActivity, notNullValue()); } public void testEditText_OperandOneHint() { String operandOneHint = mActivity.getString(R.string.type_operand_one_hint); onView(withId(R.id.operand_one_edit_text)).check(matches(withHint(operandOneHint))); } public void testEditText_OperandTwoHint() { String operandTwoHint = mActivity.getString(R.string.type_operant_two_hint); onView(withId(R.id.operand_two_edit_text)).check(matches(withHint(operandTwoHint))); } }