How to use the splinter.browser._DRIVERS function in splinter

To help you get started, we’ve selected a few splinter examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gratipay / gratipay.com / gratipay / testing / browser.py View on Github external
def setUpClass(cls):
        global _browser
        super(BrowserHarness, cls).setUpClass()
        if _browser is None:
            DriverClass = _DRIVERS[os.environ['WEBDRIVER_BROWSER']]
            _browser = DriverClass()
            atexit.register(_browser.quit)
        cls._browser = _browser
github cobrateam / splinter / tests / test_zopetestbrowser_independence.py View on Github external
def test_should_work_even_without_zope_testbrowser(self):
        import __builtin__
        old_import = __builtin__.__import__

        def custom_import(name, *args, **kwargs):
              if 'zope' in name:
                  return None
              return old_import(name, *args, **kwargs)

        __builtin__.__import__ = custom_import

        from splinter import browser
        reload(browser)
        assert 'zope.testbrowser' not in browser._DRIVERS, 'zope.testbrowser driver should not be registered when zope.testbrowser is not installed'
        browser.Browser('zope.testbrowser')
        __builtin__.__import__ = old_import
github ggozad / behaving / src / behaving / mobile / android.py View on Github external
while time.time() < end_time:
            try:
                if not self._is_text_present(text):
                    return True
            except StaleElementReferenceException:
                continue
        return False

    def fill(self, name, value):
        field = self.find_by_accessibility_id(name).first
        assert field, u'No elements found with accessibility id %s' % name
        field.set_value(value)


_DRIVERS['android'] = AndroidWebDriver
github ggozad / behaving / src / behaving / web / cordova.py View on Github external
options.add_argument('--user-data-dir=/tmp/temp_chrome_user_data_dir_for_cordova_browser')
        else:
            options.add_argument('--incognito')

        dc = DesiredCapabilities.CHROME
        dc['loggingPrefs'] = {'browser': 'ALL'}

        self.driver = Chrome(chrome_options=options, desired_capabilities=dc, **kwargs)
        self.element_class = WebDriverElement

        self._cookie_manager = CookieManager(self.driver)

        super(CordovaWebDriver, self).__init__(wait_time)

from splinter.browser import _DRIVERS
_DRIVERS['cordova'] = CordovaWebDriver
github ggozad / behaving / src / behaving / web / firefox.py View on Github external
firefox_profile.add_extension(extension)

        self.driver = Firefox(firefox_profile)

        if fullscreen:
            ActionChains(self.driver).send_keys(Keys.F11).perform()

        self.element_class = WebDriverElement

        self._cookie_manager = CookieManager(self.driver)

        super(WebDriver, self).__init__(wait_time)


from splinter.browser import _DRIVERS
_DRIVERS['firefox'] = WebDriver
github ggozad / behaving / src / behaving / web / chrome.py View on Github external
"extensions_to_open": ""
        }}

        options.add_experimental_option("prefs", prefs)

        self.driver = Chrome(chrome_options=options, **kwargs)

        self.element_class = WebDriverElement

        self._cookie_manager = CookieManager(self.driver)

        super(WebDriver, self).__init__(wait_time)


from splinter.browser import _DRIVERS
_DRIVERS['chrome'] = WebDriver
github ggozad / behaving / src / behaving / mobile / ios.py View on Github external
while time.time() < end_time:
            if not self._is_text_present(text):
                return True
        return False

    def fill(self, name, value):
        field = self.find_by_accessibility_id(name)
        if not field:
            field = self.find_by_ios_class_chain(
                '**/XCUIElementTypeTextView[`name CONTAINS "%s"`]' % name)
        assert field, u'No elements found with accessibility id or name %s' % name
        field.first.set_value(value)


_DRIVERS['ios'] = IOSWebDriver