@Test public void setup() { // emulator with older android version (e.g. v8) has initial landscape mode // but we expect orientation is portrait mode espDevice.rotateToPortrait(); }
@After public void reset() { espDevice.rotateToPortrait(); espDevice.closeSoftKeyboard(); }
@Test public void testAssertOrientationIsLandscapeFailure() { exception.expect(AssertionFailedError.class); exception.expectMessage(is("expected device orientation LANDSCAPE but was PORTRAIT")); espDevice.rotateToPortrait(); espDevice.assertOrientationIsLandscape(); }
@After public void reset() { activityTestRule.getActivity().startActivity(new Intent(InstrumentationRegistry.getTargetContext(), BaseActivity.class)); activityTestRule.getActivity().finish(); espDevice.rotateToPortrait(); }
@Test public void testRotate() { espDevice.assertOrientationIsPortrait(); espDevice.rotateToLandscape(); espDevice.assertOrientationIsLandscape(); espDevice.rotateToPortrait(); espDevice.assertOrientationIsPortrait(); }