Пример #1
0
class SetTimeDate(UIATestBase):

    def setUp(self):
        super(SetTimeDate, self).setUp()
        self._test_name = __name__
        print
        print "[Setup]: %s" % self._test_name
        cfg_file = 'tests.tablet.dut_init.conf'
        self.retry_num = self.config.read(cfg_file,'init_list').get("set_system_date_and_time")
        self.retry_num = int(self.retry_num)
        self.func = Function()

    def tearDown(self):
        super(SetTimeDate, self).tearDown()
        print "[Teardown]: %s" % self._test_name

    def testSetTimeDate(self):
        """
        Set system date and time
        """
        print "[RunTest]: %s" % self.__str__()

        succeed = False
        for i in range(self.retry_num):
            try:
                self.func.set_timedate()
                succeed = True
                break
            except Exception as e:
                print e
        assert succeed
Пример #2
0
class DeployContent(UIATestBase):
    def setUp(self):
        self._test_name = __name__
        print
        print "[Setup]: %s" % self._test_name
        cfg_file = 'tests.tablet.dut_init.conf'
        self.location = self.config.read(cfg_file,
                                         'artifactory').get("location")
        self.content = self.config.read(cfg_file, 'artifactory').get("content")
        self.script = self.config.read(cfg_file,
                                       'deploy_script').get("script_file")
        self.retry_num = self.config.read(
            cfg_file, 'init_list').get("deploy_content_to_device")
        self.retry_num = int(self.retry_num)
        self.func = Function()

    def tearDown(self):
        print "[Teardown]: %s" % self._test_name

    def testDeployContent(self):
        """
        Deploy content files to device
        """
        print "[RunTest]: %s" % self.__str__()

        succeed = False
        for i in range(self.retry_num):
            try:
                self.func.deploy_content(self.location, self.content,
                                         self.script)
                succeed = True
                break
            except Exception as e:
                print e
        assert succeed
Пример #3
0
 def __init__(self):
     self.device = g_common_obj.get_device()
     self.func = Function()
     self.conf = TestConfig().read(section='wifisetting')
     self.ssid = self.conf.get("ssid")
     self.passwd = self.conf.get("passwd")
     self.security = self.conf.get("security")
class EnableDeveloperOption(UIATestBase):

    def setUp(self):
        super(EnableDeveloperOption, self).setUp()
        self._test_name = __name__
        print
        print "[Setup]: %s" % self._test_name
        cfg_file = 'tests.tablet.dut_init.conf'
        self.retry_num = self.config.read(cfg_file,'init_list').get("enable_developer_option")
        self.retry_num = int(self.retry_num)
        self.func = Function()

    def tearDown(self):
        super(EnableDeveloperOption, self).tearDown()
        print "[Teardown]: %s" % self._test_name

    def testEnableDeveloperOption(self):
        """
        Enable developer option
        """
        print "[RunTest]: %s" % self.__str__()

        succeed = False
        for i in range(self.retry_num):
            try:
                os.system("adb shell input keyevent 82;adb shell input keyevent 3")
                self.func.enable_developer_option()
                succeed = True
                break
            except Exception as e:
                print e
        assert succeed
Пример #5
0
class DisableLockScreen(UIATestBase):
    def setUp(self):
        super(DisableLockScreen, self).setUp()
        self._test_name = __name__
        print
        print "[Setup]: %s" % self._test_name
        cfg_file = 'tests.tablet.dut_init.conf'
        self.retry_num = self.config.read(
            cfg_file, 'init_list').get("disable_screen_lock")
        self.retry_num = int(self.retry_num)
        self.func = Function()

    def tearDown(self):
        super(DisableLockScreen, self).tearDown()
        print "[Teardown]: %s" % self._test_name

    def testDisableLockScreen(self):
        """
        Disable screen lock
        """
        print "[RunTest]: %s" % self.__str__()

        succeed = False
        for i in range(self.retry_num):
            try:
                os.system(
                    "adb shell input keyevent 82;adb shell input keyevent 3")
                self.func.close_lock_screen()
                succeed = True
                break
            except Exception as e:
                print e
        assert succeed
class SetLanguageUS(UIATestBase):
    def setUp(self):
        super(SetLanguageUS, self).setUp()
        self._test_name = __name__
        print
        print "[Setup]: %s" % self._test_name
        cfg_file = 'tests.tablet.dut_init.conf'
        self.retry_num = self.config.read(
            cfg_file, 'init_list').get("set_language_to_united_states")
        if self.retry_num is None:
            self.retry_num = 3
        self.retry_num = int(self.retry_num)
        self.func = Function()

    def tearDown(self):
        super(SetLanguageUS, self).tearDown()
        print "[Teardown]: %s" % self._test_name

    def testSetLanguageUS(self):
        """
        Set language to United States
        """
        print "[RunTest]: %s" % self.__str__()

        succeed = False
        for i in range(self.retry_num):
            try:
                self.func.set_language()
                succeed = True
                break
            except Exception as e:
                print e
        assert succeed
Пример #7
0
class InitYoutube(UIATestBase):
    def setUp(self):
        super(InitYoutube, self).setUp()
        self._test_name = __name__
        print
        print "[Setup]: %s" % self._test_name
        cfg_file = 'tests.tablet.dut_init.conf'
        self.retry_num = self.config.read(cfg_file,
                                          'init_list').get("init_youtube_app")
        self.retry_num = int(self.retry_num)
        self.func = Function()

    def tearDown(self):
        super(InitYoutube, self).tearDown()
        print "[Teardown]: %s" % self._test_name

    def testInitYoutube(self):
        """
        Init Youtube App
        """
        print "[RunTest]: %s" % self.__str__()

        succeed = False
        for i in range(self.retry_num):
            try:
                self.func.init_youtube()
                succeed = True
                break
            except Exception as e:
                print e
        assert succeed
Пример #8
0
class InitChrome(UIATestBase):

    def setUp(self):
        super(InitChrome, self).setUp()
        self._test_name = __name__
        print
        print "[Setup]: %s" % self._test_name
        cfg_file = 'tests.tablet.dut_init.conf'
        self.retry_num = self.config.read(cfg_file,'init_list').get("init_chrome_app")
        if self.retry_num is None:
            self.retry_num = 3
        self.retry_num = int(self.retry_num)
        self.func = Function()

    def tearDown(self):
        super(InitChrome, self).tearDown()
        print "[Teardown]: %s" % self._test_name

    def testInitChrome(self):
        """
        Init Chrome App
        """
        print "[RunTest]: %s" % self.__str__()

        succeed = False
        for i in range(self.retry_num):
            try:
                android_version_release = g_common_obj.adb_cmd_capture_msg("getprop |grep 'version.release'").split(':')[-1].strip()
                if (android_version_release == '[8.0.0]') or (android_version_release == '[8.1.0]'):
                    self.func.init_chrome()
                succeed = True
                break
            except Exception as e:
                print e
        assert succeed
Пример #9
0
class WakeUnlock(UIATestBase):

    def setUp(self):
        self._test_name = __name__
        print
        print "[Setup]: %s" % self._test_name
        cfg_file = 'tests.tablet.dut_init.conf'
        self.retry_num = self.config.read(cfg_file,'init_list').get("wake_up_and_unlock")
        self.retry_num = int(self.retry_num)
        self.func = Function()

    def tearDown(self):
        print "[Teardown]: %s" % self._test_name

    def testWakeUnlock(self):
        """
        Wake up and unlock screen
        """
        print "[RunTest]: %s" % self.__str__()

        succeed = False
        for i in range(self.retry_num):
            try:
                self.func.wake_up()
                succeed = True
                break
            except Exception as e:
                print e
        assert succeed
Пример #10
0
class ConnectWifi(UIATestBase):
    def setUp(self):
        self._test_name = __name__
        print
        print "[Setup]: %s" % self._test_name
        cfg_file = 'tests.tablet.dut_init.conf'
        self.conf = self.config.read(cfg_file, 'wifisetting')
        self.ssid = self.conf.get("ssid")
        self.passwd = self.conf.get("passwd")
        self.security = self.conf.get("security")
        self.retry_num = self.config.read(cfg_file,
                                          'init_list').get("connect_wifi")
        self.retry_num = int(self.retry_num)
        self.func = Function()

    def tearDown(self):
        print "[Teardown]: %s" % self._test_name

    def testConnectWifi(self):
        """
        Connect wifi
        """
        print "[RunTest]: %s" % self.__str__()

        succeed = False
        for i in range(self.retry_num):
            try:
                os.system(
                    "adb shell input keyevent 82;adb shell input keyevent 3")
                self.func.connect_AP(self.ssid, self.passwd, self.security)
                succeed = True
                break
            except Exception as e:
                print e
        assert succeed
Пример #11
0
class AdbRoot(UIATestBase):
    def setUp(self):
        super(AdbRoot, self).setUp()
        self._test_name = __name__
        print
        print "[Setup]: %s" % self._test_name
        cfg_file = 'tests.tablet.dut_init.conf'
        self.retry_num = self.config.read(
            cfg_file, 'init_list').get("switch_to_adb_root_mode")
        self.retry_num = int(self.retry_num)
        self.func = Function()

    def tearDown(self):
        super(AdbRoot, self).tearDown()
        print "[Teardown]: %s" % self._test_name

    def testAdbRoot(self):
        """
        Switch to adb root mode
        """
        print "[RunTest]: %s" % self.__str__()

        succeed = False
        for i in range(self.retry_num):
            try:
                self.func.root_DUT()
                succeed = True
                break
            except Exception as e:
                print e
        assert succeed
Пример #12
0
class KeepAwake(UIATestBase):
    def setUp(self):
        self._test_name = __name__
        print
        print "[Setup]: %s" % self._test_name
        cfg_file = 'tests.tablet.dut_init.conf'
        self.retry_num = self.config.read(cfg_file,
                                          'init_list').get("keep_awake")
        self.retry_num = int(self.retry_num)
        self.func = Function()

    def tearDown(self):
        print "[Teardown]: %s" % self._test_name

    def testKeepAwake(self):
        """
        Keep system stay awake
        """
        print "[RunTest]: %s" % self.__str__()

        succeed = False
        for i in range(self.retry_num):
            try:
                os.system(
                    "adb shell input keyevent 82;adb shell input keyevent 3")
                self.func.keep_awake()
                succeed = True
                break
            except Exception as e:
                print e
        assert succeed
Пример #13
0
class DeleteCameraFolderFile(UIATestBase):

    def setUp(self):
        super(DeleteCameraFolderFile, self).setUp()
        self._test_name = __name__
        print
        print "[Setup]: %s" % self._test_name
        cfg_file = 'tests.tablet.dut_init.conf'
        self.retry_num = self.config.read(cfg_file,'init_list').get("delete_camera_folder_file")
        if self.retry_num is None:
            self.retry_num = 3
        self.retry_num = int(self.retry_num)
        self.func = Function()

    def tearDown(self):
        super(DeleteCameraFolderFile, self).tearDown()
        print "[Teardown]: %s" % self._test_name

    def testDeleteCameraFolderFile(self):
        """
        delete all camera folder files
        """
        print "[RunTest]: %s" % self.__str__()

        succeed = False
        for i in range(self.retry_num):
            try:
                self.func.delete_camera_folder_file()
                succeed = True
                break
            except Exception as e:
                print e
        assert succeed
Пример #14
0
class FillInternalStorage(UIATestBase):

    def setUp(self):
        self._test_name = __name__
        print
        print "[Setup]: %s" % self._test_name
        cfg_file = 'tests.tablet.dut_init.conf'
        self.percent = self.config.read(cfg_file,'fill_internal_storage').get("percent")
        self.percent = int(self.percent)
        self.retry_num = self.config.read(cfg_file,'init_list').get("fill_internal_storage")
        self.retry_num = int(self.retry_num)
        self.func = Function()

    def tearDown(self):
        print "[Teardown]: %s" % self._test_name

    def testFillInternalStorage(self):
        """
        Fill internal storage
        """
        print "[RunTest]: %s" % self.__str__()

        succeed = False
        for i in range(self.retry_num):
            try:
                self.func.fill_internal_storage(self.percent)
                succeed = True
                break
            except Exception as e:
                print e
        assert succeed
Пример #15
0
 def setUp(self):
     super(ProvisionDevice, self).setUp()
     self._test_name = __name__
     self.function = Function()
     self.api = ApiImpl()
     self.api.unlock_screen()
     print "[Setup]: %s" % self._test_name
Пример #16
0
 def __init__(self):
     self.success = False
     self.d = g_common_obj.get_device()
     self.config = TestConfig()
     self.func = Function()
     cfg_file = 'tests.tablet.dut_init.conf'
     self.username = self.config.read(cfg_file, 'google_account').get("username")
     self.passwd = self.config.read(cfg_file, 'google_account').get("password")
Пример #17
0
 def setUp(self):
     self._test_name = __name__
     print
     print "[Setup]: %s" % self._test_name
     cfg_file = 'tests.tablet.dut_init.conf'
     self.retry_num = self.config.read(cfg_file,'init_list').get("wake_up_and_unlock")
     self.retry_num = int(self.retry_num)
     self.func = Function()
Пример #18
0
 def setUp(self):
     super(SetupManagedProfile, self).setUp()
     self.api = ApiImpl()
     self.function = Function()
     self.api.unlock_screen()
     self.api.clean_tasks()
     self._test_name = __name__
     print "[Setup]: %s" % self._test_name
Пример #19
0
 def setUp(self):
     super(InitPhotos, self).setUp()
     self._test_name = __name__
     print
     print "[Setup]: %s" % self._test_name
     cfg_file = 'tests.tablet.dut_init.conf'
     self.retry_num = self.config.read(cfg_file,'init_list').get("init_photo_app")
     self.retry_num = int(self.retry_num)
     self.func = Function()
Пример #20
0
 def setUp(self):
     super(SetTimeDate, self).setUp()
     self._test_name = __name__
     print
     print "[Setup]: %s" % self._test_name
     cfg_file = 'tests.tablet.dut_init.conf'
     self.retry_num = self.config.read(cfg_file,'init_list').get("set_system_date_and_time")
     self.retry_num = int(self.retry_num)
     self.func = Function()
Пример #21
0
 def setUp(self):
     super(EnableDeveloperOption, self).setUp()
     self._test_name = __name__
     print
     print "[Setup]: %s" % self._test_name
     cfg_file = 'tests.tablet.dut_init.conf'
     self.retry_num = self.config.read(cfg_file,'init_list').get("enable_developer_option")
     self.retry_num = int(self.retry_num)
     self.func = Function()
Пример #22
0
 def setUp(self):
     super(DisableVerifyApp, self).setUp()
     self._test_name = __name__
     print
     print "[Setup]: %s" % self._test_name
     cfg_file = 'tests.tablet.dut_init.conf'
     self.retry_num = self.config.read(
         cfg_file, 'init_list').get("disable_verify_apps")
     self.retry_num = int(self.retry_num)
     self.func = Function()
Пример #23
0
 def setUp(self):
     self._test_name = __name__
     print
     print "[Setup]: %s" % self._test_name
     cfg_file = 'tests.tablet.dut_init.conf'
     self.percent = self.config.read(cfg_file,'fill_internal_storage').get("percent")
     self.percent = int(self.percent)
     self.retry_num = self.config.read(cfg_file,'init_list').get("fill_internal_storage")
     self.retry_num = int(self.retry_num)
     self.func = Function()
Пример #24
0
 def setUp(self):
     super(AdbRoot, self).setUp()
     self._test_name = __name__
     print
     print "[Setup]: %s" % self._test_name
     cfg_file = 'tests.tablet.dut_init.conf'
     self.retry_num = self.config.read(
         cfg_file, 'init_list').get("switch_to_adb_root_mode")
     self.retry_num = int(self.retry_num)
     self.func = Function()
Пример #25
0
 def setUp(self):
     super(CheckGMSLauncher, self).setUp()
     self._test_name = __name__
     print
     print "[Setup]: %s" % self._test_name
     cfg_file = 'tests.tablet.dut_init.conf'
     self.retry_num = self.config.read(cfg_file,'init_list').get("check_gms_launcher")
     if self.retry_num is None:
         self.retry_num = 3
     self.retry_num = int(self.retry_num)
     self.func = Function()
Пример #26
0
 def setUp(self):
     super(DeleteCameraFolderFile, self).setUp()
     self._test_name = __name__
     print
     print "[Setup]: %s" % self._test_name
     cfg_file = 'tests.tablet.dut_init.conf'
     self.retry_num = self.config.read(cfg_file,'init_list').get("delete_camera_folder_file")
     if self.retry_num is None:
         self.retry_num = 3
     self.retry_num = int(self.retry_num)
     self.func = Function()
Пример #27
0
 def __init__(self):
     formatter = "[%(asctime)s - %(levelname)s] %(message)s"
     self.logger = Logger("Security", formatter)
     self.relay = None
     self.func = Function()
     self.cfg_file = "tests.tablet.security.conf"
     self.conf_path = os.path.join(os.environ.get('TEST_DATA_ROOT', ''),
                                   self.cfg_file)
     self.x = d.info["displayWidth"]
     self.y = d.info["displayHeight"]
     self.retry_num = 3
 def setUp(self):
     super(SetLanguageUS, self).setUp()
     self._test_name = __name__
     print
     print "[Setup]: %s" % self._test_name
     cfg_file = 'tests.tablet.dut_init.conf'
     self.retry_num = self.config.read(
         cfg_file, 'init_list').get("set_language_to_united_states")
     if self.retry_num is None:
         self.retry_num = 3
     self.retry_num = int(self.retry_num)
     self.func = Function()
Пример #29
0
 def setUp(self):
     super(InitPlayStore, self).setUp()
     self._test_name = __name__
     print
     print "[Setup]: %s" % self._test_name
     cfg_file = 'tests.tablet.dut_init.conf'
     self.retry_num = self.config.read(
         cfg_file, 'init_list').get("init_play_store_app")
     if self.retry_num is None:
         self.retry_num = 3
     self.retry_num = int(self.retry_num)
     self.func = Function()
Пример #30
0
 def setUp(self):
     super(UpgradeHangoutsApp, self).setUp()
     self._test_name = __name__
     print
     print "[Setup]: %s" % self._test_name
     cfg_file = 'tests.tablet.dut_init.conf'
     self.retry_num = self.config.read(
         cfg_file, 'init_list').get("upgrade_hangouts_app")
     if self.retry_num is None:
         self.retry_num = 3
     self.retry_num = int(self.retry_num)
     self.func = Function()