def main():
    try:

        BaseAPI().unlock()
        BaseAPI().setup()
        i = 0
        while i < 30:
            BaseAPI().find_setting()
            BTbase().disable_airplane()

            ##Turn on the airplane mode and Turn off  the airplane mode
            BaseAPI().find_setting()
            BTbase().enable_bt()
            time.sleep(1)
            BaseAPI().back()
            BTbase().enable_airplane()
            status = BTbase().bt()
            if status == True:
                logger.info('BT is still opened')
                logger.debug('open the airplane, cannot disable the bluetooth')
                exit(1)
            else:
                BaseAPI().back()
                time.sleep(1)
                BTbase().disable_airplane()
                status = BTbase().bt()
                if status == True:
                    logger.info(
                        'closed the airplane, opened the bluetooth is success')
                    BaseAPI().back()
            BaseAPI().exit_app()
            i += 1

    except Exception, msg:
        logger.debug('Exception:%s' % msg)
def main():
    stauts = True
    try:
        ########setup
        video.video_set_up('dayu.mp4')
        #####play video

        base.unlock()
        time.sleep(3)
        video.launch_video()
        time.sleep(1)
        video.check_push_video()
        i = 0
        while i < 100:
            video.play_video()
            video.cyclic_video()
            time.sleep(5)
            base.back()
            time.sleep(2)
            i += 1
            logger.info('current cycle is %d' % i)

        ##########
    except Exception, msg:
        logger.debug('Exception:%s' % msg)
        stauts = False
Example #3
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)
def main():
    stauts = True
    try:
        base.unlock()
        base.setup()
        wifi.wifi_setup()
        wifi.connect_wifi('YUNOS_Auto_Test_2G')
        for i in range(50):
            wifi.disable_wifi()
            time.sleep(5)
            wifi.enable_wifi()
            time.sleep(5)
            base.back()
            time.sleep(10)
            wifi.check_connect_enable()
            time.sleep(2)
            wifi.wlan_info()

            logger.info('************stress times is************ %d' % i)

##########################

    except Exception, msg:
        logger.debug('Exception:%s' % msg)
        stauts = False
def main():
    stauts = True
    try:
        base.unlock()
        base.setup()
        camera.opencamera()
        camera.camera_button()
        time.sleep(1)
        camera.check_camera_size()
        time.sleep(2)
        camera.teardown()
        base.exit_app()
        ###########take one minute video
        camera.opencamera()
        camera.video_button(90)
        i = 0
        while i <30:
            Command('adb -host shell input tap 623 700').start()
            logger.info('click the video button')
            time.sleep(60)
            Command('adb -host shell input tap 623 700').start()
            time.sleep(1)
            i+=1

        # camera.check_video_size()

    except Exception,msg:
        logger.debug('FAILED:%s'%msg)
        stauts = False
def main():
    #SETUP
    try:
        base.unlock()
        base.setup()

        #discovery and no discovery
        i = 0
        while i < 10:
            base.find_setting()
            bt.enable_bt()
            time.sleep(1)
            bt.start_discovery()
            time.sleep(1)
            bt.disable_bt()

            #######
            bt.enable_bt()
            bt.check_scanner()
            bt.stop_discovery()
            bt.disable_bt()
            ######
            bt.enable_bt()
            bt.stop_discovery()
            base.exit_app()
            i += 1
    except Exception, msg:
        logger.debug('Exception:%s' % msg)
Example #7
0
def main():
    stauts = True
    try:
        base.unlock()
        base.setup()
        base.find_setting()
        bt.disable_airplane()
        time.sleep(3)
        i = 0
        while i < 50:
            wifi.wifi_setup()
            wifi.connect_wifi('YUNOS_Auto_Test_2G')
            base.back()
            bt.enable_airplane()
            time.sleep(10)
            wifi.check_connect_disable()
            bt.disable_airplane()
            time.sleep(10)
            wifi.check_connect_enable()
            base.exit_app()
            i += 1
            logger.info('stress times is %d' % i)
    ##########################

    except Exception, msg:
        logger.debug('Exception:%s' % msg)
        stauts = False
def main():
    stauts = True
    try:
        ########setup
        video.video_set_up('dayu.mp4')
        #####play video
        base.unlock()
        time.sleep(3)
        video.launch_video()
        time.sleep(1)
        video.check_push_video()
        video.play_video()
        time.sleep(5)
        video.cyclic_video()
        i = 0
        while i < 100:
            time.sleep(1)
            base.screen_on()
            time.sleep(1)
            base.screen_on()
            base.unlock()
            i += 1
            logger.info('poweroff_screen try: %d' % (i))
        ##########
    except Exception, msg:
        logger.debug('Exception:%s' % msg)
        stauts = False
Example #9
0
def main():
    #SETUP
    try:
        base.unlock()
        base.setup()

        #Change the adapter name.
        base.find_setting()
        bt.enable_bt()
        bt.change_adapter_name('YUNOS')
        base.back()
        bt.disable_bt()

        ###########disable and enable bt
        base.back()
        bt.enable_bt()
        bt.check_adapter_name('text="YUNOS"')

        #########################
        bt.start_scanner()
        bt.stop_scanner()
        bt.check_adapter_name('text="YUNOS"')
        time.sleep(1)
        bt.revert_adapter_name()

    except Exception, msg:
        logger.debug('Exception:%s' % msg)
Example #10
0
 def pause_resume_player(self):
     try:
         self.play_all()
         self.check_pause()
         self.play_button()
     except Exception, msg:
         logger.debug('FAILED:%s' % msg)
         exit(1)
Example #11
0
 def input_address(self):
     try:
         self.lanuch_browser()
         checkfile.click('text="请输入网址或搜索"')
         time.sleep(1)
     except Exception, msg:
         logger.debug("Exception: %s" % msg)
         exit(1)
def main():
    #SETUP
    try:
        BaseAPI().unlock()
        BaseAPI().setup()

    except Exception, msg:
        logger.debug('FAILED:%s' % msg)
Example #13
0
def main():
    stauts = True
    try:
        gfx.set_up('YUNOS_Auto_Test_2G')
        gfx.address_3()
    except Exception, msg:
        logger.debug('Exception:%s' % msg)
        stauts = False
Example #14
0
 def seek_player(self):
     try:
         self.seek__player_start()
         self.seek_player_end()
         self.seek_player_mid()
     except Exception, msg:
         logger.debug('FAILED:%s' % msg)
         exit(1)
Example #15
0
def main():
    #SETUP
    try:
        base.unlock()
        base.setup()

    except Exception, msg:
        logger.debug('FAILED:%s' % msg)
Example #16
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)
def main():
    try:
        base.unlock()
        base.setup()
        base.find_setting()
        BTbase().enable_bt()

    except Exception, msg:
        logger.debug('FAILED:%s' % msg)
def main():
    try:
        BaseAPI().unlock()
        BaseAPI().setup()
        BaseAPI().find_setting()
        BTbase().disable_airplane()

    except Exception, msg:
        logger.debug('FAILED:%s' % msg)
Example #19
0
    def check_audio(self):
        time.sleep(2)
        status = checkfile.check_stauts('text="无音乐"')

        if status == False:
            logger.info('SUCCESS:push audio file is success')
        else:
            logger.debug('Fail:push audio file is failed')
            exit(1)
Example #20
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)
Example #21
0
def main():

    Audiobase().audio_set_up()
    ####playaudio
    base.unlock()
    status = play_audio_pause_seek()
    if status == True:
        logger.info('play mp3 is succes')
    else:
        logger.debug('play mp3 is failed')
Example #22
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)
def main():
    stauts = True
    try:
        for i in command_list:
            Command(i).start()
            logger.info(i)
        check_testrun()
    except Exception, msg:
        logger.debug('Exception:%s' % msg)
        stauts = False
def main():
    try:
        base.unlock()
        base.setup()
        camera.opencamera()
        camera.check_video(20)
        check_videoformat()

    except Exception, msg:
        logger.debug('FAILED:%s' % msg)
Example #25
0
 def video_set_up(self, *args):
     status = True
     try:
         BaseAPI().unlock()
         BaseAPI().setup()
         videobase().push_video_file(*args)
         BaseAPI().reboot_version1()
     except Exception, msg:
         logger.debug('FAILED:%s' % msg)
         status = False
         exit(1)
Example #26
0
 def input_address(self):
     try:
         self.lanuch_browser()
         status=checkfile.check_stauts('text="允许"')
         if status == True:
             checkfile.click('text="允许"')
         checkfile.click('text="搜索或输入网址"')
         time.sleep(1)
     except Exception,msg:
            logger.debug("Exception: %s" % msg)
            exit(1)
def play_audio_pause_seek():
    status =True
    try:
        Audiobase().open_audio()
        Audiobase().check_audio()
        Audiobase().pause_resume_player()
        Audiobase().seek_player()

    except Exception,msg:
        logger.debug('FAILED:%s'%msg)
        status = False
Example #28
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')
Example #29
0
def main():
    stauts = True
    try:
        ########set up
        BaseAPI().unlock()
        BaseAPI().setup()
        ###recorder sounds
        Recorbase().launch_recor_package()
        Recorbase().recorder_cycle(3)
    except Exception, msg:
        logger.debug('Exception:%s' % msg)
        stauts = False
def main():
    #SETUP
    try:
        base.unlock()
        base.setup()

        #enable and disable bluetooth
        base.find_setting()
        enable_disable_scan(10)

    except Exception, msg:
        logger.debug('Exception:%s' % msg)