@Test public void testRotate() { espDevice.assertOrientationIsPortrait(); espDevice.rotateToLandscape(); espDevice.assertOrientationIsLandscape(); espDevice.rotateToPortrait(); espDevice.assertOrientationIsPortrait(); }
@Test public void testAssertOrientationIsPortraitFailure() { exception.expect(AssertionFailedError.class); exception.expectMessage(is("expected device orientation PORTRAIT but was LANDSCAPE")); espDevice.rotateToLandscape(); espDevice.assertOrientationIsPortrait(); }
@Test @Ignore("change orientation works only for current activity but not following activities") public void testKeepRotation() { espDevice.assertOrientationIsPortrait(); espDevice.rotateToLandscape(); espDevice.assertOrientationIsLandscape(); getActivity().startActivity(new Intent(getActivity(), LongListActivity.class)); espDevice.assertOrientationIsLandscape(); }