def do(self): ui_steps.open_settings_app( serial=self.serial, print_error="Error - Quick settings page was not displayed", view_to_find={"textContains": "Language"})() self.uidevice(text="Language").exists ui_steps.click_button(serial=self.serial, print_error="Error - Language was not displayed", blocking=True, view_to_find={"text": "Language"})()
def do(self): if self.intent: adb_steps.am_start_command( serial=self.serial, component="com.android.settings/.DisplaySettings")() else: ui_steps.open_settings_app(serial=self.serial, view_to_find={"text": "Display"}, view_to_check={"text": "Sleep"})() ui_steps.click_button(serial=self.serial, view_to_find={"text": "When device is rotated"}, view_to_check={"textContains": "Stay in"})() ui_steps.click_button(serial=self.serial, view_to_find={"textContains": "Stay in"})()
def do(self): if self.intent: adb_steps.am_start_command( serial=self.serial, component="com.android.settings/.DisplaySettings")() else: ui_steps.open_settings_app(serial=self.serial, view_to_find={"text": "Display"}, view_to_check={"text": "Sleep"})() if self.uidevice( resourceId="com.android.settings:id/switch_widget").exists: ui_steps.click_switch(serial=self.serial, view_to_find={ "resourceId": "com.android.settings:" "id/switch_widget" }, state="OFF")()
def do(self): if self.intent: adb_steps.am_start_command( serial=self.serial, component="com.android.settings/.Settings")() self.uidevice(text="Location").wait.exists(timeout=10000) ui_steps.click_button_with_scroll( serial=self.serial, view_to_find={"text": "Location"}, view_to_check={"text": "Mode"})() else: ui_steps.open_settings_app(serial=self.serial, view_to_find={"text": "Location"}, view_to_check={"text": "Mode"})() ui_steps.click_switch(serial=self.serial, view_to_find={ "resourceId": "com.android.settings:" "id/switch_widget" }, state="OFF")()
music_instance_no = 0 music_sqlite_field = "volume_music_speaker" ring_instance_no = 2 ring_sqlite_field = "volume_ring_speaker" alarm_instance_no = 1 alarm_sqlite_field = "volume_alarm_speaker" elif version == "K": music_instance_no = 0 music_sqlite_field = "volume_music_speaker" ring_instance_no = 1 ring_sqlite_field = "volume_ring_speaker" alarm_instance_no = 2 alarm_sqlite_field = "volume_alarm_speaker" ui_steps.open_settings_app(view_to_find={"textContains": "Sound"}, view_to_check={"text": "Sound"})() if version == "K": ui_steps.click_button( view_to_find={"text": "Volumes"}, view_to_check={"textContains": "Music, video, games"})() # notifications slider steps.move_volume_slider(view_to_find={ "className": 'android.widget.SeekBar', "instance": ring_instance_no }, position=0, db="/data/data/com.android.providers.settings" "/databases/settings.db", table="system", columns=["value"],
# @description: disable bluetooth from settings screen. # should be run after settings_start_bluetooth_slide.py # # @author: [email protected] # ############################################################################## from testlib.scripts.wireless.bluetooth import bluetooth_steps as bt_steps from testlib.scripts.android.ui import ui_steps from testlib.scripts.android.ui import ui_utils from testlib.scripts.android.adb import adb_steps from testlib.scripts.android.adb import adb_utils from testlib.utils.ui.uiandroid import UIDevice as ui_device import sys from testlib.base.base_utils import get_args globals().update(vars(get_args(sys.argv))) adb_steps.connect_device(serial=serial, port=adb_server_port)() globals().update({"version": adb_utils.get_android_version()}) ui_steps.open_settings_app(view_to_find={"text": "Bluetooth"}, view_to_check={"text": "Bluetooth"})() if ui_device(serial=serial)(text="On").exists: ui_steps.click_button(print_error="Failed to change BT state", blocking=True, view_to_find={"text": "On"}, view_to_check={"text": "Off"})() ui_steps.press_home()()
from testlib.scripts.android.ui import ui_utils from testlib.base.base_utils import get_args import sys ### initialization ### globals().update(vars(get_args(sys.argv))) # Setup part adb_steps.wake_up_device(serial=serial)() adb_steps.menu_to_unlock(serial=serial)() ui_steps.close_all_app_from_recent(serial=serial)() ui_steps.press_home(serial=serial)() # Testing the SVN (Software Version Number) Code through DUT UI ui_steps.open_settings_app(serial=serial, view_to_find={"text": "About phone"}, view_to_check={"text": "Status"})() ui_steps.click_button(serial=serial, view_to_find={"text": "Status"}, view_to_check={"text": "IMEI information"})() ui_steps.click_button(serial=serial, view_to_find={"text": "IMEI information"}, view_to_check={"text": "IMEI (Slot1)"})() imeiArray = ["004401521208153", "004401521208161"] # Verifying that the SV code from DUT UI exists and is 2 digits long for sv_code_index in range(1, (len(imeiArray) + 1)): sv_code = ui_utils.search_object_in_direction(serial=serial,
from testlib.scripts.android.ui import ui_steps from testlib.scripts.android.ui import ui_utils from testlib.scripts.android.adb import adb_steps from testlib.scripts.android.adb import adb_utils from testlib.scripts.android.ui.ui_step import step as ui_step import sys from testlib.base.base_utils import get_args globals().update(vars(get_args(sys.argv))) adb_steps.connect_device(serial=serial, port=adb_server_port)() globals().update({"version": adb_utils.get_android_version()}) ui_steps.open_settings_app( print_error="Error - Settings page was not displayed", blocking=True, view_to_find={"text": "Date & time"}, view_to_check={"text": "Automatic date & time"})() if ui_utils.is_checkbox_checked({"text": "Automatic date & time"}): ui_steps.click_button(print_error="Failed to open Automatic date & time", blocking=True, view_to_find={"text": "Automatic date & time"})() if version == "K": submit_text = "Done" elif version == "L": submit_text = "OK" ui_steps.click_button(print_error="Failed to open Set date", view_to_find={"text": "Set date"},