예제 #1
0
 def run_once(self):
     # Run the CHROMEOS_LOGIN pyauto tests.
     deps_dir = os.path.join(self.autodir, 'deps')
     functional_cmd = cros_ui.xcommand(
         '%s/chrome_test/test_src/chrome/test/functional/'
         'pyauto_functional.py --suite=CHROMEOS_LOGIN --no-http-server -v' %
         deps_dir)
     utils.system(functional_cmd)
 def run_once(self):
     # Run the CHROMEOS_VOLUME pyauto tests.
     deps_dir = os.path.join(self.autodir, 'deps')
     functional_cmd = cros_ui.xcommand(
         '%s/chrome_test/test_src/chrome/test/functional/'
         'pyauto_functional.py --suite=CHROMEOS_VOLUME --no-http-server -v' %
         deps_dir)
     utils.system(functional_cmd)
예제 #3
0
 def run_once(self):
     # Run the CHROMEOS_LOGIN pyauto tests.
     deps_dir = os.path.join(self.autodir, "deps")
     functional_cmd = cros_ui.xcommand(
         "%s/chrome_test/test_src/chrome/test/functional/"
         "pyauto_functional.py --suite=CHROMEOS_LOGIN --no-http-server -v" % deps_dir
     )
     utils.system(functional_cmd)
    def run_once(self,
                 suite=None,
                 tests=None,
                 as_chronos=True,
                 auto_login=True):
        """Run pyauto functional tests.

        Args:
            suite: the pyauto functional suite to run.
            tests: the test modules to run.
            as_chronos: if True, run tests as chronos.
            auto_login: if True, login to default account before firing off.

        Either suite or tests should be specified, not both.
        """
        assert suite or tests, 'Should specify suite or tests'
        assert not (suite and tests), \
            'Should specify either suite or tests, not both'

        deps_dir = os.path.join(self.autodir, 'deps')
        if auto_login:
            # Enable chrome testing interface and Login.
            pyautolib_dir = os.path.join(self.cr_source_dir, 'chrome', 'test',
                                         'pyautolib')
            login_cmd = cros_ui.xcommand_as(
                'python %s chromeos_utils.ChromeosUtils.LoginToDefaultAccount '
                '-v --no-http-server' %
                os.path.join(pyautolib_dir, 'chromeos', 'chromeos_utils.py'))
            print 'Login cmd', login_cmd
            utils.system(login_cmd)

        # Run tests.
        functional_cmd = 'python %s/chrome_test/test_src/' \
            'chrome/test/functional/pyauto_functional.py -v ' % deps_dir
        if suite:
            functional_cmd += ' --suite=%s' % suite
        elif tests:
            functional_cmd += tests

        if as_chronos:
            launch_cmd = cros_ui.xcommand_as(functional_cmd)
        else:
            launch_cmd = cros_ui.xcommand(functional_cmd)
        print 'Test launch cmd', launch_cmd
        utils.system(launch_cmd)
    def run_once(self, suite=None, tests=None,
                 as_chronos=True, auto_login=True):
        """Run pyauto functional tests.

        Args:
            suite: the pyauto functional suite to run.
            tests: the test modules to run.
            as_chronos: if True, run tests as chronos.
            auto_login: if True, login to default account before firing off.

        Either suite or tests should be specified, not both.
        """
        assert suite or tests, 'Should specify suite or tests'
        assert not (suite and tests), \
            'Should specify either suite or tests, not both'

        deps_dir = os.path.join(self.autodir, 'deps')
        if auto_login:
            # Enable chrome testing interface and Login.
            pyautolib_dir = os.path.join(self.cr_source_dir,
                                         'chrome', 'test', 'pyautolib')
            login_cmd = cros_ui.xcommand_as(
                'python %s chromeos_utils.ChromeosUtils.LoginToDefaultAccount '
                '-v --no-http-server' % os.path.join(
                    pyautolib_dir, 'chromeos', 'chromeos_utils.py'))
            print 'Login cmd', login_cmd
            utils.system(login_cmd)

        # Run tests.
        functional_cmd = 'python %s/chrome_test/test_src/' \
            'chrome/test/functional/pyauto_functional.py -v ' % deps_dir
        if suite:
            functional_cmd += ' --suite=%s' % suite
        elif tests:
            functional_cmd += tests

        if as_chronos:
            launch_cmd = cros_ui.xcommand_as(functional_cmd)
        else:
            launch_cmd = cros_ui.xcommand(functional_cmd)
        print 'Test launch cmd', launch_cmd
        utils.system(launch_cmd)