This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void testLaunchActivity() { | |
onView(withId(R.id.home_camera_button)).check(matches(withText("Camera"))); | |
onView(withId(R.id.home_gallery_button)).check(matches(withText("Gallery"))); | |
onView(withId(R.id.home_inspire_button)).check(matches(withText("Inspire"))); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
imageView.setOnTouchListener(new View.OnTouchListener() { | |
@Override | |
public boolean onTouch(View view, MotionEvent event) { | |
originalImageView.setVisibility(event.getAction() == MotionEvent.ACTION_DOWN ? | |
View.VISIBLE : View.GONE); | |
return true; | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:background="@color/processed_image_background"> | |
<ImageView | |
android:id="@+id/processed_image" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "ProcessImageTest.h" | |
#import "SHAStrings.h" | |
@interface ProcessImageTest () | |
// Dismiss the gallery once it has been opened. | |
- (void)cancelGallery; | |
// Sequence that results in two pictures in the results view. | |
- (void)choosePictureAndProcessSequence; | |
// Sequence that results in a picture in the edit view. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)testSwipe { | |
[[app_ buttons][[SHAStrings galleryButtonTitleString]] tap]; | |
[[[app_ tables] buttons][@"Moments"] tap]; | |
[[[app_ collectionViews] cells][@"Photo, Landscape, August 08, 2012, 7:52 PM"] tap]; | |
[self verifyEditPageButtonsVisible]; | |
XCUIElement *element = [[[app_ scrollViews] childrenMatchingType:XCUIElementTypeOther] element]; | |
XCUIElement *imageButton = [[[element childrenMatchingType:XCUIElementTypeOther] | |
elementBoundByIndex:0] buttons][[SHAStrings processedImageA11yLabel]]; | |
[imageButton pressForDuration:1]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)testChangeImageFromEditPage { | |
[[app_ buttons][[SHAStrings galleryButtonTitleString]] tap]; | |
[[[app_ tables] buttons][@"Moments"] tap]; | |
[[[app_ collectionViews] cells][@"Photo, Landscape, August 08, 2012, 7:52 PM"] tap]; | |
[self verifyEditPageButtonsVisible]; | |
XCUIElement *navBar = [app_ navigationBars][[SHAStrings imageEditingViewControllerTitle]]; | |
[[navBar buttons][[SHAStrings galleryButtonA11yLabel]] tap]; | |
[[[app_ tables] buttons][@"Camera Roll"] tap]; | |
[[[app_ collectionViews] cells][@"Photo, Landscape, March 12, 2011, 4:17 PM"] tap]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)testChangeAccuracySlider { | |
[[app_ buttons][[SHAStrings galleryButtonTitleString]] tap]; | |
[[[app_ tables] buttons][@"Moments"] tap]; | |
[[[app_ collectionViews] cells][@"Photo, Landscape, August 08, 2012, 7:52 PM"] tap]; | |
XCUIElement *slider = [app_ sliders][[SHAStrings accuracySliderA11yLabel]]; | |
[slider tap]; | |
// Go back to Home Page. | |
[[[[[app_ navigationBars][@"Edit"] childrenMatchingType:XCUIElementTypeButton] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)testChooseImageAndRotate { | |
XCUIDevice *device = [XCUIDevice sharedDevice]; | |
[[app_ buttons][[SHAStrings galleryButtonTitleString]] tap]; | |
[[[app_ tables] buttons][@"Moments"] tap]; | |
[[[app_ collectionViews] cells][@"Photo, Landscape, August 08, 2012, 7:52 PM"] tap]; | |
[self verifyEditPageButtonsVisible]; | |
[device setOrientation:UIDeviceOrientationLandscapeRight]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)testChooseImageAndGoBack { | |
[[app_ buttons][[SHAStrings galleryButtonTitleString]] tap]; | |
[[[app_ tables] buttons][@"Moments"] tap]; | |
[[[app_ collectionViews] cells][@"Photo, Landscape, August 08, 2012, 7:52 PM"] tap]; | |
[self verifyEditPageButtonsVisible]; | |
// Go back to Home Page. | |
[[[[[app_ navigationBars][@"Edit"] childrenMatchingType:XCUIElementTypeButton] | |
matchingIdentifier:@"Back"] elementBoundByIndex:0] tap]; | |
[self verifyHomePageButtons]; |