def __init__(self, xvfb=False, shunt_window=True, implicitly_wait=5.0, **kwargs): """Initialize selenium Service object (but don't run). Args: xvfb (Optional[bool]): Run service with X virtual framebuffer (don't show firefox window). shunt_window (Optional[bool]): Shunt window to (0, 0) coordinates to move out of the way of the mouse. implicitly_wait (Optional[float]): Set implicitly_wait value of the selenium driver. Default: 5.0 seconds. """ checks.packages(hitchselenium.UNIXPACKAGES) if xvfb: if sys.platform == "darwin": raise RuntimeError("Hitch can't use xvfb on Mac OS X") else: # If it's Linux and we're not using xvfb, we need X available if sys.platform != "darwin": checks.x_available(True) kwargs['log_line_ready_checker'] = lambda line: "READY" in line xvfb_run = ['xvfb-run'] if xvfb else [] kwargs['command'] = xvfb_run + [ sys.executable, "-u", "-m", "hitchselenium.server" ] kwargs['no_libfaketime'] = True self.shunt_window = shunt_window self.implicitly_wait = implicitly_wait self._driver = None super(SeleniumService, self).__init__(**kwargs)
def __init__(self, xvfb=False, shunt_window=True, implicitly_wait=5.0, **kwargs): """Initialize selenium Service object (but don't run). Args: xvfb (Optional[bool]): Run service with X virtual framebuffer (don't show firefox window). shunt_window (Optional[bool]): Shunt window to (0, 0) coordinates to move out of the way of the mouse. implicitly_wait (Optional[float]): Set implicitly_wait value of the selenium driver. Default: 5.0 seconds. """ checks.packages(hitchselenium.UNIXPACKAGES) if xvfb: if sys.platform == "darwin": raise RuntimeError("Hitch can't use xvfb on Mac OS X") else: # If it's Linux and we're not using xvfb, we need X available if sys.platform != "darwin": checks.x_available(True) kwargs['log_line_ready_checker'] = lambda line: "READY" in line xvfb_run = ['xvfb-run'] if xvfb else [] kwargs['command'] = xvfb_run + [sys.executable, "-u", "-m", "hitchselenium.server"] kwargs['no_libfaketime'] = True self.shunt_window = shunt_window self.implicitly_wait = implicitly_wait self._driver = None super(SeleniumService, self).__init__(**kwargs)
def __init__(self, version, bin_directory=None): super(RabbitPackage, self).__init__() self.version = self.check_version(version, self.VERSIONS, ISSUES_URL) self.directory = join(self.get_build_directory(), "rabbitmq-server-{}".format(self.version)) self.bin_directory = bin_directory checks.packages(hitchrabbit.UNIXPACKAGES)
def __init__(self, version="5.6.26", directory=None, bin_directory=None): super(MySQLPackage, self).__init__() self.version = self.check_version(version, self.VERSIONS, ISSUES_URL) if directory is None: self.directory = join(self.get_build_directory(), "mysql-{}".format(self.version)) else: self.directory = directory self.bin_directory = bin_directory checks.packages(hitchmysql.UNIXPACKAGES)
def __init__(self, version, directory=None, bin_directory=None): super(ElasticPackage, self).__init__() self.version = self.check_version(version, self.VERSIONS, ISSUES_URL) checks.packages(hitchelasticsearch.UNIXPACKAGES) if directory is None: self.directory = join(self.get_build_directory(), "elasticsearch-{}".format(self.version)) else: self.directory = directory self.bin_directory = bin_directory
def __init__(self, version="9.5.0", directory=None, bin_directory=None): super(PostgresPackage, self).__init__() self.version = self.check_version(version, self.VERSIONS, ISSUES_URL) if directory is None: self.directory = join(self.get_build_directory(), "postgresql-{}".format(self.version)) else: self.directory = directory self.bin_directory = bin_directory checks.i_am_root(False) checks.packages(hitchpostgres.UNIXPACKAGES)
def __init__(self, python_version="2.7.10", directory=None, bin_directory=None): super(PythonPackage, self).__init__() self.python_version = self.check_version(python_version, self.PYTHON_VERSIONS, ISSUES_URL, name="Python") self.base_python_main_directory = path.join( self.get_build_directory(), "python{}".format(self.python_version)) if directory is None: self.directory = path.join(utils.get_hitch_directory(), "py{}".format(python_version)) else: self.directory = directory checks.packages(hitchpython.UNIXPACKAGES) self.bin_directory = bin_directory
def set_up(self): """Ensure virtualenv present, then run all services.""" checks.packages(["vagrant"]) self.cli_steps = hitchcli.CommandLineStepLibrary(default_timeout=720) self.cd = self.cli_steps.cd self.run = self.cli_steps.run self.expect = self.cli_steps.expect self.send_control = self.cli_steps.send_control self.send_line = self.cli_steps.send_line self.send_signal = self.cli_steps.send_signal self.exit_with_any_code = self.cli_steps.exit_with_any_code self.show_output = self.cli_steps.show_output self.exit = self.cli_steps.exit if self.preconditions is not None and "vagrant" in self.preconditions: self.cd(self.preconditions["vagrant"]) self.run("vagrant up") self.exit_with_any_code()
def set_up(self): """Ensure virtualenv present, then run all services.""" checks.packages(["vagrant"]) self.cli_steps = hitchcli.CommandLineStepLibrary(default_timeout=360) self.cd = self.cli_steps.cd self.run = self.cli_steps.run self.expect = self.cli_steps.expect self.send_control = self.cli_steps.send_control self.send_line = self.cli_steps.send_line self.send_signal = self.cli_steps.send_signal self.exit_with_any_code = self.cli_steps.exit_with_any_code self.show_output = self.cli_steps.show_output self.exit = self.cli_steps.exit if self.preconditions is not None and "vagrant" in self.preconditions: self.cd(self.preconditions["vagrant"]) self.run("vagrant up") self.exit_with_any_code()