def openApp(name_app): device = dev.get_devices() screen.record_screen(time_limit, name_file) events.swipe_screen() dev.get_screen(device) obj.get_objects(name_app) time.sleep(5) events.event_home() screen.get_record(device, name_file)
def install_apps(): print("INSTALANDO APKs") events.swipe_screen() time.sleep(2) output = subprocess.Popen("adb install ./apks/wikipedia.apk", shell=True, stdout=subprocess.PIPE) time.sleep(2) output = subprocess.Popen("adb install ./apks/ankidroid.apk", shell=True, stdout=subprocess.PIPE) time.sleep(3)
def changeHour(hora, minuto): #pegar o dispositivo e gravar a tela device = dev.get_devices() screen.record_screen(time_limit, name_file) #pegar tela e abrir configurações events.swipe_screen() dev.get_screen(device) obj.get_objects('Configurar') #pegar tela e abrir sistema time.sleep(2) events.swipe_screen() dev.get_screen(device) obj.get_objects('Sistema') #pegar tela e abrir Data e Hora time.sleep(2) dev.get_screen(device) obj.get_objects('Data e hora') #pegar tela e desabilitar data e hora automaticas time.sleep(2) dev.get_screen(device) obj.get_objects('Data e hora automáticas') #pegar tela e definir hora time.sleep(2) dev.get_screen(device) obj.get_objects('Definir hora') #pegar tela e definir hora time.sleep(2) dev.get_screen(device) obj.get_objects1(hora) time.sleep(2) dev.get_screen(device) obj.get_objects1(minuto) time.sleep(2) obj.get_objects('OK') #pegar tela e desabilitar data e hora automaticas time.sleep(2) dev.get_screen(device) obj.get_objects('Data e hora automáticas') time.sleep(2) events.event_home() #screen.get_record(device) events.reboot()
def search(search_text): dev.get_screen(device) time.sleep(2) obj.get_objects('Pesquisar ou digitar endereço da Web') time.sleep(2) output = subprocess.Popen("adb shell input text %s" % search_text, shell=True, stdout=subprocess.PIPE) time.sleep(1) output = subprocess.Popen("adb shell input keyevent 66", shell=True, stdout=subprocess.PIPE) time.sleep(2) events.swipe_screen()
def uninstall_apps(): print("DESINSTALANDO APKs") events.swipe_screen() time.sleep(2) output = subprocess.Popen("adb uninstall org.wikipedia", shell=True, stdout=subprocess.PIPE) time.sleep(2) output = subprocess.Popen("adb uninstall com.ichi2.anki", shell=True, stdout=subprocess.PIPE) time.sleep(2) output = subprocess.Popen("adb shell input keyevent 4", shell=True, stdout=subprocess.PIPE)
def enable_disable_colors(): print("ENABLES") subprocess.Popen( 'adb shell settings put secure accessibility_display_inversion_enabled 1', shell=True, stdout=subprocess.PIPE) time.sleep(2) events.swipe_screen() time.sleep(2) print("DISABLES") subprocess.Popen( 'adb shell settings put secure accessibility_display_inversion_enabled 0', shell=True, stdout=subprocess.PIPE) time.sleep(3)
def install_uninstall(): device = dev.get_devices() screen.record_screen(time_limit, name_file) install_apps() time.sleep(2) dev.get_screen(device) obj.get_objects('Wikipédia') time.sleep(2) events.event_home() time.sleep(2) events.swipe_screen() time.sleep(2) dev.get_screen(device) obj.get_objects('AnkiDroid') uninstall_apps() screen.get_record(device)
def change_language(): #pegar o dispositivo e gravar a tela device = dev.get_devices() screen.record_screen(time_limit, name_file) #pegar tela e abrir configurações events.swipe_screen() dev.get_screen(device) obj.get_objects('Configurar') #pegar tela e abrir sistema time.sleep(3) events.swipe_screen() dev.get_screen(device) obj.get_objects('Sistema') #pegar tela e abrir idiomas e entrada time.sleep(3) dev.get_screen(device) obj.get_objects('Idiomas e entrada') #pegar tela e abrir Idiomas time.sleep(3) dev.get_screen(device) obj.get_objects('Idiomas') time.sleep(3) #dev.get_screen(device) output = subprocess.Popen("adb shell input swipe 926 242 926 500 500", shell=True, stdout=subprocess.PIPE) time.sleep(3) output1 = subprocess.Popen("adb shell input swipe 926 242 926 500 500", shell=True, stdout=subprocess.PIPE) time.sleep(3) events.event_home()