Exemple #1
0
 def launch_by_am(self):
     g_common_obj.launch_app_am(ContactsImpl.contact_pkg_name, \
         ContactsImpl.contact_activity_name)
     print "[INFO] launch contact app successfully"
Exemple #2
0
 def launch(self):
     """launch app"""
     g_common_obj.launch_app_am(self.PKG_NAME, self.MAIN_ACTIVITY)
     self._wait_init()
     self.home.skip_guide_selection()
Exemple #3
0
 def launch_settings(self):
     '''
     Launch Settings app.
     '''
     print "[Info] ---Launch Settings app."
     g_common_obj.launch_app_am("com.android.settings", ".Settings")
Exemple #4
0
 def launch_app_am(self):
     print "Launch GoogleCamera by adb am"
     g_common_obj.launch_app_am(self.pkg_name, self.activity_name)
Exemple #5
0
 def launch_sound(self):
     """launch sound"""
     g_common_obj.launch_app_am("com.android.settings",
                                "com.android.settings.Settings")
     self.d(textMatches="Sound & notification").click()
     print "launch sound success <-"
Exemple #6
0
 def launch_app_by_am(self, packagename, activityname):
     """
         @summary: launch app by am
     """
     g_common_obj.launch_app_am(packagename, activityname)
     print "[INFO] launch package: %s, activity: %s successfully" % (packagename, activityname)
Exemple #7
0
    def test_TaskManager_CloseRecentApps(self):
        """
        test_TaskManager_CloseRecentApps

        Steps:
        1. Turn on Wireless Display on DUT.
                The Chromecast adapter is shown on the scan list.
        2. Connect to the Chromecast adapter
                The DUT is connected to the Chromecast adapter.
        3. Open a few applications
                The applications are opened
        4. Push the recent applications button
                The recent application screen is shown
        5. Close all applications
                The applications are closed and screencasting is successful
        """
        print "[RunTest]: %s" % self.__str__()
        print """[Step] 1. Turn on Wireless Display on DUT.
                    The Chromecast adapter is shown on the scan list."""
        self.turn_on_wireless()

        self.chrome_cast.launch()
        cast_real_name = self.chrome_cast.choose_castscreen(self.cast_model)

        print """[Step] 2. Connect to the Chromecast adapter
                   The DUT is connected to the Chromecast adapter."""
        self.chrome_cast.connect_cast_screen(cast_real_name)

        print "[Init APP]"
        print "Init Photos"
        g_common_obj.launch_app_am(
            " com.google.android.apps.photos",
            "com.google.android.apps.photos.home.HomeActivity")
        time.sleep(2)
        self.photos.stop_photos_am()
        time.sleep(1)
        print "Init Calendar"
        g_common_obj.launch_app_am(
            " com.google.android.calendar",
            "com.android.calendar.AllInOneCalendarActivity")
        if not self.d(description="Create new event and more").exists:
            for _ in range(0, 3):
                if self.d(description="next page").exists:
                    self.d(description="next page").click.wait()
            if self.d(text="Got it").exists:
                self.d(text="Got it").click.wait()
        g_common_obj.stop_app_am("com.google.android.calendar")
        time.sleep(2)

        print """[Step] 3. Open a few applications
                    The applications are opened"""
        for each in self.actor_apps.split(','):
            self.d.press.home()
            self.d(description="Apps").click()
            if self.d(scrollable=True).scroll.horiz.to(text=each):
                self.d(text=each).click()
                time.sleep(2)
                print "[Debug] open app %s" % (each)

        print """[Step] 4. Push the recent applications button
                        The recent application screen is shown"""
        for each in self.actor_apps.split(','):
            self.d.press.home()
            self.d.press.recent()
            self.d().scroll.vert.toEnd()
            assert self.d().scroll.vert.to(text=each), \
                "[FAILURE] %s Not appear in recent list" % (each)
            print "[Debug] app %s existed in recent" % (each)
            time.sleep(1)

        print """[Step] 5. Close all applications
                    The applications are closed and screencasting is successful"""
        self.systemui.close_all_recent_apps()
 def launch(self):
     """launch app"""
     g_common_obj.launch_app_am(self.PKG_NAME, self.MAIN_ACTIVITY)
     time.sleep(3)
Exemple #9
0
 def launch_from_am(self):
     """Launch AndFTP from am"""
     print "[INFO] Launch AndFTP from am"
     g_common_obj.launch_app_am(self.ftp_package, self.ftp_activity)
     time.sleep(2)
     assert self.d(packageName=self.ftp_package)