@Test public void testRotateWithDialog() { addDialog(new AlertDialog.Builder(getActivity())); espDevice.rotateToLandscape(); espDevice.assertOrientationIsLandscape(); }
@Test public void testAssertOrientationIsPortraitFailure() { exception.expect(AssertionFailedError.class); exception.expectMessage(is("expected device orientation PORTRAIT but was LANDSCAPE")); espDevice.rotateToLandscape(); espDevice.assertOrientationIsPortrait(); }
@Test public void testRotateOnOrientationFixedActivity() { espDevice.assertOrientationIsLandscape(); espDevice.rotateToLandscape(); espDevice.assertOrientationIsLandscape(); } }
@Test public void testRotate() { espDevice.assertOrientationIsPortrait(); espDevice.rotateToLandscape(); espDevice.assertOrientationIsLandscape(); espDevice.rotateToPortrait(); 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(); }
@Test public void testCompareFailureWhenDifferentDimensions() { EspScreenshotTool.takeWithName("testCompareDifferentDimensions"); EspDevice.root().rotateToLandscape(); EspScreenshotTool.takeWithName("testCompareDifferentDimensions2"); exception.expect(AssertionFailedError.class); exception.expectMessage("Images must have same dimensions."); EspScreenshotTool.comparePercentage( new EspScreenshotTool().obtainScreenshotDirectory() + "/testCompareDifferentDimensions.png", new EspScreenshotTool().obtainScreenshotDirectory() + "/testCompareDifferentDimensions2.png"); }