diff --git a/pytest_splinter/plugin.py b/pytest_splinter/plugin.py index 88fd003..dd1a24e 100644 --- a/pytest_splinter/plugin.py +++ b/pytest_splinter/plugin.py @@ -449,7 +449,7 @@ def _take_screenshot( warnings.warn(pytest.PytestWarning("Could not save screenshot: {}".format(e))) -@pytest.yield_fixture(autouse=True) +@pytest.fixture(autouse=True) def _browser_screenshot_session( request, session_tmpdir, @@ -607,12 +607,12 @@ def _take_screenshot_on_failure(): # https://github.com/SeleniumHQ/selenium/issues/3508 browser.driver.set_window_size(*splinter_window_size) try: - browser.cookies.delete() + browser.cookies.delete_all() except (IOError, HTTPException, WebDriverException): LOGGER.warning("Error cleaning browser cookies", exc_info=True) for url in splinter_clean_cookies_urls: browser.visit(url) - browser.cookies.delete() + browser.cookies.delete_all() if hasattr(browser, "driver"): browser.visit_condition = splinter_browser_load_condition browser.visit_condition_timeout = splinter_browser_load_timeout diff --git a/setup.py b/setup.py index 97d0c9f..bd89249 100755 --- a/setup.py +++ b/setup.py @@ -32,7 +32,7 @@ }, install_requires=[ 'setuptools', - 'splinter>=0.13.0', + 'splinter>=0.15.0', 'selenium', 'pytest>=3.0.0', 'urllib3', diff --git a/tests/mocked_browser/conftest.py b/tests/mocked_browser/conftest.py index 2704629..205afbd 100644 --- a/tests/mocked_browser/conftest.py +++ b/tests/mocked_browser/conftest.py @@ -10,7 +10,7 @@ def splinter_session_scoped_browser(): return False -@pytest.yield_fixture(autouse=True) +@pytest.fixture(autouse=True) def mocked_browser(browser_pool, request): """Mock splinter browser.""" # to avoid re-using of cached browser from other tests