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 /** 189 * Setup expectations: media test app is open. 190 * 191 * <p>This method is used to open Folder Menu with menuOptions and scroll into view the track. 192 * Example - openMenu->Folder->Mediafilename->trackName 193 * openMenuWith(Folder,mediafilename,trackName); 194 * 195 * @param menuOptions used to pass multiple level of menu options in one go. 196 */ selectMediaTrack(String... menuOptions)197 void selectMediaTrack(String... menuOptions); 198 199 /** 200 * Setup expectations: Now Playing is open. 201 * 202 * <p>This method is used to select previous track. 203 */ minimizeNowPlaying()204 void minimizeNowPlaying(); 205 206 /** 207 * Setup expectations: media test app is open and Minimize control bar present. 208 * 209 * <p>This method is used to maximize the play back screen. 210 */ maximizeNowPlaying()211 void maximizeNowPlaying(); 212 213 /** 214 * Setup expectations: Bluetooth Audio page opened. 215 * 216 * <p>This method is return is Bluetooth Audio disconnected label visible. 217 */ isBluetoothAudioDisconnectedLabelVisible()218 boolean isBluetoothAudioDisconnectedLabelVisible(); 219 220 /** 221 * Setup expectations: Bluetooth Audio page opened. 222 * 223 * <p>This method returns whether connect to bluetooth label visible or not. 224 */ isConnectToBluetoothLabelVisible()225 boolean isConnectToBluetoothLabelVisible(); 226 227 /** 228 * Setup expectations: on home screen. 229 * 230 * <p>This method is used to open Bluetooth Audio screen. 231 */ openBluetoothMediaApp()232 void openBluetoothMediaApp(); 233 234 /** 235 * Setup expectations: Bluetooth Settings page opened. 236 * 237 * <p>This method is used to enable/disable Bluetooth conncetion. 238 */ clickOnBluetoothToggle()239 void clickOnBluetoothToggle(); 240 241 /** 242 * Setup expectations: Bluetooth Audio page opened. 243 * 244 * <p>This method is used to Cancel Bluetooth Audio conncetion. 245 */ cancelBluetoothAudioConncetion()246 void cancelBluetoothAudioConncetion(); 247 248 /** 249 * Setup expectations: Bluetooth Audio page opened. 250 * 251 * <p>This method is used to Scroll down playlist. 252 */ scrollPlayListDown()253 void scrollPlayListDown(); 254 255 256 /** 257 * Setup expectations: Bluetooth Audio page opened. 258 * 259 * <p>This method is used to select song from playlist. 260 */ clickOnSongFromPlaylist()261 void clickOnSongFromPlaylist(); 262 263 /** 264 * Setup expectations: Media app is open and maximized now playing. 265 * 266 * @return get current artist tile 267 */ getArtistrTitle()268 String getArtistrTitle(); 269 270 /** 271 * Setup expectations: Media app is open and maximized now playing. 272 * 273 * @return get current album tile 274 */ getAlbumTitle()275 String getAlbumTitle(); 276 277 /** 278 * Setup expectations: Media app is open and maximized now playing. 279 * 280 * @return get current song playing time 281 */ getSongCurrentPlayingTime()282 String getSongCurrentPlayingTime(); 283 284 /** 285 * Setup expectations: Media app is open and maximized now playing. 286 * 287 * @return get current song max playing time 288 */ getCurrentSongMaxPlayingTime()289 String getCurrentSongMaxPlayingTime(); 290 291 /** 292 * Setup expectations: Bluetooth Audio track maximized. 293 * 294 * <p>This method is return is "Now Playing" label visible. 295 */ isNowPlayingLabelVisible()296 boolean isNowPlayingLabelVisible(); 297 298 /** 299 * Setup expectations: Bluetooth Audio track maximized. 300 * 301 * <p>This method is return is Playlist icon visible. 302 */ isPlaylistIconVisible()303 boolean isPlaylistIconVisible(); 304 305 /** 306 * Setup expectations: Bluetooth Audio track maximized. 307 * 308 * <p>This method is used to click on playlist icon. 309 */ clickOnPlaylistIcon()310 void clickOnPlaylistIcon(); 311 312 /** 313 * Setup expectations: Grant restricted parmissions for BT Media 314 * 315 * <p>This method is used to Grant restricted parmissions in runtime 316 */ grantRestrictedPermissionsForBTMedia(String permission)317 void grantRestrictedPermissionsForBTMedia(String permission); 318 319 } 320