How to use the splinter.driver.WebDriver 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 cobrateam / splinter / tests / unit / test_api_browser.py View on Github external
def test_visit(self):
        "Browser.visit should call driver.visit"

        with Mock() as mock:
            mock.visit('http://foo.com')
        with Stub() as browser:
            from splinter.driver import WebDriver
            WebDriver() >> mock
        browser = Browser()
        browser.visit('http://foo.com')

        WebDriver.restore_import()
        mock.validate()
github cobrateam / splinter / tests / unit / test_api_browser.py View on Github external
def test_quit(self):
        "Browser.quit should call driver.quit"
        with Mock() as mock:
            mock.quit()
        with Stub() as browser:
            from splinter.driver import WebDriver
            WebDriver() >> mock
        browser = Browser()
        browser.quit()

        WebDriver.restore_import()
        mock.validate()
github cobrateam / splinter / tests / unit / test_api_webdriver.py View on Github external
def test_visit(self):
        "WebDriver.visit should call browser.get"

        with Mock() as firefox_mock:
            firefox_mock.get('http://foo.com')

        with ReplaceBrowser(firefox_mock):
            driver = WebDriver()
            driver.visit('http://foo.com')

        firefox_mock.validate()
github cobrateam / splinter / tests / unit / test_api_browser.py View on Github external
def test_quit(self):
        "Browser.quit should call driver.quit"
        with Mock() as mock:
            mock.quit()
        with Stub() as browser:
            from splinter.driver import WebDriver
            WebDriver() >> mock
        browser = Browser()
        browser.quit()

        WebDriver.restore_import()
        mock.validate()
github cobrateam / splinter / tests / unit / test_api_webdriver.py View on Github external
def test_quit(self):
        "WebDriver.quit should call browser.quit"

        with Mock() as firefox_mock:
            firefox_mock.quit()

        with ReplaceBrowser(firefox_mock):
            driver = WebDriver()
            driver.quit()

        firefox_mock.validate()
github cobrateam / splinter / tests / unit / test_api_webdriver.py View on Github external
def test_title(self):
        "WebDriver.title should call browser.title"

        with Mock() as firefox_mock:
            firefox_mock.get_title()

        with ReplaceBrowser(firefox_mock):
            driver = WebDriver()
            driver.title

        firefox_mock.validate()