1 /* 2 * Copyright (C) 2016 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package android.platform.helpers; 18 19 import java.util.List; 20 21 public interface IAutoMediaHelper extends IAppHelper, Scrollable { 22 /** 23 * Setup expectations: media app is open 24 * 25 * This method is used to play media. 26 */ playMedia()27 void playMedia(); 28 29 /** 30 * Setup expectations: on home screen. 31 * 32 * This method is used to play media from home screen. 33 */ playPauseMediaFromHomeScreen()34 void playPauseMediaFromHomeScreen(); 35 36 /** 37 * Setup expectations: media app is open. 38 * 39 * This method is used to pause media. 40 */ pauseMedia()41 void pauseMedia(); 42 43 /** 44 * Setup expectations: media app is open. 45 * 46 * This method is used to select next track. 47 */ clickNextTrack()48 void clickNextTrack(); 49 50 /** 51 * Setup expectations: on home screen. 52 * 53 * This method is used to select next track from home screen. 54 */ clickNextTrackFromHomeScreen()55 void clickNextTrackFromHomeScreen(); 56 57 /** 58 * Setup expectations: media app is open. 59 * 60 * This method is used to select previous track. 61 */ clickPreviousTrack()62 void clickPreviousTrack(); 63 64 /** 65 * Setup expectations: on home screen. 66 * 67 * This method is used to select previous track from home screen. 68 */ clickPreviousTrackFromHomeScreen()69 void clickPreviousTrackFromHomeScreen(); 70 71 /** 72 * Setup expectations: media app is open. 73 * 74 * This method is used to shuffle tracks. 75 */ clickShuffleAll()76 void clickShuffleAll(); 77 78 /** 79 * Setup expectations: media app is open. 80 * 81 * This method is used to click on nth instance among the visible menu items 82 * 83 * @param - instance is the index of the menu item (starts from 0) 84 */ clickMenuItem(int instance)85 void clickMenuItem(int instance); 86 87 /** 88 * Setup expectations: media app is open. 89 * 90 * This method is used to open Folder Menu with menuOptions. 91 * Example - openMenu->Folder->Mediafilename->trackName 92 * openMenuWith(Folder,mediafilename,trackName); 93 * 94 * @param - menuOptions used to pass multiple level of menu options in one go. 95 */ openMenuWith(String... menuOptions)96 void openMenuWith(String... menuOptions); 97 98 /** 99 * Setup expectations: media app is open. 100 * 101 * This method is used to used to open mediafilename from now playing list. 102 * 103 * @param - trackName - media to be played. 104 */ openNowPlayingWith(String trackName)105 void openNowPlayingWith(String trackName); 106 107 /** 108 * Setup expectations: Media app is open. 109 * 110 * @return to get current playing track name. 111 */ getMediaTrackName()112 String getMediaTrackName(); 113 114 /** 115 * Setup expectations: on home screen. 116 * 117 * @return to get current playing track name from home screen. 118 */ getMediaTrackNameFromHomeScreen()119 String getMediaTrackNameFromHomeScreen(); 120 121 /** 122 * Setup expectations: Media app is open. User navigates to sub-page of the Media Player 123 * 124 * This method is to go back to the Media Player main page from any sub-page. 125 */ goBackToMediaHomePage()126 void goBackToMediaHomePage(); 127 128 /** 129 * This method is used to check if media is currently playing Returns true if media is playing 130 * else returns false 131 */ isPlaying()132 boolean isPlaying(); 133 134 /** 135 * Setup expectations: Media app is open. 136 * 137 * @return Media App Title 138 */ getMediaAppTitle()139 String getMediaAppTitle(); 140 141 /** 142 * Setup expectations: Media app is open. 143 * Opens the drop down menu in the Media Apps 144 */ openMediaAppMenuItems()145 void openMediaAppMenuItems(); 146 147 /** 148 * Setup expectations: "Media apps" Grid is open. 149 * 150 * @param mediaAppsNames : List of media apps names 151 * @return true if all app names in mediaAppsNames shows up in Media Apps Grid 152 */ areMediaAppsPresent(List<String> mediaAppsNames)153 boolean areMediaAppsPresent(List<String> mediaAppsNames); 154 155 /** 156 * Setup expectations: "Media apps" Grid is open. 157 * 158 * @param appName App name to open 159 */ openApp(String appName)160 void openApp(String appName); 161 162 /** 163 * Setup expectations: Media app is open. 164 */ openMediaAppSettingsPage()165 void openMediaAppSettingsPage(); 166 167 /** 168 * Setup expectations: Media app is open. Account not logged in. 169 * 170 * @return Error message for no user login 171 */ getMediaAppUserNotLoggedInErrorMessage()172 String getMediaAppUserNotLoggedInErrorMessage(); 173 174 /** 175 * Setup expectations: In Media. 176 * 177 * <p>Scroll up on page. 178 */ scrollUpOnePage()179 boolean scrollUpOnePage(); 180 181 /** 182 * Setup expectations: In Media. 183 * 184 * <p>Scroll down on page. 185 */ scrollDownOnePage()186 boolean scrollDownOnePage(); 187 } 188