コード例 #1
0
 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()
コード例 #2
0
 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()
コード例 #3
0
    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()
コード例 #4
0
    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()
コード例 #5
0
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()
コード例 #6
0
    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()
コード例 #7
0
    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()
コード例 #8
0
ファイル: base_test.py プロジェクト: martapiekarska/gecko
    def setUpClass(cls):
        cls.driver = create_driver()

        cls.webserver = Httpd(host=get_lan_ip())
        cls.webserver.start()