def rotation():
    screen.record_screen(time_limit, name_file)
    device = dev.get_devices()
    dev.get_screen(device)
    obj.get_objects('Telefone')
    screen_rotation(device)
    screen.get_record(device, name_file)
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)
Esempio n. 3
0
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()
Esempio n. 4
0
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()
    OBS: A descrição completa do código encontra-se em bit.ly/hefesto7-doc
'''

import subprocess
import time
import script_device_functions as dev
import script_events as events
import script_screen_functions as screen
import script_object_functions as obj
import xml.etree.ElementTree as ET

time_limit = '20'
name_file = 'test_search_example.mp4'

device = dev.get_devices()


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)
def inverting_colors():
    screen.record_screen(time_limit, name_file)
    device = dev.get_devices()
    enable_disable_colors()
    events.event_back()
    screen.get_record(device, name_file)