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
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
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
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
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
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
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
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
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
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
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
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
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
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")
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 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
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()
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 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 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()
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 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 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()
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 __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()
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()
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()