def configure(self, options, conf): super(Selenium, self).configure(options, conf) if not self.enabled: return self.config_file = options.selenium_config self.skip = options.selenium_skip selenium_conf = Configurator(self.config_file) self.drivers = selenium_conf.get_drivers()
def test_get_drivers_null(self): conf = Configurator(yaml_conf=""" drivers: - capabilities: - __doc__: Put here Extra Firefox capabilities - class: selenium_extra.drivers.remote.grid """) with self.assertRaises(ValueError): conf.get_drivers()
def test_get_drivers_missing_class_key(self): conf = Configurator() with self.assertRaises(ValueError): conf.get_drivers()
def test_get_drivers(self): conf = Configurator(yaml_conf=self.config) drivers = conf.get_drivers() self.assertEqual(3, len(drivers))