def setUpClass(cls): config = ConfigParser.ConfigParser() config.read('webdriver.cfg') cls.driver_class = getattr(webdriver, config.get("Default", 'browser')) cls.driver = cls.driver_class() cls.webserver = Httpd() cls.webserver.start()
def setUp(self): config = ConfigParser.ConfigParser() config.read("webdriver.cfg") self.driver_class = getattr(webdriver, config.get("Default", "browser")) self.driver = self.driver_class() self.webserver = Httpd() self.webserver.start()
def setUpClass(cls): config = ConfigParser.ConfigParser() config.read('webdriver.cfg') section = os.environ.get("WD_BROWSER", 'firefox') cls.driver_class = getattr(webdriver, config.get(section, 'browser')) url = None if config.has_option(section, 'url'): url = config.get(section, "url") capabilities = None if config.has_option(section, 'capabilities'): try: capabilities = json.loads(config.get(section, "capabilities")) except: pass if url != None and url.strip() != '': if capabilities != None and type(capabilities) is dict: cls.driver = cls.driver_class( command_executor=url, desired_capabilities=capabilities) else: cls.driver = cls.driver_class(command_executor=url) else: if capabilities != None and type(capabilities) is dict: cls.driver = cls.driver_class( desired_capabilities=capabilities) else: cls.driver = cls.driver_class() cls.webserver = Httpd(host=get_lan_ip()) cls.webserver.start()
def setUpClass(cls): cls.driver = create_driver() cls.webserver = Httpd(host=get_lan_ip()) cls.webserver.__dict__['mobile'] = os.environ.get( "WD_BROWSER", 'firefox') cls.webserver.__dict__['appId'] = appId cls.webserver.start()
class WebDriverBaseTest(unittest.TestCase): def __init__(self, methodName): unittest.TestCase.__init__(self, methodName) self.driver = None self.webdriver = None def setUp(self): config = ConfigParser.ConfigParser() config.read("webdriver.cfg") self.driver_class = getattr(webdriver, config.get("Default", "browser")) self.driver = self.driver_class() self.webserver = Httpd() self.webserver.start() def tearDown(self): self.driver.quit() self.webserver.stop()
def setUpClass(cls): cls.driver = base_test.create_driver() def basic_response_func(request, *args): return (401, {"WWW-Authenticate": "Basic"}, None) basic_auth_handler = {'method': 'GET', 'path': '/navigation/auth_required_basic', 'function': basic_response_func} urlhandlers = [basic_auth_handler] cls.webserver = Httpd(urlhandlers=urlhandlers) cls.webserver.start()
def setUpClass(cls): config = ConfigParser.ConfigParser() config.read('webdriver.cfg') cls.driver_class = getattr(webdriver, config.get("Default", 'browser')) cls.driver = cls.driver_class() def basic_response_func( request, *args ): return (401, {"WWW-Authenticate" : "Basic"}, None) basic_auth_handler = { 'method': 'GET', 'path' : '/navigation/auth_required_basic', 'function' : basic_response_func } urlhandlers = [ basic_auth_handler ] cls.webserver = Httpd( urlhandlers=urlhandlers ) cls.webserver.start()
def setUpClass(cls): cls.driver = create_driver() cls.webserver = Httpd(host=get_lan_ip()) cls.webserver.start()