예제 #1
0
    def do(self):
        ui_steps.open_app_from_allapps(serial = self.serial,\
                view_to_find = {"text": "Gmail"})()
        ui_steps.click_button_if_exists(serial = self.serial,\
                view_to_find = {"resourceId":\
                "com.google.android.gm:id/compose_button"},wait_time = 2000)()

        ui_steps.edit_text(
            serial=self.serial,
            view_to_find={"resourceId": "com.google.android.gm:id/to"},
            value=self.account_to)()

        ui_steps.click_button_if_exists(serial=self.serial,
                                        view_to_find={"text": "Compose"},
                                        wait_time=5000)()
        ui_steps.edit_text(
            serial=self.serial,
            view_to_find={"resourceId": "com.google.android.gm:id/subject"},
            value=self.subject)()

        ui_steps.edit_text(
            serial=self.serial,
            view_to_find={"resourceId": "com.google.android.gm:id/body"},
            value=self.body_mail)()

        ui_steps.click_button_if_exists(serial = self.serial,\
            view_to_find = {"resourceId":"com.google.android.gm:id/send"})()
예제 #2
0
    def do(self, **kwargs):
        pnp_step.do(self)
        '''
        adb_steps.install_apk("./apks/3DMark_v100_installer.apk")
        adb_steps.command(command = "mkdir /mnt/shell/emulated/0/Android/obb")
        adb_steps.command(command = "mkdir /mnt/shell/emulated/0/Android/obb/com.futuremark.dmandroid.application/")

        adb_steps.push_file(local = "./apks/main.7.com.futuremark.dmandroid.application.obb", \
                            remote = "/mnt/shell/emulated/0/Android/obb/com.futuremark.dmandroid.application/", \
                            timeout = 500)
        adb_steps.push_file(local = "./apks/patch.7.com.futuremark.dmandroid.application.obb", \
                            remote = "/mnt/shell/emulated/0/Android/obb/com.futuremark.dmandroid.application/", \
                            timeout = 500)

        adb_steps.command(command = "pm clear com.futuremark.dmandroid.application")()
        '''
        adb_steps.command(command="logcat -c")()

        ui_steps.open_app_from_allapps(
            view_to_find={"textContains": "3DMark"})()
        ui_steps.click_button(view_to_find={"textContains": " MY DEVICE"})()
        ui_steps.click_button(view_to_find={"textContains": " 3DMARK"})()
        ui_steps.click_button(
            view_to_find={"descriptionContains": self.test_case})()

        time.sleep(self.sleeps)

        self.step_data = pnp_utils.get_threedmark_result(
            self.adb_connection, self.test_case)
예제 #3
0
    def do(self):
        ui_steps.press_home(serial=self.serial, )()
        ui_steps.open_app_from_allapps(
            serial=self.serial,
            view_to_find={'text': 'Camera'},
            view_to_check={'descriptionContains': 'Shutter'})()

        if self.platform == "gmin":
            self.uidevice.swipe(serial=self.serial,
                                sx=100,
                                sy=400,
                                ex=400,
                                ey=400,
                                steps=10)()
            ui_steps.click_button(serial=self.serial,
                                  view_to_find={'text': 'Camera'})()
        else:
            ui_steps.click_button(
                serial=self.serial,
                view_to_find={
                    'className': 'android.widget.ImageView',
                    'descriptionContains': 'Camera'
                },
                view_to_check={'descriptionContains': 'Photo'})()
            ui_steps.click_button(
                serial=self.serial,
                view_to_find={'descriptionContains': 'Photo'},
                view_to_check={'descriptionContains': 'Shutter'})()

        ui_steps.click_button(serial=self.serial,
                              view_to_find={'descriptionContains': 'Shutter'},
                              view_to_check={'descriptionContains':
                                             'Shutter'})()
예제 #4
0
    def do(self):
        ui_steps.open_app_from_allapps(serial = self.serial,\
                        view_to_find = {"text": "Gmail"})()
        ui_steps.click_button_if_exists(serial = self.serial,\
                    view_to_find =\
                    {"resourceId":"com.google.android.gm:id/compose_button"},\
                    wait_time = 2000)()
        #sometimes you have to wait for sync. A Wait for sync message appears:
        if self.uidevice(text="Waiting for sync").wait.exists(timeout=10000):
            #then wait for it to disappear
            self.uidevice(text="Waiting for sync").wait.gone(timeout=90000)

        ui_steps.edit_text(serial = self.serial,\
            view_to_find = {"resourceId":"com.google.android.gm:id/to"},
            value = self.account_to)()

        ui_steps.click_button_if_exists(serial = self.serial,\
            view_to_find = {"text":"Compose"},wait_time = 5000)()
        ui_steps.edit_text(serial = self.serial,view_to_find = {"resourceId":\
                    "com.google.android.gm:id/subject"},\
                    value = self.subject)()

        ui_steps.edit_text(serial = self.serial,view_to_find = {"resourceId":\
                    "com.google.android.gm:id/body"},
                    value =  self.body_mail)()
        if (self.send_mail):
            ui_steps.click_button_if_exists(serial = self.serial,\
               view_to_find = {"resourceId":"com.google.android.gm:id/send"})()

        if (self.save_as_draft):
            ui_steps.click_button_if_exists(serial = self.serial,\
               view_to_find = {"descriptionContains":"More options"})()
            ui_steps.click_button_if_exists(serial = self.serial,\
               view_to_find = {"text":"Save draft"})()
예제 #5
0
 def do(self):
     browser_pid_list = self.adb_connection.pgrep(self.browser_process)
     self.adb_connection.kill_all(browser_pid_list)
     ui_steps.open_app_from_allapps(serial = self.serial,
                                    view_to_find = {"text": self.browser},
                                    wait_time = 10000,
                                    view_to_check = self.view_to_check)()
예제 #6
0
 def do(self):
     ui_steps.open_app_from_allapps(serial = self.serial,\
                     view_to_find = {"textContains": "Play Games"},
                     view_to_check = {"textContains": "Play Now"})()
     open_navigation_drawer(serial=self.serial)()
     ui_steps.click_button(serial = self.serial,\
                     view_to_find = {"textContains": "Settings"},
                     view_to_check = {"textContains": "Multiplayer notifications"})()
예제 #7
0
 def do(self):
     ui_steps.open_app_from_allapps(serial = self.serial,\
                           view_to_find = {"textContains": "Play Games"},
                           view_to_check = {"textContains": "Play Now"})()
     open_navigation_drawer(serial=self.serial)()
     ui_steps.click_button(serial = self.serial,\
             view_to_find = {"textContains": "Players"},
             view_to_check = {"text" : "FOLLOWING"})()
예제 #8
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)
예제 #9
0
def recursive_xml_tree(uidevice, activity, level):

    global nodes
    global clicked_nodes
    global dumps

    print level

    current_dump = uidevice.dump()
    dumps.append(current_dump)

    root = ET.fromstring(current_dump)

    for node in root.iter('node'):
        if (node.get("clickable") == "true" or node.get("long-clickable") == "true")\
            and node.get("class") != "android.widget.ListView":
            new_node = {}
            new_node["class"] = node.get("class")
            new_node["text"] = node.get("text")
            new_node["desc"] = node.get("content-desc")
            new_node["id"] = node.get("resource-id")

            if is_node_in_nodes(new_node):
                nodes.append(new_node)

    for node in nodes:
        if node in clicked_nodes and node["level"] < level:
            continue
        node_filter = {}
        node_filter["className"] = node["class"]
        if node["text"] and len(
                node["text"]) > 0 and node["text"] is not "null":
            node_filter["text"] = node["text"]
        if node["id"] and len(node["id"]) > 0 and node["id"] is not "null":
            node_filter["resourceId"] = node["id"]
        if node["desc"] and len(
                node["desc"]) > 0 and node["desc"] is not "null":
            node_filter["description"] = node["desc"]

        ui_steps.click_button(view_to_find=node_filter)()
        clicked_nodes.append(node)
        uidevice.wait.update()
        if node["text"] == "Decline":
            ui_steps.open_app_from_allapps(
                view_to_find={"textContains": app_to_test})()
            continue
        current_activity = adb_utils.get_running_activities()
        if current_activity != activity:
            uidevice.press.back()
            uidevice.wait.update()
        else:
            for n in nodes:
                print n
            next_dump = uidevice.dump()
            if next_dump not in dumps:
                recursive_xml_tree(uidevice, activity, level + 1)
                print "back to " + str(level)
                uidevice.press.back()
예제 #10
0
    def do(self):

        ui_steps.open_app_from_allapps(serial = self.serial,\
                        view_to_find = {"textContains": "Play Games"},
                        view_to_check = {"textContains": "Play Now"})()
        open_navigation_drawer(serial=self.serial)()
        ui_steps.click_button(serial = self.serial,\
                    view_to_find = {"textContains": "Help & Feedback"},
                    view_to_check = {"text" : "Play games on your device"})()
예제 #11
0
 def do(self):
     ui_steps.open_app_from_allapps(serial = self.serial,\
                           view_to_find = {"textContains": "Play Games"},
                           view_to_check = {"textContains": "Play Now"})()
     open_navigation_drawer(serial=self.serial)()
     ui_steps.click_button(serial = self.serial,\
                         view_to_find = {"text": "Play Now",\
                             "resourceId" : "com.google.android.play.games:id/action_text"},
                         view_to_check = {"text" : "Discover new games"})()
예제 #12
0
def recursive_xml_tree(uidevice, activity, level):

    global nodes
    global clicked_nodes
    global dumps

    current_dump = uidevice.dump()
    dumps.append(current_dump.encode('utf-8'))

    root = ET.fromstring(current_dump.encode('utf-8'))

    for node in root.iter('node'):
        #if node.get("clickable") == "true" or node.get("long-clickable") == "true":
        new_node = {}
        new_node["class"] = node.get("class")
        new_node["text"] = node.get("text")
        new_node["desc"] = node.get("content-desc")
        new_node["id"] = node.get("resource-id")
        new_node["level"] = level

        if not is_node_in_nodes(new_node):
            nodes.append(new_node)

    for node in nodes:
        if node in clicked_nodes or node["level"] < level:
            continue
        node_filter = {}
        node_filter["className"] = node["class"]
        if node["text"] and len(
                node["text"]) > 0 and node["text"] is not "null":
            node_filter["text"] = node["text"]
        if node["id"] and len(node["id"]) > 0 and node["id"] is not "null":
            node_filter["resourceId"] = node["id"]
        if node["desc"] and len(
                node["desc"]) > 0 and node["desc"] is not "null":
            node_filter["description"] = node["desc"]
        if uidevice(**node_filter).exists:
            ui_steps.click_button(view_to_find=node_filter)()
            time.sleep(2)
            uidevice.wait.update()
        else:
            continue
        clicked_nodes.append(node)

        current_activity = adb_utils.get_running_activities()
        if current_activity != activity:
            uidevice.press.back()
            uidevice.wait.update()
        else:
            next_dump = uidevice.dump()
            if node["text"] == "Decline" or node["text"] == "Cancel":
                ui_steps.open_app_from_allapps(
                    view_to_find={"textContains": app_to_test})()
                continue
            if next_dump not in dumps:
                recursive_xml_tree(uidevice, activity, level + 1)
                current_dump = next_dump
예제 #13
0
    def do(self):
        ui_steps.open_app_from_allapps(serial = self.serial,\
                view_to_find = {"text": "Gmail"})()
        ui_steps.click_button_if_exists(serial = self.serial,view_to_find =\
            {"descriptionContains" : "Open navigation drawer"},wait_time = 5000)()

        ui_steps.click_button_if_exists(serial = self.serial,view_to_find =\
            {"text" : "Primary"},wait_time = 5000)()
        ui_steps.click_button_if_exists(serial = self.serial,view_to_find =\
            {"descriptionContains" : self.subject},wait_time = 5000)()
예제 #14
0
 def do(self):
     ui_steps.open_app_from_allapps(print_error =
                                    "Error - Application could not be "
                                    "openned",
                                    blocking = True,
                                    view_to_find =\
                                       {"text":"NotificationTrigger"},
                                    view_to_check =\
                                       {"text": "Create Notification"})()
     ui_steps.click_button(print_error="Error - Application coulnd not "
                           "be openned",
                           blocking=True,
                           view_to_find={"text": "Create Notification"})()
예제 #15
0
 def do(self):
     ui_steps.press_home()()
     ui_steps.open_app_from_allapps(serial=self.serial,
                                    view_to_find={"textContains": "Docs"})()
     self.uidevice(resourceId="com.google.android.apps.docs.editors.\
         docs:id/doc_list_syncing_spinner").wait.gone(timeout=20000)
     if self.uidevice(text="Skip").wait.exists(timeout=20000):
         ui_steps.click_button(
             serial=self.serial,
             view_to_find={"text": "Skip"},
             view_to_check={"description": "Create new document"})()
     docs_utils.exit_search()
     self.uidevice(resourceId="com.google.android.apps.docs.editors.\
     docs:id/doc_list_syncing_spinner").wait.gone(timeout=20000)
예제 #16
0
    def do(self):

        ui_steps.press_home(serial=self.serial)()
        ui_steps.close_app_from_recent(serial = self.serial,view_to_find=\
            {"text": "Gmail"})()
        ui_steps.open_app_from_allapps(serial = self.serial,\
                view_to_find = {"text": "Gmail"})()
        ui_steps.click_button_if_exists(serial = self.serial,view_to_find =\
            {"descriptionContains" : "Open navigation drawer"},\
            wait_time = 5000)()
        if ui_steps.wait_for_view(view_to_find = {"descriptionContains":\
            "Switch to "+self.account_to_switch},timeout = 20, serial = self.serial):
            ui_steps.click_button_if_exists(serial = self.serial,view_to_find =\
            {"descriptionContains" : "Switch to "+self.account_to_switch},\
            wait_time = 5000)()
예제 #17
0
    def do(self):

        ui_steps.open_app_from_allapps(serial = self.serial,\
                view_to_find = {"textContains": "Play Games"},
                view_to_check = {"textContains": "Play Now"})()
        open_navigation_drawer(serial=self.serial)()
        ui_steps.click_button(serial = self.serial,\
                view_to_find = {"textContains": "Inbox"},
                view_to_check = {"text" : "Game on! See invitations and matches in progress here."})()
        ui_steps.click_button(serial = self.serial,\
                        view_to_find = {"text": "GIFTS & REQUESTS"},
                        view_to_check = {"textContains" : "Try sending a gift"})()
        ui_steps.click_button(serial = self.serial,\
                    view_to_find = {"text": "QUESTS"},
                    view_to_check = {"text" : "No quests today! Play Games quests that you've accepted appear here."})()
예제 #18
0
    def do(self, **kwargs):
        pnp_step.do(self)
        '''
        adb_steps.install_apk("./apks/quadrant.ui.professional-2.1.1.apk")
        '''
        adb_steps.command(
            command="pm clear com.aurorasoftworks.quadrant.ui.professional")()

        ui_steps.open_app_from_allapps(
            view_to_find={"textContains": "Quadrant"})()
        ui_steps.click_button(view_to_find={"textContains": "OK"})()
        ui_steps.click_button(
            view_to_find={"textContains": "full benchmark"})()
        adb_steps.command(command="logcat -c")()
        time.sleep(self.sleeps[self.test_case])
        self.step_data = pnp_utils.get_quadrant_result(self.adb_connection)
예제 #19
0
    def do(self):
        if self.force:
            # sending MEDIA_MOUNTED intent to have
            # video files available
            adb_steps.command(serial=self.serial,
                              command="am broadcast -a\
                android.intent.action.MEDIA_MOUNTED -d file:///storage/sdcard0/Movies",
                              timeout=10)()
            # Make sure user is signed in before opening app
            WHERE = 'name = "{0}"'.format(self.account)
            account_exists = ui_utils.google_account_exists(serial=self.serial,
                                                            where=WHERE)
            total_account_no = gms_utils.get_google_account_number(
                serial=self.serial)

            if account_exists:
                account_synced = ui_steps.sync_google_account(
                    serial=self.serial,
                    account=self.account,
                    password=self.password)()

            if (total_account_no >= 2) or (not account_exists) or (
                    account_exists and not account_synced):
                ui_steps.remove_all_google_accounts(serial=self.serial)()
                ui_steps.add_google_account_for_L(serial=self.serial,
                                                  account=self.account,
                                                  password=self.password,
                                                  prefer_sync=True)()
            #~ ui_steps.remove_all_google_accounts(serial = self.serial)()
            #~ ui_steps.add_google_account_for_L(serial = self.serial,
            #~ account = self.account, password = self.password)()
            time.sleep(2)

        # Close app before openning it to ensure first screen consistency
        ui_steps.close_app_from_recent(serial=self.serial,
                                       view_to_find={"text": "Drive"})()
        self.uidevice.wait.idle()
        ui_steps.open_app_from_allapps(
            serial=self.serial,
            view_to_find={"text": "Drive"},
            view_to_check={"packageName": "com.google.android.apps.docs"})()
        # if opened for first time
        self.uidevice.wait.idle()
        ui_steps.click_button_if_exists(serial=self.serial,
                                        view_to_find={"text": "Skip"})()
예제 #20
0
    def do(self, **kwargs):
        pnp_step.do(self)
        ########################################################################
        # install apk and prereqs.
        ########################################################################
        '''
        adb_steps.install_apk(\
        "./apks/GLBenchmark_2_7_0_Release_a68901_Android_Corporate_Package.apk")
        '''
        ########################################################################
        # clear logcat and app cache prior to running the benchmark. Logcat must
        # be cleared for result collection, cache for ensuring similar test env.
        ########################################################################
        pnp_clear_cache_and_logs(**kwargs)

        ########################################################################
        # Start benchmark and select desired test cases. As the list is quite
        # long, scroll through the page and always select the first two of each
        # T-Rex and Egypt test cases.
        ########################################################################
        ui_steps.open_app_from_allapps(
            view_to_find={"textContains": "GLBenchmark"})()
        ui_steps.click_button(
            view_to_find={"textContains": "Performance Tests"},
            view_to_check={"textContains": "Start"})()
        for text in ['T-Rex', 'Egypt']:
            self.uidevice(scrollable=True).scroll.to(textContains=text)
            for i in [0, 1]:
                self.uidevice(textContains=text)[i].click()

        ########################################################################
        # Start test and wait for a predefined period of time. Not waiting would
        # interfere with result values.
        ########################################################################
        ui_steps.click_button(view_to_find={"textContains": "Start"})()
        time.sleep(self.sleeps[self.test_case])

        ########################################################################
        # Get the result. get_glbenchmark_results returns a dictionary with all
        # relevan {key:value} items.
        ########################################################################
        self.step_data = pnp_utils.get_glbenchmark_result(self.adb_connection)
예제 #21
0
    def do(self):
        # sending MEDIA_MOUNTED intent to have
        # video files available for Youtube app
        adb_steps.command(serial=self.serial,
                          command="am broadcast -a\
 android.intent.action.MEDIA_MOUNTED -d file:///storage/sdcard0/Movies",
                          timeout=10)()
        # Close app before openning it to ensure first screen consistency
        ui_steps.close_app_from_recent(serial=self.serial,
                                       view_to_find={"text": "YouTube"})()
        time.sleep(1)
        ui_steps.open_app_from_allapps(
            serial=self.serial,
            view_to_find={"text": "YouTube"},
            view_to_check={"packageName": "com.google.android.youtube"})()
        # if opened for first time
        time.sleep(1)
        ui_steps.click_button_if_exists(serial=self.serial,
                                        view_to_find={"text": "Skip"})()
        time.sleep(5)
        ui_steps.click_button_if_exists(serial=self.serial,
                                        view_to_find={"text": "OK"})()
예제 #22
0
    def do(self, **kwargs):
        pnp_step.do(self)

        #adb_steps.install_apk("./apks/AnTuTu-4.0.3.apk")()
        pnp_clear_cache_and_logs(**kwargs)

        ui_steps.open_app_from_allapps(view_to_find={"textContains": "AnTuTu"},
                                       debug=True)()
        ui_steps.click_button(
            view_to_find={"resourceId": "com.antutu.ABenchMark:id/test_btn"})()

        if self.test_case != "all":
            for key in self.possible_tests:
                if key != self.test_case:
                    ui_steps.click_button(view_to_find={"textContains": key})()
        ui_steps.click_button(
            view_to_find={
                "resourceId": "com.antutu.ABenchMark:id/test_all_btn"
            })()
        time.sleep(self.sleeps[self.test_case])

        self.step_data = pnp_utils.get_antutu_result(self.test_case,
                                                     self.possible_tests)
예제 #23
0
    def do(self):
        # sending MEDIA_MOUNTED intent to have
        # audio files available for Play Music app
        adb_steps.command(serial=self.serial,
                          command="am broadcast -a\
 android.intent.action.MEDIA_MOUNTED -d file:///storage/sdcard0/Music",
                          timeout=10)()
        # Close app before openning it to ensure first screen consistency
        ui_steps.close_app_from_recent(serial=self.serial,
                                       view_to_find={"text": "Play Music"})()
        ui_steps.press_home(serial=self.serial)()
        ui_steps.open_app_from_allapps(
            serial=self.serial,
            view_to_find={"text": "Play Music"},
            view_to_check={"packageName": "com.google.android.music"})()
        time.sleep(5)
        ui_steps.click_button_if_exists(serial=self.serial,
                                        view_to_find={"text":
                                                      "Use Standard"})()
        ui_steps.click_button_if_exists(serial=self.serial,
                                        view_to_find={"text": "Done"})()
        ui_steps.click_button_if_exists(serial=self.serial,
                                        view_to_find={"text": "Skip"})()
        ui_steps.click_button_if_exists(
            serial=self.serial, view_to_find={"description": "Navigate up"})()
        try:
            ui_steps.wait_for_view(serial=self.serial,
                                   view_to_find={"text": "Listen Now"})()
        except:
            ui_steps.click_button(
                serial=self.serial,
                view_to_find={"description": "Show navigation drawer"},
                view_to_check={"text": "Listen Now"})()
            ui_steps.click_button(serial=self.serial,
                                  view_to_find={"text": "Listen Now"},
                                  view_to_check={"text": "Listen Now"})()
예제 #24
0
    serial = serial,
    port = adb_server_port
)()

args = {}
for entry in script_args:
    key, val = entry.split("=")
    args[key] = val

app_to_test = args["app-to-test"]
wait_time = int(args["wait-time"])/1000

ui_steps.press_home()()

################## Openning app to test
ui_steps.open_app_from_allapps(view_to_find = {"text": app_to_test})()
time.sleep(wait_time)

uidevice = ui_device()
width = uidevice.info["displayWidth"]
height = uidevice.info["displayHeight"]

random_clicks(2, 3, width, height)

random_swipes(100, 50, 350, width, height)


#random_text("bogus")

#time.sleep(10)
예제 #25
0
    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,
        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,
if adb_utils.is_prop_set(serial=serial,
                         prop="ro.board.platform",
                         value="sofia_lte"):
    adb_steps.provision_sofia(serial=serial,
                              wvkeyboxtool=wvkeyboxtool,
                              keybox=keybox)()

# Install ExoPlayer
adb_steps.install_apk(serial=serial, apk_path=widevine_apk, blocking=True)()

# Check if video plays
ui_steps.close_app_from_recent(serial=serial,
                               view_to_find={"textContains": "ExoPlayer"},
                               blocking=True)()

ui_steps.open_app_from_allapps(serial=serial,
                               view_to_find={"textContains": "ExoPlayer"})()

# Scroll down to Widevine video
ui_steps.scroll_up_to_view(
    serial=serial,
    ey=200,
    view_to_check={"textContains": "WV: HDCP not specified"})()
ui_steps.click_button(serial=serial,
                      view_to_find={"textContains":
                                    "WV: HDCP not specified"})()
ui_steps.wait_for_view(serial=serial,
                       view_to_find={"textContains": "playbackState=ready"},
                       timeout=15000)()
ui_steps.press_home(serial=serial)()
예제 #27
0
# #############################################################################
#
# @filename:
#
# @description: HomeScreen / Start app
#
# @author:      [email protected]
#
##############################################################################

import sys

from testlib.scripts.android.adb import adb_steps
from testlib.scripts.android.adb import adb_utils
from testlib.scripts.android.ui import ui_steps

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()})

# Open all apps
ui_steps.press_home()()
#ui_steps.press_all_apps()()
ui_steps.open_app_from_allapps(view_to_find={"text": "Calculator"},
                               view_to_check={"text": "sin"})()
ui_steps.press_home()()
예제 #28
0
##############################################################################
#
# @filename:    steps.py
# @description: ET/Star Peak/Script Library/L2/Interface/07 - Start
#                   application from app view
# @author:      [email protected]
#
##############################################################################

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.base.base_utils import get_args
import sys

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.press_home()()

ui_steps.open_app_from_allapps(print_error="Error - Application coulnd not "
                               "be openned",
                               view_to_find={"text": "Calculator"},
                               wait_time=3000,
                               view_to_check={"text": "cos"})()

ui_steps.press_home()()
예제 #29
0
ui_steps.close_app_from_recent(serial = serial,\
                view_to_find = {"text": "Sheets"})()

if (gms_utils.get_google_account_number(serial=serial) == 0):
    ui_steps.add_google_account_for_L(serial = serial,version = "L",\
                 account = account,
                 password = password)()
if (gms_utils.get_google_account_number(serial=serial) > 1):
    ui_steps.remove_all_google_accounts(serial=serial)()
    ui_steps.add_google_account_for_L(serial = serial,version = "L",\
                 account = account,
                 password = password)()


ui_steps.open_app_from_allapps(serial = serial,\
                    view_to_find = {"text": "Sheets"})()

if uidevice(text="Spreadsheets on the go").exists:
    ui_steps.click_button_if_exists(serial = serial,\
                view_to_find = {"text":"Skip"},\
                wait_time = 5000)()

if uidevice(descriptionContains="View as List").exists:
    ui_steps.click_button_if_exists(serial = serial,\
                view_to_find = {"descriptionContains":"View as List"},\
                wait_time = 5000)()

ui_steps.click_button_if_exists(serial = serial,\
            view_to_find = {"descriptionContains":"Create new spreadsheet"},\
            view_to_check ={"text":"Untitled spreadsheet"},\
            wait_time = 5000)()
import sys

from testlib.scripts.android.adb import adb_steps
from testlib.scripts.android.ui import ui_steps
from testlib.scripts.media import media_steps

# Connect to device
from testlib.base.base_utils import get_args

globals().update(vars(get_args(sys.argv)))

########### Preconditions ###############
#########################################

adb_steps.connect_device(serial=serial, port=adb_server_port)()

media_steps.clear_old_media()()

############### Test ####################
#########################################

ui_steps.press_home()()
ui_steps.open_app_from_allapps(
    view_to_find={'text': 'Camera'},
    view_to_check={'descriptionContains': 'Shutter'})()
########### Postconditions ##############
#########################################
if not (script_args and "gmin" in script_args):
    adb_steps.disconnect_device(serial=serial, local_port=adb_server_port)()