~xubuntu-dev/ubiquity/lp1437180_feh

« back to all changes in this revision

Viewing changes to autopilot/ubiquity_autopilot_tests/tests/__init__.py

  • Committer: Colin Watson
  • Date: 2014-04-09 21:34:01 UTC
  • Revision ID: cjwatson@canonical.com-20140409213401-1jb17y0efxdhy0mh
Remove lots of cruft relating to removed Ubuntu One, webcam, and
migration-assistant steps.

Show diffs side-by-side

added added

removed removed

Lines of Context:
592
592
        self._check_navigation_buttons(continue_button=True, back_button=True,
593
593
                                       quit_button=False, skip_button=False)
594
594
 
595
 
    def ubuntu_one_page_tests(self, ):
596
 
        # Only run U1 tests on Ubuntu and is ubiqutiy plugin of U1 is installed
597
 
        if not self.ubuntuone_is_installed():
598
 
            self.go_to_progress_page()
599
 
            return
600
 
        self.go_to_next_page()
601
 
        self._update_current_step('stepUbuntuOne')
602
 
        self._check_navigation_buttons(continue_button=True, back_button=True,
603
 
                                       quit_button=False, skip_button=True)
604
 
        logger.debug("run_ubuntu_one_page_tests()")
605
 
        #uOnePage = self.main_window.select_single(BuilderName='stepUbuntuOne')
606
 
        page_objects = ['u1_about_label', 'cloud_label', 'music_label',
607
 
                        'photos_label', 'apps_label', 'u1_existing_account',
608
 
                        'u1_new_account', 'u1_explain_email_2',
609
 
                        'u1_explain_email', 'u1_terms',
610
 
                        'password_mismatch', 'u1_ask_name_pass',
611
 
                        'u1_ask_email', 'u1_no_internet']
612
 
        self.check_visible_object_with_label(page_objects)
613
 
        # XXX: we currently can't test signing in as it is yet to possible
614
 
        # to set ubiquity to use a staging server for testing.
615
 
        skip_button = self.main_window.select_single('GtkButton', name='skip')
616
 
        self.pointing_device.click_object(skip_button)
617
 
        #lets just sleep a little to wait for progress page as we
618
 
        # can't wait on the page_title
619
 
        time.sleep(5)
620
 
 
621
595
    def progress_page_tests(self, ):
622
596
        ''' Runs the test for the installation progress page
623
597
 
1059
1033
                    logger.debug("{0} flavor detected".format(distro))
1060
1034
                    return str(distro)
1061
1035
                raise SystemError("Could not get distro name")
1062
 
 
1063
 
    def ubuntuone_is_installed(self, ):
1064
 
        # Skip this step if the required package is not installed
1065
 
        pkg = 'ubiquity-plugin-ubuntuone'
1066
 
        cmd = ("dpkg-query -W -f ${Status} %s" % pkg).split()
1067
 
        try:
1068
 
            logger.debug("Verifying if '%s' is installed." % pkg)
1069
 
            out = subprocess.check_output(cmd, stderr=subprocess.DEVNULL)
1070
 
            if not out.decode('utf-8').endswith(' installed'):
1071
 
                logger.info("Package '%s' is not installed. Skipping step!"
1072
 
                            % pkg)
1073
 
                return False
1074
 
            logger.debug('Ok')
1075
 
        except subprocess.CalledProcessError:
1076
 
            logger.info("Package '%s' is not installed. Skipping step!" % pkg)
1077
 
            return False
1078
 
 
1079
 
        return True