Create the scrollPhoto method for IphotoHelper.java
Bug: 164946831
Test: TF_GLOBAL_CONFIG=/google/src/cloud/<ldap>/<workspace>/google3/wireless/android/test_tools/forrest/configs/local-host-config.xml \
pts-tradefed run commandAndExit cuj/<testname> \
--primary-abi-only \
--log-level verbose --log-level-display verbose \
--wifi-network GoogleGuest
Change-Id: I5b699664ac2f26e1a14835737de11f5970fab13a
diff --git a/libraries/app-helpers/interfaces/handheld/src/android/platform/helpers/IPhotosHelper.java b/libraries/app-helpers/interfaces/handheld/src/android/platform/helpers/IPhotosHelper.java
index 15684fd..b167511 100644
--- a/libraries/app-helpers/interfaces/handheld/src/android/platform/helpers/IPhotosHelper.java
+++ b/libraries/app-helpers/interfaces/handheld/src/android/platform/helpers/IPhotosHelper.java
@@ -17,13 +17,14 @@
package android.platform.helpers;
import android.support.test.uiautomator.Direction;
+import android.support.test.uiautomator.UiObject2;
public interface IPhotosHelper extends IAppHelper {
/**
* Setup expectations: Photos is open and on the main or a device folder's screen.
*
- * This method will check if there are videos that can be opened on current screen
- * by looking for any view objects with content-desc that starts with "Video"
+ * <p>This method will check if there are videos that can be opened on current screen by looking
+ * for any view objects with content-desc that starts with "Video"
*
* @return true if video clips are found, false otherwise
*/
@@ -32,7 +33,7 @@
/**
* Setup expectations: Photos is open and on the main or a device folder's screen.
*
- * This method will select the first clip to open and play. This will block until the clip
+ * <p>This method will select the first clip to open and play. This will block until the clip
* begins to plays.
*/
public void openFirstClip();
@@ -40,63 +41,58 @@
/**
* Setup expectations: Photos is open and a clip is currently playing.
*
- * This method will pause the current clip and block until paused.
+ * <p>This method will pause the current clip and block until paused.
*/
public void pauseClip();
/**
* Setup expectations: Photos is open and a clip is currently paused in the foreground.
*
- * This method will play the current clip and block until it is playing.
+ * <p>This method will play the current clip and block until it is playing.
*/
public void playClip();
/**
* Setup expectations: Photos is open.
*
- * This method will go to the main screen.
+ * <p>This method will go to the main screen.
*/
public void goToMainScreen();
/**
* Setup expectations: Photos is open.
*
- * This method will go to device folder screen.
+ * <p>This method will go to device folder screen.
*/
public void goToDeviceFolderScreen();
/**
- * Setup expectations:
- * 1. Photos is open
- * 2. on device folder screen
- * 3. the first device folder is shown on the screen
+ * Setup expectations: 1. Photos is open 2. on device folder screen 3. the first device folder
+ * is shown on the screen
*
- * This method will search for user-specified device folder in device folders.
- * If the device folder is found, the function will return with the device
- * folder on current screen.
+ * <p>This method will search for user-specified device folder in device folders. If the device
+ * folder is found, the function will return with the device folder on current screen.
*
- * @param folderName User-specified device folder name
+ * @param folderName User-specified device folder name
* @return true if device folder is found, false otherwise
*/
public boolean searchForDeviceFolder(String folderName);
/**
- * Setup expectations:
- * 1. Photos is open
- * 2. on device folder screen
- * 3. user-specified device folder is currently on screen
+ * Setup expectations: 1. Photos is open 2. on device folder screen 3. user-specified device
+ * folder is currently on screen
*
- * This method will open the user-specified device folder.
+ * <p>This method will open the user-specified device folder.
*
- * @param folderName User-specified device folder name
+ * @param folderName User-specified device folder name
*/
public void openDeviceFolder(String folderName);
/**
* Setup expectations: Photos is open and on the main or a device folder's screen.
*
- * This method will check if there are pictures that can be opened on current screen
- * by looking for any view objects with content-desc that starts with "Photo"
+ * <p>This method will check if there are pictures that can be opened on current screen by
+ * looking for any view objects with content-desc that starts with "Photo"
*
* @return true if pictures are found
*/
@@ -105,7 +101,7 @@
/**
* Setup expectations: Photos is open and on the main or a device folder's screen.
*
- * This method will open the picture at the specified index.
+ * <p>This method will open the picture at the specified index.
*
* @param index The index of the picture to open
*/
@@ -130,4 +126,27 @@
* @return Returns whether the object can still scroll in the given direction
*/
public boolean scrollPage(Direction direction);
+
+ /**
+ * Setup expectations: Photos is open and a page contains pictures or albums is open.
+ *
+ * <p>This method will scroll the page in the specified direction.
+ *
+ * <p>This method needs to check the UI object additionally.
+ *
+ * @param container The container with scrollable elements.
+ * @param direction The direction of the scroll, must be UP or DOWN.
+ * @param percentOfPhotoSize The distance of scroll as a percentage of Photo size.
+ * @param speed The speed of the scroll.
+ * @return Returns whether the object can still scroll in the given direction.
+ */
+ public boolean scrollPhotosGrid(
+ UiObject2 container, Direction direction, float percentOfPhotoSize, int speed);
+
+ /**
+ * Setup expectation: Photos is open and a page contains pictures or albums is open.
+ *
+ * <p>Get the UiObject2 of photo scroll view pattern.
+ */
+ public UiObject2 getPhotoScrollView();
}