1 /* 2 * Copyright (C) 2023 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 package android.platform.helpers; 17 18 /** Interface file for status bar tests */ 19 public interface IAutoStatusBarHelper extends IAppHelper { 20 21 /** Opens bluetooth palette. */ openBluetoothPalette()22 void openBluetoothPalette(); 23 24 /** 25 * Setup expectations: Should be on home screen. 26 * 27 * <p>Checks if bluetooth switch is present. 28 */ hasBluetoothSwitch()29 boolean hasBluetoothSwitch(); 30 31 /** Opens bluetooth switch. */ openBluetoothSwitch()32 void openBluetoothSwitch(); 33 34 /** 35 * Setup expectations: Should be on home screen. 36 * 37 * <p>Checks if bluetooth on message is present. 38 */ hasToggleOnMessage()39 boolean hasToggleOnMessage(); 40 41 /** 42 * Setup expectations: Should be on home screen. 43 * 44 * <p>Checks if bluetooth off message is present. 45 */ hasToggleOffMessage()46 boolean hasToggleOffMessage(); 47 48 /** Opens bluetooth settings. */ openBluetoothSettings()49 void openBluetoothSettings(); 50 51 /** 52 * Setup expectations: Should be on home screen. 53 * 54 * <p>Checks if bluetooth settings page title is present 55 */ hasBluetoothSettingsPageTitle()56 boolean hasBluetoothSettingsPageTitle(); 57 58 /** 59 * Setup expectations: Should be on home screen. 60 * 61 * <p>Checks if bluetooth enabled or not 62 */ isBluetoothOn()63 boolean isBluetoothOn(); 64 65 /** Bluetooth switch button. */ turnOnOffBluetooth(boolean onOff)66 void turnOnOffBluetooth(boolean onOff); 67 68 /** 69 * Setup expectations: Open Bluetooth Palette 70 * 71 * <p>This method clicks bluetooth button</> 72 */ clickBluetoothButton()73 void clickBluetoothButton(); 74 75 /** 76 * Setup expectations: Open Bluetooth Palette 77 * 78 * <p>This method checks bluetooth connected text</> 79 */ isBluetoothConnected()80 boolean isBluetoothConnected(); 81 82 /** 83 * Setup expectations: Verify Bluetooth Button 84 * 85 * <p>This method verifies bluetooth button from bluetooth palette</> 86 */ hasBluetoothButton()87 boolean hasBluetoothButton(); 88 89 /** 90 * Setup expectations: Verify Phone Button 91 * 92 * <p>This method verifies phone button from bluetooth palette</> 93 */ hasBluetoothPalettePhoneButton()94 boolean hasBluetoothPalettePhoneButton(); 95 96 /** 97 * Setup expectations: Verify Media Button 98 * 99 * <p>This method verifies media button from bluetooth palette</> 100 */ hasBluetoothPaletteMediaButton()101 boolean hasBluetoothPaletteMediaButton(); 102 103 /** 104 * Setup expectations: Verify the Device name 105 * 106 * <p>This method verifies the connected device name</> 107 */ verifyDeviceName()108 boolean verifyDeviceName(); 109 110 /** 111 * Setup expectations: Verify the Disabled Bluetooth profile 112 * 113 * <p>This method verifies the disabled bluetooth profile</> 114 */ isBluetoothButtonEnabled()115 boolean isBluetoothButtonEnabled(); 116 117 /** 118 * Setup expectations: Verify the Disabled Phone profile 119 * 120 * <p>This method verifies the disabled phone profile</> 121 */ isBluetoothPhoneButtonEnabled()122 boolean isBluetoothPhoneButtonEnabled(); 123 124 /** 125 * Setup expectations: Verify the Disabled Media profile 126 * 127 * <p>This method verifies the disabled Media profile</> 128 */ isBluetoothMediaButtonEnabled()129 boolean isBluetoothMediaButtonEnabled(); 130 131 /** 132 * Setup expectations: Status bar Network palette is open. 133 * 134 * <p>Open status bar network palette. 135 */ openNetworkPalette()136 void openNetworkPalette(); 137 138 /** 139 * Setup expectations: Toggle ON/OFF 140 * 141 * <p>Click on toggle button from status bar palette 142 * 143 * @param name options in the palette 144 */ networkPaletteToggleOnOff(String name)145 void networkPaletteToggleOnOff(String name); 146 147 /** 148 * Setup expectations: Hotspot Name 149 * 150 * <p>Check if the Hotspot name is displayed 151 */ isHotspotNameDisplayed()152 boolean isHotspotNameDisplayed(); 153 154 /** 155 * Setup expectations: Status of Toggle ON/OFF 156 * 157 * <p>Checks if toggle is enabled on status bar palette 158 * 159 * @param target options in the palette 160 */ isNetworkSwitchEnabled(String target)161 boolean isNetworkSwitchEnabled(String target); 162 163 /** 164 * Setup expectations: Wi-Fi Name 165 * 166 * <p>Check if the Wifi name is displayed 167 */ isWifiNameDisplayed()168 boolean isWifiNameDisplayed(); 169 170 /** 171 * Setup expectations: Network & Internet 172 * 173 * <p>click on connected Wifi 174 */ clickOnConnectedWifi()175 void clickOnConnectedWifi(); 176 177 /** 178 * Setup expectations: Network & Internet 179 * 180 * <p>click on forget button 181 */ forgetWifi()182 void forgetWifi(); 183 184 /** 185 * Setup expectations: None 186 * 187 * <p>This method changes the device mode to DAY Mode</> 188 */ changeToDayMode()189 boolean changeToDayMode(); 190 191 /** 192 * Setup expectations: None 193 * 194 * <p>This method changes the device mode to NIGHT Mode</> 195 */ changeToNightMode()196 boolean changeToNightMode(); 197 198 /** 199 * Setup expectations: None 200 * 201 * <p>This method gets the current night mode, for night mode no the value should be 1 for night 202 * mode yes the return value should be 2</> 203 */ getCurrentDisplayMode()204 int getCurrentDisplayMode(); 205 206 /** 207 * Setup expectations: Open Bluetooth Palette 208 * 209 * <p>This method checks bluetooth connected text</> 210 * 211 * <p>This method checks if mobile is connected to bluetooth</> 212 */ isBluetoothConnectedToMobile()213 boolean isBluetoothConnectedToMobile(); 214 215 /** 216 * Setup expectations: Open Bluetooth Palette 217 * 218 * <p>This method checks if mobile is disconnected to bluetooth</> 219 */ isBluetoothDisconnected()220 boolean isBluetoothDisconnected(); 221 222 /** 223 * Setup expectations: Home screen 224 * 225 * <p>Get time from the Status bar 226 */ getClockTime()227 String getClockTime(); 228 229 /** 230 * Setup expectations: None 231 * 232 * <p>Get the current time for given time zone</> 233 */ getCurrentTimeWithTimeZone(String timezone)234 String getCurrentTimeWithTimeZone(String timezone); 235 236 /** 237 * Setup expectations: Open Bluetooth Palette 238 * 239 * <p>This method checks whether media button is enabled 240 */ isBluetoothPaletteMediaButtonEnabled()241 boolean isBluetoothPaletteMediaButtonEnabled(); 242 243 /** 244 * Setup expectations: Open Bluetooth Palette 245 * 246 * <p>This method performs click operation on media button 247 */ clickOnBluetoothPaletteMediaButton()248 void clickOnBluetoothPaletteMediaButton(); 249 } 250