Esempio n. 1
0
 def __init__(self, **kwargs):
     android_step.__init__(self, **kwargs)
     self.platform_name = fastboot_utils.get_platform_name(
         serial=self.serial)
     self.o_platform_list = ["o_celadon", "o_cel_apl"]
     self.p_platform_list = ["p_cel_apl"]
     self.o_partition_list = [
         "boot", "bootloader", "multiboot", "system", "tos", "vbmeta",
         "vendor"
     ]
Esempio n. 2
0
    config.read("./temp/fastboot.conf")
    fastboot_path = config.get("fastboot", "path")

    test_apk_path = config.get("files", "test_apk")
    test_apk_name = test_apk_path.split("/")[-1]
    fastboot_utils.download_file(url=fastboot_path + test_apk_path,
                                 local_filename="./temp/files/resources/" +
                                 test_apk_name)

    fastboot_utils.push_uiautomator_jar(serial=serial)  # noqa
    fastboot_steps.config_first_boot_wizard(serial=serial)()  # noqa

    adb_steps.connect_device(serial=serial)()  # noqa
    adb_steps.root_connect_device(serial=serial)()  # noqa
    time.sleep(5)
    platform_name = fastboot_utils.get_platform_name(serial=serial)  # noqa
    install_command = "adb -s {0} install ./temp/files/resources/{1}  > ./temp/files/temp.txt 2>&1".format(
        serial, test_apk_name)  # noqa
    os.system(install_command)
    return_result = fastboot_utils.adb_install_apk(
        platform_name=platform_name, file_path="./temp/files/temp.txt")

    if not return_result:
        raise Exception("The test result did not achieve the desired results")

    fastboot_steps.factory_data_reset(serial=serial)()  # noqa
    adb_steps.connect_device(serial=serial)()  # noqa
    adb_steps.root_connect_device(serial=serial)()  # noqa
    time.sleep(5)
    file_exists = fastboot_utils.adb_command_file_or_directory_exists(
        name=test_apk_name[:-4], command="adb shell ls /data/app")