Beispiel #1
0
 def do(self):
     press_car(serial=self.serial)()
     open_settings(serial=self.serial)()
     ui_steps.click_button_common(
         serial=self.serial,
         view_to_find={"text": "Security & location"},
         view_to_check={"textMatches": "Screen lock"})()
Beispiel #2
0
 def do(self):
     try:
         if not ui_steps.click_button_common(
                 serial=self.serial,
                 view_to_find={"textContains": "Scan for Devices"},
                 scroll=False)():
             raise Exception(
                 "Scan for Devices object not found in menu list")
         if ui_steps.wait_for_view_common(
                 serial=self.serial,
                 view_to_find={"textContains": self.dev_name})():
             ui_steps.click_button_common(
                 serial=self.serial,
                 view_to_find={"textContains": self.dev_name},
                 view_to_check={"resourceId": "android:id/alertTitle"})()
             time.sleep(1)
             if not bluetooth_steps.PerformActionPairRequest(
                     serial=self.serial, action="Pair")():
                 raise Exception("Pair button not found in DUT list")
             if not bluetooth_steps.PerformActionPairRequest(
                     serial=self.serial_dev, action="Pair")():
                 raise Exception("Pair button not found in DEV list")
             time.sleep(10)
         else:
             self.step_data = False
     except Exception, e:
         self.set_errorm("CTS Verifier connection error", e.message)
         self.step_data = False
Beispiel #3
0
 def do(self):
     if self.device_info.all_apps_icon is None:
         ui_steps.press_media(serial=self.serial)()
         ui_steps.click_button_common(serial=self.serial,
                                      view_to_find=self.view_to_find)()
     else:
         ui_steps.open_app_from_allapps(serial=self.serial,
                                        view_to_find=self.view_to_find)
Beispiel #4
0
 def check_condition(self):
     if self.intent:
         return True
     ui_steps.open_settings(serial=self.serial)()
     ui_steps.click_button_common(serial=self.serial,
                                  view_to_find={"text": "System"},
                                  optional=True)()
     ui_steps.click_button_common(view_to_find={"textContains": "Advanced"},
                                  serial=self.serial)()
     return self.uidevice(text="Developer options").wait.exists(
         timeout=1000)
Beispiel #5
0
 def do(self):
     try:
         if not self.list.wait.exists(timeout=self.timeout_appear):
             raise Exception("cts objects list was not found")
         # scroll here to reveal scanning progressbar
         if not self.list.scroll.to(text="Bluetooth Test"):
             raise Exception(
                 "NETWORKING/Bluetooth Test title was not found in BT list")
         self.uidevice(text="Bluetooth Test").click()
         if self.uidevice(text="OK").wait.exists(timeout=self.timeout):
             self.uidevice(text="OK").click()
         if not self.uidevice(text="Secure Client").wait.exists(
                 timeout=self.timeout):
             raise Exception(
                 "Secure Client Test object not found in menu list")
         self.uidevice(text="Secure Client").click()
         #if not self.uidevice(text="Scan for Devices").wait.exists(timeout=self.timeout):
         #    raise Exception("Scan for Devices object not found in menu list")
         #self.uidevice(text="Scan for Devices").click()
         if not ui_steps.click_button_common(
                 serial=self.serial,
                 view_to_find={"textContains": "Scan for Devices"},
                 scroll=False)():
             raise Exception(
                 "Scan for Devices object not found in menu list")
     except Exception, e:
         self.set_errorm(" CTS Verifier scanning error", e.message)
         self.step_data = False
 def do(self):
     try:
         if not ui_steps.click_button_common(
                 serial=self.serial,
                 view_to_find={"textContains": "Scan for Devices"},
                 scroll=False)():
             raise Exception(
                 "Scan for Devices object not found in menu list")
         if ui_steps.wait_for_view_common(
                 serial=self.serial,
                 view_to_find={"textContains": self.dev_name})():
             ui_steps.click_button_common(
                 serial=self.serial,
                 view_to_find={"textContains": self.dev_name},
                 view_to_check={"textContains": "SENT MESSAGES"})()
             time.sleep(10)
         else:
             self.step_data = False
     except Exception, e:
         self.set_errorm("CTS Verifier connection error", e.message)
         self.step_data = False
Beispiel #7
0
 def do(self):
     ui_steps.open_users_settings(serial=self.serial)()
     ui_steps.click_button_common(serial=self.serial,
                                  view_to_find={"text": "Add user"})()
     ui_steps.click_button_common(serial=self.serial,
                                  view_to_find={"text": "OK"})()
     ui_steps.click_button_common(view_to_find={"text": "NOT NOW"},
                                  serial=self.serial)()
     self.step_data = True
Beispiel #8
0
 def do(self):
     ui_steps.open_users_settings(serial=self.serial)()
     ui_steps.click_button_common(
         serial=self.serial,
         view_to_find={"text": self.user_name},
         second_view_to_find={
             "resourceId": "com.android.settings:id/manage_user"
         },
         view_to_check={"textContains": "Remove user"},
         optional=True)()
     ui_steps.click_button_common(serial=self.serial,
                                  view_to_find={"text": "Remove user"})()
     ui_steps.click_button_common(serial=self.serial,
                                  view_to_find={"textContains": "DELETE"})()
     self.step_data = True
Beispiel #9
0
 def do(self):
     if self.intent:
         ui_steps.am_start_command(
             serial=self.serial,
             component="com.android.settings/.DevelopmentSettings")()
     else:
         ui_steps.open_settings(serial=self.serial)()
         ui_steps.click_button_common(serial=self.serial,
                                      view_to_find={"text": "System"},
                                      optional=True)()
         ui_steps.click_button_common(
             serial=self.serial,
             view_to_find={"textContains": "About "},
             view_to_check={"text": "Build number"})()
         for i in range(7):
             ui_steps.click_button_common(
                 serial=self.serial, view_to_find={"text":
                                                   "Build number"})()
	wifi_steps.ping_gateway(serial = serial, trycount=10, timeout=30)()

        #wait for ap2 ssid from the list
	ui_steps.wait_for_view_with_scroll(view_to_find={"textContains": ddwrt_ap2_name}, timeout=1000, serial=serial)()
	#connect wifi to AP2
	wifi_steps.connect_wifi_from_UI(ap_name=ddwrt_ap2_name,scroll = True,
                                          password=ddwrt_ap2_pass,open_wifi_settings=False,
                                          serial=serial)()
        #ping to gateway
        wifi_steps.ping_gateway(serial=serial, trycount=10, timeout=30)()

	#Once DUt is connected to AP2, AP1 status on DUT should be saved
	ui_steps.wait_for_view_common(serial=serial, timeout=30000,view_to_find={"textContains": ddwrt_ap1_name},
                                   optional=False, second_view_to_find={"textMatches":"Saved"})()
	#Tap on first ap , this should connect to first ap with out providing the security key
	ui_steps.click_button_common(serial=serial, view_to_find={"textMatches":ddwrt_ap1_name})()
        time.sleep(3)
        wifi_steps.ping_gateway(serial=serial, trycount=10, timeout=30)()

	ui_steps.wait_for_view_with_scroll(view_to_find={"textContains": "Forget"},timeout=1000 ,serial = serial)()
	ui_steps.click_button_common(serial=serial, view_to_find={"textMatches": "Forget"})()
	#clean up to go to next iteration
        wifi_steps.forget_wifi_network(serial=serial,ap_name=ddwrt_ap1_name)()
	i = i-1

elif scenario == "check_password" :
        """ To test - general behaviour test - Show wifi password"""
        #connect device to AP , while entering password, password should be displayed .
        wifi_steps.connect_with_password(ap_name = ddwrt_ap1_name,scroll= True,open_settings=False,password = ddwrt_ap1_pass,show_password=True,serial=serial)()
        time.sleep(2)
        #ping from device to gateway
Beispiel #11
0
args = {}
for entry in script_args:
    key, val = entry.split("=")
    args[key] = val

# Setup to remove existing new users
while not ui_steps.remove_user(
        user_name="New user", optional=True, serial=serial)():
    break

ui_steps.press_home(serial=serial)()
ui_steps.press_car(serial=serial)()
ui_steps.open_settings(serial=serial)()

ui_steps.click_button_common(view_to_find={"text": "Security & location"},
                             view_to_check={"text": "Screen lock"},
                             serial=serial)()
ui_steps.click_button_common(view_to_find={"text": "Screen lock"},
                             serial=serial)()
ui_steps.click_button_common(view_to_find={"text": "Password"},
                             serial=serial)()
ui_steps.edit_text(
    view_to_find={"resourceId": "com.android.settings:id/password_entry"},
    value="qwer",
    is_password=True,
    serial=serial)()
ui_steps.click_button_if_exists(
    view_to_find={"text": "NEXT"},
    view_to_check={"text": "Re-enter your password"},
    serial=serial)()
ui_steps.edit_text(
Beispiel #12
0
                                     check_if_already=True,
                                     disable_profile_confirm=True,
                                     version=DUT_VERSION)()
        bluetooth_steps.BtSetService(serial=serial,
                                     paired_device_name=PAIRING_DEV_NAME,
                                     state=True,
                                     service="Contact sharing",
                                     check_if_already=False,
                                     disable_profile_confirm=True,
                                     version=DUT_VERSION)()
        ui_steps.press_car(serial=serial)()
        if not ui_steps.wait_for_view_common(
                serial=serial, view_to_find={"textContains": "Contacts"})():
            ui_steps.press_car(serial=serial)()
        if not ui_steps.click_button_common(
                serial=serial,
                view_to_find={"textContains": "Contacts"},
                view_to_check={"className": "android.widget.TextView"})():
            raise Exception("Contacts list not found")

    if action_initiator == "SyncContactDevice2":
        bluetooth_steps.ClickBluetoothSwitch(serial=serial,
                                             state="ON",
                                             version=DUT_VERSION)()
        bt_utils.bt_pair_devices(
            serial=serial,
            dev=serial_dev,
            dut_name=DUT_NAME,
            dev_name=PAIRING_DEV_NAME,
            action_dut=action_dut,
            action_dev=action_dev,
            perform_action_first_on_initiator=action_initiator_first,
Beispiel #13
0
     dev=serial_dev,
     dut_name=DUT_NAME,
     dev_name=PAIRING_DEV_NAME,
     action_dut=action_dut,
     action_dev=action_dev,
     perform_action_first_on_initiator=action_initiator_first,
     pair_request_initiator=initiator,
     scan_timeout=scan_timeout,
     scan_max_attempts=scan_max_attempts,
     time_to_wait_timeout_action=timeout_time,
     version_dut=DUT_VERSION,
     version_dev=DEV_VERSION)
 ui_steps.open_app_from_allapps(serial=serial_dev,
                                view_to_find={"text": "Play Music"})()
 ui_steps.click_button_common(
     serial=serial_dev,
     view_to_find={"description": "Show navigation drawer"},
     view_to_check={"text": "Music library"})()
 ui_steps.click_button_common(serial=serial_dev,
                              view_to_find={"text": "Music library"},
                              view_to_check={"textContains": "SONGS"})()
 ui_steps.click_button_common(
     serial=serial_dev,
     view_to_find={"textContains": "SONGS"},
     view_to_check={"className": "android.widget.LinearLayout"})()
 if not ui_steps.click_button_common(
         serial=serial_dev,
         view_to_find={"resourceId": "com.google.android.music:id/pause"},
         optional=True,
         scroll=False)():
     ui_steps.click_button_common(
         serial=serial_dev,
Beispiel #14
0
    testlib_log_path = os.path.dirname(testlib.__file__) + "/logs/"

log = logger.testlib_log(log_path=testlib_log_path, log_name="testlib_default")

serial = None
script_args = None

# ############# Get parameters ############
args = parse_args()

dessert = statics.get_dessert(serial=args["serial"])

if dessert == "P":
    ui_steps.PressNotification(serial=args["serial"])()
    ui_steps.click_button_common(
        view_to_find={"resourceId": "com.android.systemui:id/settings_button"},
        serial=args["serial"])()
    ui_steps.click_button_common(view_to_find={"text": "More"},
                                 serial=args["serial"])()
    Settings_not_found = []
    Settings_to_check = {
        "Display", "Sound", "Wi‑Fi", "Bluetooth", "App info", "Date & time",
        "Users", "Accounts", "Security", "System"
    }
    for find in Settings_to_check:
        try:
            ui_steps.wait_for_view_common(view_to_find={"text": find},
                                          serial=args["serial"])()
        except:
            Settings_not_found.append(find)
            log.info(find + " option is not available in IVI settings")
bt_utils.bt_pair_devices(serial=serial,
                         dev=serial2,
                         dut_name=DUT_NAME,
                         dev_name=DEV_MAC_ADDRESS,
                         version_dut=DUT_VERSION,
                         version_dev=DEV_VERSION,
                         scan_max_attempts=3)

# Run
ui_steps.press_home(serial=serial)()
ui_steps.press_car(serial=serial)()
ui_steps.press_dialer(serial=serial)()

ui_steps.click_button_common(
    view_to_find={"text": "Phone"},
    second_view_to_find={"className": "android.widget.ImageButton"},
    serial=serial)()
ui_steps.click_button_common(view_to_find={"text": "Call History"},
                             view_to_check={"text": "Call History"},
                             serial=serial)()
ui_steps.click_button_common(
    view_to_find={"className": "android.widget.LinearLayout"},
    second_view_to_find={"index": "0"},
    view_to_check={"text": "Dialing"},
    serial=serial)()

#Tear Down
ui_steps.click_button(view_to_find={"className": "android.widget.ImageButton"},
                      view_to_check={"text": "Phone"},
                      serial=serial)()
Beispiel #16
0
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions
and limitations under the License.
?

SPDX-License-Identifier: Apache-2.0
"""

# Used defined libraries
from testlib.base.base_utils import parse_args
from testlib.scripts.android.ui import ui_steps

# ############# Get parameters ############
args = parse_args()

ui_steps.press_home(serial=args["serial"])()
ui_steps.press_car(serial=args["serial"])()
ui_steps.open_settings(serial=args["serial"])()
ui_steps.click_button_common(view_to_find={"text": "System"},
                             view_to_check={"textContains": "Languages"},
                             serial=args["serial"])()
ui_steps.click_button_common(view_to_find={"text": "About phone"},
                             view_to_check={"text": "Status"},
                             serial=args["serial"])()

print ui_steps.wait_for_view_common(view_to_find={"text": "Kernel version"},
                                    second_view_to_find={"className": "android.widget.TextView"},
                                    position="down",
                                    retrieve_info=True,
                                    serial=args["serial"])()["text"]
Beispiel #17
0
import time
from testlib.scripts.wireless.bluetooth.bt_step import Step as BtStep
from testlib.scripts.android.ui import ui_steps
####################################
globals().update(vars(get_args(sys.argv)))
args = {}
for entry in script_args:
    key, val = entry.split("=")
    args[key] = val

ui_steps.press_home(serial=serial)()
ui_steps.press_car(serial=serial)()
ui_steps.press_dialer(serial=serial)()


ui_steps.click_button_common( view_to_find={'text':"Phone"}, second_view_to_find={"className":"android.widget.ImageButton"},serial=serial)()

time.sleep(5)
#input the numbers through dialpad

ui_steps.click_button_common(view_to_find={"text":"Dial a number"},view_to_check={"text":"Dial a number"},serial=serial)()
ui_steps.click_button_common(view_to_find={"text":"1"},view_to_check={"text":"1"},serial=serial)()
ui_steps.click_button_common(view_to_find={"text":"2"},view_to_check={"text":"2"},serial=serial)()
ui_steps.click_button_common(view_to_find={"text":"3"},view_to_check={"text":"3"},serial=serial)()
ui_steps.click_button_common(view_to_find={"text":"4"},view_to_check={"text":"4"},serial=serial)()
ui_steps.click_button_common(view_to_find={"text":"5"},view_to_check={"text":"5"},serial=serial)()
ui_steps.click_button_common(view_to_find={"text":"6"},view_to_check={"text":"6"},serial=serial)()

ui_steps.click_button_common(view_to_find={"text":"7"},view_to_check= {"text":"123-4567"},serial=serial)()
#d(resourceId="com.android.car.dialer:id/number").clear_text()
ui_steps.click_button_common(view_to_find={"resourceId":"com.android.car.dialer:id/exit_dialer_button"},view_to_check={"text":"Phone"},serial=serial)()
Beispiel #18
0
    # ensure the device is unlocked
    ui_steps.unlock_device(serial=device, pin=wifi_defaults.wifi['pin'])()

    # go to home screen
    ui_steps.press_home(serial=device)()

    #Launch  menu
    ui_steps.press_all_apps(serial=device)()

    #Open FTP server app
    ui_steps.open_app_from_allapps(serial=device,
                                   view_to_find={"text": "Ftp server"})()
    time.sleep(3)

    ui_steps.click_button_common(serial=device,
                                 view_to_find={"text": "ALLOW"},
                                 optional=True)()

    #Start FTP server of the APP
    ui_steps.click_button(
        serial=device,
        view_to_find={
            "resourceId": "com.theolivetree.ftpserver:id/imageView1"
        },
        view_to_check={"textContains": "Press button to stop ftp server"})()

    time.sleep(3)
    # Check of the device connection is established
    wifi_generic_steps.check_connection_info(serial=device,
                                             state='CONNECTED/CONNECTED')()
from testlib.scripts.android.adb import adb_steps
from testlib.scripts.android.ui import ui_steps

# ############# Get parameters ############

globals().update(vars(get_args(sys.argv)))
args = {}
for entry in script_args:
    key, val = entry.split("=")
    args[key] = val

#Check for Third-party licenses
ui_steps.press_home(serial=serial)()
ui_steps.open_settings(serial=serial)()
ui_steps.click_button_common(view_to_find={"text": "System"},
                             view_to_check={"text": "About phone"},
                             serial=serial)()
ui_steps.click_button_common(view_to_find={"text": "About phone"},
                             view_to_check={"text": "Legal information"},
                             serial=serial)()
ui_steps.click_button_common(view_to_find={"text": "Legal information"},
                             view_to_check={"text": "Third-party licenses"},
                             serial=serial)()
ui_steps.click_button_common(view_to_find={"text": "Third-party licenses"},
                             serial=serial)()

#Check for system WebView licenses
ui_steps.press_home(serial=serial)()
ui_steps.open_settings(serial=serial)()
ui_steps.click_button_common(view_to_find={"text": "System"},
                             view_to_check={"text": "About phone"},
# ############# Get parameters ############

globals().update(vars(get_args(sys.argv)))
args = {}
for entry in script_args:
    key, val = entry.split("=")
    args[key] = val


while not ui_steps.remove_user(user_name="New user",optional=True, serial=serial)():
    break
#Setup
ui_steps.open_settings(serial=serial)()
ui_steps.click_button_with_scroll(view_to_find={"text":"Users & accounts"},view_to_check={"text":"Users"},serial=serial)()
ui_steps.click_button_common(view_to_find={"text":"Users"},view_to_check={"text":"Add user or profile"},serial=serial)()
ui_steps.click_button_common(view_to_find={"text":"Admin"},serial=serial)()
ui_steps.press_home(serial=serial)()
ui_steps.open_settings(serial=serial)()
ui_steps.click_button_common(view_to_find={"text":"System"},view_to_check={"text":"Date & time"},serial=serial)()
ui_steps.click_button_common(view_to_find={"text":"Date & time"},view_to_check={"text":"Automatic date & time"},serial=serial)()

if not ui_steps.click_button_common(view_to_find = {"text":"Use 24-hour format"}, second_view_to_find={"className": "android.widget.Switch", "text": "OFF"},view_to_check = {"text": "ON"},optional= True, serial=serial)():
    ui_steps.click_button_common(view_to_find={"text": "Use 24-hour format"},
                                        second_view_to_find={"className": "android.widget.Switch", "text": "ON"},
                                        view_to_check={"text": "OFF"}, serial=serial)()


#change to owner will enable 24hors format

ui_steps.open_settings(serial=serial)()
Beispiel #21
0
# Used defined libraries
from testlib.base.base_utils import get_args

from testlib.scripts.wireless.wifi_generic import wifi_generic_steps
f
from testlib.scripts.android.ui import ui_steps

# ############# Get parameters ############

globals().update(vars(get_args(sys.argv)))
args = {}
for entry in script_args:
    key, val = entry.split("=")
    args[key] = val

#main step
ui_steps.press_home(serial=serial)()

ui_steps.open_settings(serial=serial)()
ui_steps.click_button_common(view_to_find={"text": "Network & Internet"},
                             view_to_check={"text": "Airplane mode"},
                             serial=serial)()

for i in range(1, 50):
    wifi_generic_steps.set_airplane_mode(state="ON", serial=serial)()

#teardown

wifi_generic_steps.set_airplane_mode(state="OFF", serial=serial)()
log = None
if "LOG_PATH" in os.environ:
    testlib_log_path = os.environ["LOG_PATH"]
else:
    import testlib
    testlib_log_path = os.path.dirname(testlib.__file__) + "/logs/"

log = logger.testlib_log(log_path=testlib_log_path, log_name="testlib_default")

# ############# Get parameters ############

args = parse_args()

ui_steps.press_home(serial=args["serial"])()
ui_steps.open_settings(serial=args["serial"])()
ui_steps.click_button_common(view_to_find={"text": "System"},
                             serial=args["serial"])()
if ui_steps.wait_for_view_common(view_to_find={"text": "Developer options"},
                                 optional=True,
                                 serial=args["serial"])():
    log.info("Developer option is already enabled")
else:
    ui_steps.enable_developer_options(serial=args["serial"])()
    log.info("Developer option is enabled")

ui_steps.enable_options_from_developer_options(
    serial=args["serial"], developer_options=["Force 4x MSAA"])()

# TearDown
ui_steps.disable_options_from_developer_options(
    serial=args["serial"], developer_options=["Force 4x MSAA"])()
Beispiel #23
0
#
#######################################################################

import sys

# Used defined libraries
from testlib.base.base_utils import get_args
import time
from testlib.scripts.wireless.bluetooth.bt_step import Step as BtStep
from testlib.scripts.android.ui import ui_steps

globals().update(vars(get_args(sys.argv)))
args = {}
for entry in script_args:
    key, val = entry.split("=")
    args[key] = val

ui_steps.press_home(serial=serial)()
ui_steps.press_car(serial=serial)()
ui_steps.press_dialer(serial=serial)()
ui_steps.click_button_common(
    view_to_find={'text': "Phone"},
    second_view_to_find={"className": "android.widget.ImageButton"},
    serial=serial)()

time.sleep(5)
ui_steps.click_button_common(
    view_to_find={'text': "Phone"},
    second_view_to_find={"className": "android.widget.ImageButton"},
    serial=serial)()
Beispiel #24
0
import sys
# Used defined libraries
from testlib.base.base_utils import get_args
from testlib.scripts.android.ui import ui_steps
import time
# ############# Get parameters ############
globals().update(vars(get_args(sys.argv)))
args = {}
if script_args[0].upper() != 'NONE':
    for entry in script_args:
        key, val = entry.split("=")
        args[key] = val
# Setup
ui_steps.press_home(serial=serial)()
ui_steps.press_car(serial=serial)()
ui_steps.press_dialer(serial=serial)()
ui_steps.click_button_common(view_to_find={"text":"Phone"},second_view_to_find={"className":"android.widget.ImageButton"},serial=serial)()
ui_steps.click_button_common(view_to_find={"text":"Dial a number"},view_to_check={"text":"Dial a number"},serial=serial)()
ui_steps.click_button_common(view_to_find={"text":"7"},serial=serial)()
ui_steps.click_button_common(view_to_find={"text":"6"},serial=serial)()
ui_steps.click_button_common(view_to_find={"text":"2"},serial=serial)()
ui_steps.click_button_common(view_to_find={"text":"5"},serial=serial)()
ui_steps.click_button_common(view_to_find={"text":"0"},serial=serial)()
ui_steps.click_button_common(view_to_find={"text":"6"},serial=serial)()
ui_steps.click_button_common(view_to_find={"text":"3"},serial=serial)()
ui_steps.click_button_common(view_to_find={"text":"7"},serial=serial)()
ui_steps.click_button_common(view_to_find={"text":"4"},serial=serial)()
ui_steps.click_button_common(view_to_find={"text":"7"},serial=serial)()
ui_steps.wait_for_view_common(view_to_find={"text":"(762) 506-3747"}, serial=serial)()
ui_steps.click_button_common(view_to_find={"className":"android.widget.ImageButton"},view_to_check={"text":"Phone"},serial=serial)()
Beispiel #25
0
SPDX-License-Identifier: Apache-2.0
"""
# Used defined libraries
from testlib.base.base_utils import parse_args
from testlib.scripts.android.ui import ui_steps

# ############# Get parameters ############
args = parse_args()

# Setup
ui_steps.press_home(serial=args["serial"])()

# Run
ui_steps.enable_developer_options(serial=args["serial"])()
ui_steps.click_button_common(view_to_find={"text": "Developer options"},
                             view_to_check={"text": "OEM unlocking"},
                             serial=args["serial"])()

# option 1 animation off
ui_steps.click_button_common(
    view_to_find={"text": "Transition animation scale"},
    view_to_check={"text": "Animation off"},
    serial=args["serial"])()
ui_steps.click_button_common(view_to_find={"text": "Animation off"},
                             serial=args["serial"])()
ui_steps.wait_for_view_common(
    view_to_find={"text": "Animation off"},
    second_view_to_find={"className": "android.widget.TextView"},
    position="down",
    retrieve_info=True,
    serial=args["serial"])()["text"]
Beispiel #26
0
and limitations under the License.
?
SPDX-License-Identifier: Apache-2.0
"""
# Used defined libraries
from testlib.base.base_utils import parse_args
from testlib.scripts.android.ui import ui_steps

# ############# Get parameters ############
args = parse_args()
script_args = args["script_args"]
###############################
if "home" in script_args.keys():
    ui_steps.press_home(serial=args["serial"])()
if "car" in script_args.keys():
    ui_steps.press_car(serial=args["serial"])()
if "settings" in script_args.keys():
    ui_steps.open_settings(serial=args["serial"])()
if "map" in script_args.keys():
    ui_steps.press_map(serial=args["serial"])()
if "SystemUpdater" in script_args.keys():
    ui_steps.press_car(serial=args["serial"])()
    ui_steps.click_button_common(view_to_find={"text": "SystemUpdater"},
                                 view_to_check={"text": "SystemUpdater"},
                                 serial=args["serial"])()
if "Contacts" in script_args.keys():
    ui_steps.press_car(serial=args["serial"])()
    ui_steps.click_button_common(view_to_find={"text": "Contacts"},
                                 view_to_check={"text": "Contacts"},
                                 serial=args["serial"])()
bt_utils.bt_pair_devices(serial=serial,
                         dev=serial2,
                         dut_name=DUT_NAME,
                         dev_name=DEV_MAC_ADDRESS,
                         version_dut=DUT_VERSION,
                         version_dev=DEV_VERSION,
                         scan_max_attempts=3)

# Run
ui_steps.press_home(serial=serial)()
ui_steps.press_car(serial=serial)()
ui_steps.press_dialer(serial=serial)()

ui_steps.click_button_common(
    view_to_find={"text": "Phone"},
    second_view_to_find={"className": "android.widget.ImageButton"},
    serial=serial)()
ui_steps.click_button_common(view_to_find={"text": "Dial a number"},
                             view_to_check={"text": "Dial a number"},
                             serial=serial)()
ui_steps.click_button_common(view_to_find={"text": "9"}, serial=serial)()
ui_steps.click_button_common(view_to_find={"text": "4"}, serial=serial)()
ui_steps.click_button_common(view_to_find={"text": "4"}, serial=serial)()
ui_steps.click_button_common(view_to_find={"text": "*"}, serial=serial)()
ui_steps.click_button_common(view_to_find={"text": "4"}, serial=serial)()
ui_steps.click_button_common(view_to_find={"text": "3"}, serial=serial)()
ui_steps.click_button_common(view_to_find={"text": "0"}, serial=serial)()
ui_steps.click_button_common(view_to_find={"text": "5"}, serial=serial)()
ui_steps.click_button_common(view_to_find={"text": "2"}, serial=serial)()
ui_steps.click_button_common(view_to_find={"text": "#"}, serial=serial)()
ui_steps.click_button_common(
from testlib.scripts.wireless.wifi import wifi_steps
from testlib.scripts.android.ui import ui_steps
import time

# ############# Get parameters ############

globals().update(vars(get_args(sys.argv)))
args = {}
for entry in script_args:
    key, val = entry.split("=")
    args[key] = val

ui_steps.press_home(serial=serial)()
ui_steps.open_settings(serial=serial)()
ui_steps.click_button_common(view_to_find={"text": "Network & Internet"},
                             view_to_check={"text": "VPN"},
                             serial=serial)()

#check wifi state if its OFF if not , Tur it on
wifi_steps.set_from_wifi_settings(serial=serial)()

time.sleep(5)

wifi_steps.set_from_wifi_settings(state="OFF", serial=serial)()

#Teardown: #check wifi state if its OFF if not , Tur it ON
ui_steps.click_button_common(view_to_find={"text": "OFF"},
                             view_to_check={"text": "On"},
                             serial=serial)()

ui_steps.press_home(serial=serial)()
"""
# Used defined libraries
from testlib.base.base_utils import parse_args
from testlib.scripts.android.ui import ui_steps
import time

# ############# Get parameters ############
args = parse_args()

# Setup
ui_steps.press_home(serial=args["serial"])()

# Run
ui_steps.enable_developer_options(serial=args["serial"])()
ui_steps.click_button_common(view_to_find={"text": "Developer options"},
                             view_to_check={"text": "OEM unlocking"},
                             serial=args["serial"])()

# for full report
ui_steps.click_button_common(view_to_find={"text": "Take bug report"},
                             view_to_check={"text": "Interactive report"},
                             serial=args["serial"])()
ui_steps.click_button_common(view_to_find={"text": "Full report"},
                             serial=args["serial"])()
ui_steps.click_button_common(view_to_find={"text": "REPORT"},
                             serial=args["serial"])()

# for interactive report
ui_steps.click_button_common(view_to_find={"text": "Take bug report"},
                             view_to_check={"text": "Interactive report"},
                             serial=args["serial"])()
Beispiel #30
0
        key, val = entry.split("=")
        args[key] = val

# Setup to remove existing new users

while not ui_steps.remove_user(
        user_name="New user", optional=True, serial=serial)():
    break

#creating new user
for i in range(1, 4):
    ui_steps.press_home(serial=serial)()
    ui_steps.press_car(serial=serial)()
    ui_steps.open_settings(serial=serial)()
    ui_steps.click_button_common(view_to_find={"text": "Users & accounts"},
                                 view_to_check={"text": "Users"},
                                 serial=serial)()
    ui_steps.click_button_common(view_to_find={"text": "Users"},
                                 view_to_check={"text": "Add user"},
                                 serial=serial)()
    ui_steps.click_button(view_to_find={"textContains": "Add user"},
                          view_to_check={"text": "OK"},
                          serial=serial)()

    ui_steps.click_button_common(view_to_find={"text": "OK"},
                                 view_to_check={"text": "NOT NOW"},
                                 serial=serial)()
    ui_steps.click_button_common(view_to_find={"text": "NOT NOW"},
                                 view_to_check={"text": "Add user or profile"},
                                 serial=serial)()