Пример #1
0
 def edit_video(self):
     Command(Video_Comm['MORE']).start()
     time.sleep(2)
     Command(Video_Comm['EDITOR']).start()
     time.sleep(1)
     Command(Video_Comm['CHOICCE']).start()
     time.sleep(1)
Пример #2
0
def main():

    Command('sudo chmod 777 /dev/ttyRelayCard').start()
    #close devices
    relay_devices=Relayed_device('/dev/ttyRelayCard','65')
    relay_devices.power_off()
    relay_devices.write('6E')
    relay_devices.close()
    time.sleep(20)

    #start relycard
    relay_devices=Relayed_device('/dev/ttyRelayCard','65','69')
    #enter in dnx model
    relay_devices.enter_dnx()
    relay_devices.close()
    #close relay ports
    relay_devices=Relayed_device('/dev/ttyRelayCard','6f','73')
    relay_devices.close_dnx()
    relay_devices.close()
    #copy flash file
    # flashfile = Flashfile(path)
    # flashfile.extract_flash_file(os.path.join(path,'flash.zip'))
    #flash devices
    os.chdir(path)
    for i in cmd_list:
        print(i)
        Command(i).start(80)
    time.sleep(200)
    plugin_set()
    set_up()
    swtich_ARP()
Пример #3
0
 def check_info(self):
     Command('adb -host shell input longtap 60 180').start()
     status = checkfile.check_stauts('text="详细信息"')
     if status == True:
         time.sleep(2)
         Command('adb -host shell input tap 100 630').start()
         logger.info('check the wlan info')
Пример #4
0
 def seek_video(self,count):
     i = 0
     while i < count:
         Command(Video_Comm['SEEK_START_LOCAL']).start()
         status,output,error=Command(Video_Comm['SEEK_RETURN_LOCAL']).start()
         BaseAPI().check_adb_command('ret = true',output)
         i+=1
         logger.info("seek the video try: %d" %(i))
Пример #5
0
 def play_video(self):
     time.sleep(5)
     Command(Video_Comm['PLAYVIDEO']).start()
     status = checkfile.check_stauts('resource-id="playerView"')
     if status == True:
         Command('adb -host shell input tap 500 600').start()
         logger.info('play video is success')
     else:
         raise Exception('play video is failed')
Пример #6
0
 def click_adapter_name(self):
     try:
         checkfile.check_stauts('text="点击更改设备名称"')
         Command(BT_Comm['CHANGE_ADAPTER_NAME']).start()
         time.sleep(1)
         Command(BT_Comm['DEVICE_NAME']).start()
         BaseAPI().longpress_delete()
     except Exception, msg:
         logger.debug('Exception:%s' % msg)
         exit(1)
Пример #7
0
 def camera_button(self):
     check_status = Command(Camera_Comm['CLICK']).start()
     logger.info(check_status)
     time.sleep(1)
     Command(Camera_Comm['CAMERA_FILE']).start()
     time.sleep(2)
     status = checkfile.check_stauts('page://gallery.yunos.com/Gallery')
     if status == True:
         logger.debug('take picture is successed')
     else:
         raise Exception('take picture is failed')
Пример #8
0
    def delete_recorder(self):
        self.launch_recor_package()
        status = checkfile.check_stauts('text="录音列表"')
        if status == False:
            count = 3
        else:
            count = 2
        for i in range(count):
            Command(Recorder_Comm['RECORDER_LIST']).start()

        Command(Recorder_Comm['DELETE']).start()
        checkfile.click('text="确定"')
Пример #9
0
 def swtich_ap_connect(self,args):
     checkfile.click(args)
     time.sleep(2)
     Command(WIFI_Comm['PASSWORD']).start()
     time.sleep(2)
     Command(WIFI_Comm['SELECT_RITHT']).start()
     time.sleep(10)
     status=checkfile.check_stauts('text="已连接"')
     if status == False:
         raise Exception('connect the wifi is failed')
     else:
         logger.info('connect the wifi is success')
Пример #10
0
 def launch_wifi(self):
     base.find_setting()
     Command(WIFI_Comm['LANCH_WIFI']).start()
     time.sleep(1)
     status = checkfile.check_stauts('checked="true"')
     if status == False:
         Command(WIFI_Comm['SWITCH_WIFI_STATUS']).start()
         time.sleep(2)
         new_stauts = checkfile.check_stauts('text="WLAN 列表"')
         if new_stauts == False:
             raise Exception('launch wifi is failed')
     else:
         logger.info('launch wifi is success')
Пример #11
0
    def delete_recorder(self):
        self.launch_recor_package()
        status = checkfile.check_stauts('text="录音列表"')
        if status == False:
            count = 3
        else:
            count = 2
        for i in range(count):
            Command(Recorder_Comm['RECORDER_LIST']).start()

        Command(Recorder_Comm['DELETE']).start()
        status, output, error = Command(
            Recorder_Comm['CONFRIM_DELETE']).start()
        BaseAPI().check_adb_command('ret = true', output)
Пример #12
0
 def revert_adapter_name(self):
     try:
         self.click_adapter_name()
         Command('adb -host shell input text Peacock').start()
         time.sleep(1)
         Command(BT_Comm['ENSURE_CHANGENAME_BUTTON']).start()
         time.sleep(1)
         stauts = checkfile.check_stauts('text="Peacock"')
         if stauts == True:
             logger.info('SUCESS:finished the revert adapter name')
         else:
             raise Exception('FAIL:revert the adapter occur with issue')
     except Exception, msg:
         logger.debug('Exception:%s' % msg)
         exit(1)
Пример #13
0
 def start_address_4(self,count):
     i = 0
     while i < count:
         Command(GFX_Comm['START_4']).start()
         time.sleep(60)
         i+=1
         logger.info('start times is %d'%i)
Пример #14
0
 def check_singal(self,args):
     Command('adb -host shell input longtap 60 180').start()
     status = checkfile.check_stauts(args)
     if status == False:
         raise Exception('show signal strength is failed')
     else:
         logger.info('show signal strength is success')
Пример #15
0
 def play_video(self):
     Command(Video_Comm['PLAYVIDEO']).start()
     status =checkfile.check_stauts('resource-id="playerView"')
     if status == True:
         logger.info('play video is success')
     else:
         raise Exception('play video is failed')
Пример #16
0
 def delete_audio_file(self):
     Command(Audio_Comm['DELETE_CHOICE']).start()
     time.sleep(1)
     Command(Audio_Comm['DELETE_CLICK']).start()
     Command(Audio_Comm['DELETE_AUDIO']).start()
     time.sleep(1)
     Command(Audio_Comm['CONFIRM_DELETE']).start()
     BaseAPI().back()
     status = checkfile.check_stauts('text="无音乐"')
     time.sleep(2)
     if status == True:
         logger.info('Delete the audio file is success')
         return True
     else:
         logger.debug('Delete the audio file is failed')
         return False
Пример #17
0
 def check_ifconfig(self):
     Command('adb -host shell input longtap 60 180').start()
     status = checkfile.check_stauts('text="192.168.1.100"')
     if status == True:
         logger.info('ifconfig changed is success')
     else:
         raise Exception('ifconfig changed is failed')
Пример #18
0
 def add_hidden_ssd(self):
     Command('adb -host shell input swipe 900 700 900 100').start()
     checkfile.click('text="添加网络"')
     time.sleep(1)
     Command('adb -host shell input text "ITFLEX_YUNOS_H"').start()
     time.sleep(1)
     checkfile.click('text="安全性"')
     time.sleep(1)
     checkfile.click('text="PSK"')
     time.sleep(1)
     Command('adb -host shell input tap 600 300').start()
     Command('adb -host shell input text 12345678').start()
     Command(WIFI_Comm['SELECT_RITHT']).start()
     time.sleep(10)
     base.back()
     self.check_connect_enable()
Пример #19
0
 def push_audiofile(self):
     try:
         Command(Audio_Comm['PUSHAUDIO']).start()
         logger.info('push audio file in devices')
     except Exception, msg:
         logger.debug('Exception:%s' % msg)
         exit(1)
Пример #20
0
 def delete_video_file(self):
     self.launch_video()
     Command(Video_Comm['MORE']).start()
     time.sleep(1)
     Command(Video_Comm['EDITOR']).start()
     Command(Video_Comm['CHOICCE']).start()
     time.sleep(1)
     Command(Video_Comm['DELETE_OPTION']).start()
     Command(Video_Comm['CONFRIM_DELETE']).start()
     status = checkfile.check_stauts('text="暂无视频"')
     if status == True:
         logger.info('Delete the video file is  success')
         return True
     else:
         logger.debug('Delete the video file is  failed')
         return False
Пример #21
0
 def launch_video(self):
     Command(Video_Comm['OPENVIDEO']).start()
     time.sleep(2)
     status=checkfile.check_stauts('page://videoplayer.yunos.com/videoplayer')
     if status == True:
         logger.info('open the video app is success')
     else:
         raise Exception("Launch video player is failed")
Пример #22
0
 def pause_resume(self, count):
     i = 0
     while i < count:
         status, output, error = Command(Video_Comm['PAUSE_RESUME']).start()
         BaseAPI().check_adb_command('ret = true', output)
         time.sleep(1)
         i += 1
         logger.info('pause and play video try: %d' % (i))
Пример #23
0
 def video_button(self, seconds):
     time.sleep(1)
     Command(Camera_Comm['SWTICH_STATUS']).start()
     time.sleep(1)
     logger.info('switch to  video mode')
     i = 0
     while i < 2:
         try:
             time.sleep(2)
             Command(Camera_Comm['CLICK']).start()
             logger.info('click the video button')
             time.sleep(seconds)
             i += 1
             seconds = 0
         except Exception, msg:
             logger.debug("Exception: %s" % msg)
             exit(1)
Пример #24
0
 def play_all(self):
     Command(Audio_Comm['PLAY_ALL']).start()
     time.sleep(3)
     status = checkfile.check_stauts('text="00:03/01:00"')
     if status == True:
         logger.info('Play audio is success')
     else:
         logger.error('Play audio is failed')
Пример #25
0
    def change_adapter_name(self, *args):
        try:
            for i in args:
                self.click_adapter_name()

                Command('adb -host shell input text {0}'.format(i)).start()
                # Command(BT_Comm['KEYIN_DEVICENAME']).start()
                Command(BT_Comm['ENSURE_CHANGENAME_BUTTON']).start()
                time.sleep(1)
                stauts = checkfile.check_stauts('text="{0}"'.format(i))
                if stauts == True:
                    logger.info('SUCESS:finished the change adapter name')
                else:
                    raise Exception('FAIL:change the adapter occur with issue')
        except Exception, msg:
            logger.debug('Exception:%s' % msg)
            exit(1)
Пример #26
0
 def check_connect_enable(self):
     Command(WIFI_Comm['LANCH_WIFI']).start()
     time.sleep(2)
     status = checkfile.check_stauts('text="已连接"')
     if status == True:
         logger.info('enable connect is success')
         base.back()
     else:
         raise Exception('enable connect is failed')
Пример #27
0
 def push_video_file(self,*args):
     try:
         for i in args:
             Command('adb -host push {0} {1}'.format(os.path.join(path_local,i),path_devcices)).start()
             time.sleep(5)
             logger.info('push video file in devices')
     except Exception,msg:
         logger.debug('Exception:%s'%msg)
         exit(1)
Пример #28
0
 def delete_audio_file(self):
     checkfile.click('管理')
     time.sleep(2)
     Command(Audio_Comm['DELETE_CLICK']).start()
     time.sleep(2)
     Command(Audio_Comm['DELETE_AUDIO']).start()
     time.sleep(1)
     Command('adb -host shell input tap 700 450').start()
     time.sleep(2)
     BaseAPI().back()
     status = checkfile.check_stauts('text="暂无音乐"')
     time.sleep(2)
     if status == True:
         logger.info('Delete the audio file is success')
         return True
     else:
         logger.debug('Delete the audio file is failed')
         return False
Пример #29
0
 def seek_player_mid(self):
     Command(Audio_Comm['SEEK_MID']).start()
     time.sleep(3)
     status = checkfile.check_stauts('text="00:34/01:00"')
     if status == True:
         logger.info('Seek the audio to middle is success')
     else:
         logger.error('Seek the audio to middle is failed')
         exit(1)
Пример #30
0
    def open_audio(self):
        Command(Audio_Comm['OPENAUDIO']).start()

        status = checkfile.check_stauts('text="音乐"')
        if status == True:
            logger.info('SUCCESS:open audio package is success')
        else:
            logger.debug('Failed:open audio package is failed')
            exit(1)