Exemple #1
0
    def check_condition(self):
        # Unlock device
        ui_steps.wake_up_device(serial=self.serial)()
        ui_steps.unlock_device(serial=self.serial)()

        # Check if the app is NOT displayed in normal mode
        ui_steps.find_app_from_allapps(serial=self.serial,
                                       view_to_find={"text": self.app_to_find},
                                       presence=False)()
        return True
# Run Prerequisites
prerequisites.run_prereq(serial = serial,
                         pin = "1234",
                         set_wifi = True,
                         ap_name = "sp_gpt",
                         ap_password = "******")()

ui_steps.press_home(serial = serial)()
ui_steps.disable_options_from_developer_options(serial = serial,
                                                developer_options =
                                                ["Verify apps over USB"],
                                                blocking = True)()

# Install any application
adb_steps.install_apk(serial = serial, apk_path = widevine_apk)()

# Create a new user
ui_steps.create_new_user(serial = serial,
                         set_up_user = True,
                         user_name = "New user")()

# Check if user has access to Owner's application
ui_steps.find_app_from_allapps(serial = serial,
                               presence = False,
                               view_to_find = {"textContains": "ExoPlayer"})()

### Remake initial state #####
ui_steps.switch_user(serial = serial, user_name = "Owner")()
ui_steps.remove_user(serial = serial, user_name = "New user")()
Exemple #3
0
 def check_condition(self):
     self.step_data = ui_steps.find_app_from_allapps(
         serial=self.serial,
         view_to_find={"text": self.app_to_find},
         presence=False)()
     return self.step_data
Exemple #4
0
relay_type = args["relay_type"]
relay_port = args["relay_port"]
power_port = args["power_port"]
app_to_find = args["app_to_find"]

# Test start #
relay_steps.reboot_main_os(serial=serial,
                           relay_type=relay_type,
                           relay_port=relay_port,
                           power_port=power_port)()

ui_steps.wake_up_device(serial=serial)()
ui_steps.unlock_device(serial=serial)()

# Reboot in safe mode
relay_steps.reboot_safe_mode(serial=serial,
                             app_to_find=app_to_find,
                             relay_type=relay_type,
                             relay_port=relay_port,
                             power_port=power_port)()

# Reboot in normal mode
adb_steps.reboot(serial=serial)()

# Check the app is displayed in normal mode
ui_steps.find_app_from_allapps(serial=serial,
                               view_to_find={"text": app_to_find},
                               presence=True)()

# Test end #