def do(self): for i in range(self.iterations): # go to Settings ui_steps.click_button(serial = self. serial, view_to_find = {"className": "android.widget.ImageButton"})() ui_steps.click_button(serial = self.serial, view_to_find = {"className": "android.widget.TextView"}, view_to_check = {"text": "Settings"})() ui_steps.click_checkbox_button(serial = self.serial, view_to_find = {"text":"Enable RDS"}, state = "OFF", relationship="right")() logcat_steps.grep_for(serial = self.serial, grep_for_text = "radio_hw: disable RDS decoding", text_presence = True)() logcat_steps.clear_logcat(serial = self.serial)() ui_steps.click_checkbox_button(serial = self.serial, view_to_find = {"text":"Enable RDS"}, state = "ON", relationship="right")() logcat_steps.grep_for(serial = self.serial, grep_for_text = "radio_hw: enable RDS decoding", text_presence = True)() ui_steps.press_back(serial = self. serial, view_to_check = {"text": "FM Radio"})() time.sleep(self.wait_time)
ui_steps.unlock_device(pin=wifi_defaults.wifi['pin'], serial=serial)() # clear logcat logcat_steps.clear_logcat(serial=serial)() # start the FM Radio app radio_steps.start_fmradio(serial=serial, frequency=frequency, rds="ON", ta="ON", af="ON", wait_time=10)() # check the Radio Data System (RDS) data is supported logcat_steps.grep_for(serial=serial, grep_for_text="radio_hw: PS: " + radio_name, text_presence=True)() # check the Program Type Code (PTY) is supported if pty_check: logcat_steps.grep_for(serial=serial, grep_for_text="radio_hw: PTY: " + str(pty), text_presence=True)() # check the Traffic Announcement (TA) is supported if ta_check: logcat_steps.grep_for(serial=serial, grep_for_text="radio_hw: TA: " + ta_check, text_presence=True)() # check the Program Identification Code (PI) is supported
import time import sys ##### initialization ##### globals().update(vars(get_args(sys.argv))) args = {} for entry in script_args: key, val = entry.split("=") args[key] = val # mandatory params carrier_name = args["carrier_name"] number = args["number"] adb_steps.wake_up_device(serial=serial)() adb_steps.menu_to_unlock(serial=serial)() ui_steps.press_home(serial=serial)() ui_steps.close_all_app_from_recent(serial=serial)() telephony_steps.check_carrier(serial=serial, carrier_name=carrier_name, wait_time=10000)() ui_steps.press_back(serial=serial, times=2)() logcat_steps.clear_logcat(serial=serial)() telephony_steps.call_a_number(serial=serial, number=number, wait_time=10000)() time.sleep(2) logcat_steps.grep_for(serial=serial, grep_for_text="Dialing")() telephony_steps.end_call(serial=serial, wait_time=10000)()
view_to_check={ "resourceId": "android:id/message", "text": "Turn off airplane mode to make a call." }, wait_time=10000)() ui_steps.click_button(serial=serial, view_to_find={"text": "OK"}, view_to_check={ "resourceId": "android:id/message", "text": "Turn off airplane mode to make a call." }, view_presence=False, wait_time=10000)() time.sleep(2) logcat_steps.grep_for(serial=serial, grep_for_text="Dialing", text_presence=False)() wifi_steps.set_airplane_mode(serial=serial, state="OFF")() ui_steps.press_home(serial=serial)() ui_steps.close_all_app_from_recent(serial=serial)() telephony_steps.check_carrier(serial=serial, carrier_name=carrier_name)() ui_steps.press_back(serial=serial, times=2)() logcat_steps.clear_logcat(serial=serial)() telephony_steps.call_a_number(serial=serial, number=number, wait_time=10000)() time.sleep(2) logcat_steps.grep_for(serial=serial, grep_for_text="Dialing")() telephony_steps.end_call(serial=serial, wait_time=10000)()