Esempio n. 1
0
 def do(self):
     adb_steps.am_start_command(
         serial=self.serial, component="com.android.settings/.Settings")()
     ui_steps.click_button_with_scroll(
         serial=self.serial,
         view_to_find={"textContains": "Backup"},
         view_to_check={"text": "Factory data reset"})()
     ui_steps.click_button(serial=self.serial,
                           view_to_find={"text": "Factory data reset"},
                           view_to_check={"text": self.reset_button_text})()
     ui_steps.click_button(serial=self.serial,
                           view_to_find={"text": self.reset_button_text},
                           view_to_check={"text": "Erase everything"})()
     ui_steps.click_button(serial=self.serial,
                           view_to_find={"text": "Erase everything"})()
     adb_steps.check_device_reboots(serial=self.serial,
                                    reboot_timeout=self.reboot_timeout)()
adb_steps.menu_to_unlock(serial=serial, blocking=True)()
ui_steps.close_all_app_from_recent(serial=serial, blocking=True)()
telephony_steps.set_sim_pin(serial=serial,
                            state="ON",
                            pin=sim_pin,
                            blocking=True)()
telephony_steps.check_pin_is_requested(serial=serial,
                                       pin=sim_pin,
                                       blocking=True)()
telephony_steps.enter_pin(serial=serial, pin=sim_pin, blocking=True)()

for i in range(iterations):
    adb_steps.root_connect_device(serial=serial)()
    adb_steps.command(serial=serial, command="mount -t debugfs none /d")()
    adb_steps.command(serial=serial, command="echo c > /proc/sysrq-trigger")()
    adb_steps.check_device_reboots(serial=serial, reboot_timeout=120)()
    local_steps.wait_for_adb(serial=serial, reboot_timeout=120)()
    adb_steps.wait_for_ui(serial=serial,
                          boot_to_Android=False,
                          sim_pin_enabled=True)()
    telephony_steps.check_pin_is_requested(serial=serial,
                                           enabled_pin=False,
                                           with_reboot=False)()
    telephony_steps.open_messenger(serial=serial)()
    telephony_steps.send_sms(
        number=number,
        content=sms_test_content,
        view_to_check={
            "resourceId":
            "com.google.android.apps.messaging:id/message_status",
            "text": "Sent."