pytest splinter and selenium integration for anyone interested in browser interaction in tests

Overview

Splinter plugin for the pytest runner

Join the chat at https://gitter.im/pytest-dev/pytest-splinter https://travis-ci.org/pytest-dev/pytest-splinter.svg?branch=master Documentation Status

Install pytest-splinter

pip install pytest-splinter

Features

The plugin provides a set of fixtures to use splinter for browser testing with pytest

Fixtures

  • browser
    Get the splinter's Browser. Fixture is underneath session scoped, so browser process is started once per test session, but the state of the browser will be clean (current page is blank, cookies clean).
  • session_browser
    The same as browser except the lifetime. This fixture is session-scoped so will only be finalized at the end of the whole test session. Useful if you want to speedup your test suite paying with reduced test isolation.
  • browser_instance_getter
    Function to create an instance of the browser. This fixture is required only if you need to have multiple instances of the Browser in a single test at the same time. Example of usage:
@pytest.fixture
def admin_browser(request, browser_instance_getter):
    """Admin browser fixture."""
    # browser_instance_getter function receives parent fixture -- our admin_browser
    return browser_instance_getter(request, admin_browser)

def test_2_browsers(browser, admin_browser):
    """Test using 2 browsers at the same time."""
    browser.visit('http://google.com')
    admin_browser.visit('http://admin.example.com')
  • splinter_selenium_implicit_wait
    Implicit wait timeout to be passed to Selenium webdriver. Fixture gets the value from the command-line option splinter-implicit-wait (see below)
  • splinter_wait_time
    Explicit wait timeout (for waiting for explicit condition via wait_for_condition). Fixture gets the value from the command-line option splinter-wait-time (see below)
  • splinter_selenium_speed
    Speed for Selenium, if not 0 then it will sleep between each selenium command. Useful for debugging/demonstration. Fixture gets the value from the command-line option splinter-speed (see below)
  • splinter_selenium_socket_timeout
    Socket timeout for communication between the webdriver and the browser. Fixture gets the value from the command-line option splinter-socket-timeout (see below)
  • splinter_webdriver
    Splinter's webdriver name to use. Fixture gets the value from the command-line option splinter-webdriver (see below). To make pytest-splinter always use certain webdriver, override a fixture in your conftest.py file:
import pytest

@pytest.fixture(scope='session')
def splinter_webdriver():
    """Override splinter webdriver name."""
    return 'chrome'
  • splinter_remote_url
    Splinter's webdriver remote url to use (optional). Fixture gets the value from the command-line option splinter-remote-url (see below). Will be used only if selected webdriver name is 'remote'.
  • splinter_session_scoped_browser
    pytest-splinter should use single browser instance per test session. Fixture gets the value from the command-line option splinter-session-scoped-browser (see below)
  • splinter_file_download_dir
    Directory, to which browser will automatically download the files it will experience during browsing. For example when you click on some download link. By default it's a temporary directory. Automatic downloading of files is only supported for firefox driver at the moment.
  • splinter_download_file_types
    Comma-separated list of content types to automatically download. By default it's the all known system mime types (via mimetypes standard library).
  • splinter_browser_load_condition
    Browser load condition, python function which should return True. If function returns False, it will be run several times, until timeout below reached.
  • splinter_browser_load_timeout
    Browser load condition timeout in seconds, after this timeout the exception WaitUntilTimeout will be raised.
  • splinter_wait_time
    Browser explicit wait timeout in seconds, after this timeout the exception WaitUntilTimeout will be raised.
  • splinter_firefox_profile_preferences
    Firefox profile preferences, a dictionary which is passed to selenium webdriver's profile_preferences
  • splinter_firefox_profile_directory
    Firefox profile directory to use as template for firefox profile created by selenium. By default, it's an empty directly inside pytest_splinter/profiles/firefox
  • splinter_driver_kwargs
    Webdriver keyword arguments, a dictionary which is passed to selenium webdriver's constructor (after applying firefox preferences)
import pytest
from pathlib import Path

@pytest.fixture
def splinter_driver_kwargs():
    """
    Webdriver kwargs for Firefox.
    https://selenium-python.readthedocs.io/api.html#module-selenium.webdriver.firefox.webdriver
    """
    return {"service_log_path": Path("/log/directory/geckodriver.log")}
  • splinter_window_size
    Size of the browser window on browser initialization. Tuple in form (<width>, <height>). Default is (1366, 768)
  • splinter_screenshot_dir
    pytest-splinter browser screenshot directory. This fixture gets the value from the command-line option splinter-screenshot-dir (see below).
  • splinter_make_screenshot_on_failure
    Should pytest-splinter take browser screenshots on test failure? This fixture gets the value from the command-line option splinter-make-screenshot-on-failure (see below).
  • splinter_screenshot_encoding
    Encoding of the html screenshot on test failure. UTF-8 by default.
  • splinter_screenshot_getter_html
    Function to get browser html screenshot. By default, it saves browser.html with given path and splinter_screenshot_encoding encoding.
  • splinter_screenshot_getter_png
    Function to get browser image (png) screenshot. By default, it calls browser.save_sceenshot with given path.
  • splinter_driver_executable
    Filesystem path of the webdriver executable. This fixture gets the value from the command-line option splinter-webdriver-executable (see below).
  • splinter_browser_class
    Class to use for browser instance. Defaults to pytest_splinter.plugin.Browser.
  • splinter_clean_cookies_urls
    List of additional urls to clean cookies on. By default, during the preparation of the browser for the test, pytest-splinter only cleans cookies for the last visited url from previous test, as it's not possible to clean all cookies from all domains at once via webdriver protocol, by design. This limitation can be worked around if you know the list of urls, the domains for which you need to clean cookies (for example https://facebook.com). If so, you can override this fixture and put those urls there, and pytest-splinter will visit each of them and will clean the cookies for each domain.
  • splinter_headless
    Run Chrome in headless mode. Defaults to false. http://splinter.readthedocs.io/en/latest/drivers/chrome.html#using-headless-option-for-chrome

Command-line options

  • --splinter-implicit-wait

    Selenium webdriver implicit wait. Seconds (default: 5).

  • --splinter-speed

    selenium webdriver speed (from command to command). Seconds (default: 0).

  • --splinter-socket-timeout

    Selenium webdriver socket timeout for for communication between the webdriver and the browser. Seconds (default: 120).

  • --splinter-webdriver

    Webdriver name to use. (default: firefox). Options:

    • firefox
    • remote
    • chrome

    For more details refer to the documentation for splinter and selenium.

  • --splinter-remote-url

    Webdriver remote url to use. (default: None). Will be used only if selected webdriver name is 'remote'.

    For more details refer to the documentation for splinter and selenium.

  • --splinter-session-scoped-browser

    pytest-splinter should use a single browser instance per test session. Choices are 'true' or 'false' (default: 'true').

  • --splinter-make-screenshot-on-failure

    pytest-splinter should take browser screenshots on test failure. Choices are 'true' or 'false' (default: 'true').

  • --splinter-screenshot-dir

    pytest-splinter browser screenshot directory. Defaults to the current directory.

  • --splinter-webdriver-executable

    Filesystem path of the webdriver executable. Used by chrome driver. Defaults to the None in which case the shell PATH variable setting determines the location of the executable.

  • --splinter-headless

    Override splinter_headless fixture. Choices are 'true' or 'false', default: 'true'. http://splinter.readthedocs.io/en/latest/drivers/chrome.html#using-headless-option-for-chrome https://splinter.readthedocs.io/en/latest/drivers/firefox.html#using-headless-option-for-firefox

Browser fixture

As mentioned above, browser is a fixture made by creating splinter's Browser object, but with some overrides.

  • visit
    Added possibility to wait for condition on each browser visit by having a fixture.
  • wait_for_condition
    Method copying selenium's wait_for_condition, with difference that condition is in python, so there you can do whatever you want, and not only execute javascript via browser.evaluate_script.

Automatic screenshots on test failure

When your functional test fails, it's important to know the reason. This becomes hard when tests are being run on the continuous integration server, where you cannot debug (using --pdb). To simplify things, a special behaviour of the browser fixture is available, which takes a screenshot on test failure and puts it in a folder with the a naming convention compatible to the jenkins plugin. The html content of the browser page is also stored, this can be useful for debugging the html source.

Creating screenshots is fully compatible with pytest-xdist plugin and will transfer the screenshots from the worker nodes through the communication channel automatically.

If a test (using the browser fixture) fails, you should get a screenshot files in the following path:

<splinter-screenshot-dir>/my.dotted.name.test.package/test_name-browser.png
<splinter-screenshot-dir>/my.dotted.name.test.package/test_name-browser.html

The splinter-screenshot-dir for storing the screenshot is generated by a fixture and can be provided through a command line argument, as described above at the configuration options section.

Taking screenshots on test failure is enabled by default. It can be controlled through the splinter_make_screenshot_on_failure fixture, where return False skips it. You can also disable it via a command line argument:

pytest tests/functional --splinter-make-screenshot-on-failure=false

In case taking a screenshot fails, a pytest warning will be issued, which can be viewed using the -rw argument for pytest.

Python3 support

Python3 is supported, check if you have recent version of splinter as it was added recently.

Example

test_your_test.py:

def test_some_browser_stuff(browser):
    """Test using real browser."""
    url = "http://www.google.com"
    browser.visit(url)
    browser.fill('q', 'splinter - python acceptance testing for web applications')
    # Find and click the 'search' button
    button = browser.find_by_name('btnK')
    # Interact with elements
    button.click()
    assert browser.is_text_present('splinter.cobrateam.info'), "splinter.cobrateam.info wasn't found... We need to"
    ' improve our SEO techniques'

Contact

If you have questions, bug reports, suggestions, etc. please create an issue on the GitHub project page.

License

This software is licensed under the MIT license

See License file

© 2014 Anatoly Bubenkov, Paylogic International and others.

Comments
  • Driver remote and browser name capability by command line

    Driver remote and browser name capability by command line

    Hi,

    is there a way for specify by command line the capabilities (eg: browser name) for remote drivers?

    I've seen that pytest-selenium let you choose specific capabilities:

    • http://pytest-selenium.readthedocs.io/en/latest/user_guide.html#selenium-server-grid

    It would be cool having a similar feature because you don't hardcode anything in your code but I was not able to find anything of similar in pytest-splinter, could you suggest what is the best approach please?

    opened by davidemoro 13
  • browser.status_code not available

    browser.status_code not available

    I tried to access "status_code" from the browser fixture but it appears to be missing?

    print browser.status_code   # get AttributeError
    

    returns

    E       AttributeError: 'WebDriver' object has no attribute 'status_code'
    
    venv/lib/python2.7/site-packages/pytest_splinter/plugin.py:29: AttributeError
    

    http://splinter.cobrateam.info/docs/http-status-code-and-exception.html

    opened by alvinchow86 13
  • improvement: save test failure stack trace side-by-side with screenshot

    improvement: save test failure stack trace side-by-side with screenshot

    even though having screenshots is very handy, not all the time it is enough to let us figure out what caused the issue. in this scenario, having the failure stack trace side-by-side with the screenshot is very helpful. therefore, this ticket suggests the creation of a cd line argument to let us save the test failure as a file which can go side-by-side with the screenshot (e.g. create_item.png , create_item.log) in order to easy the failure analysis.

    enhancement 
    opened by pjotal 12
  • Direct use of 'tmpdir' fixture causes warnings to be raised in latest pytest versions

    Direct use of 'tmpdir' fixture causes warnings to be raised in latest pytest versions

    The following warning message appears after test runs:

    RemovedInPytest4Warning: Fixture "tmpdir" called directly. Fixtures are not meant to be called directly, are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/latest/fixture.html for more information.

    bug 
    opened by jsfehler 11
  • Ghostdriver issue

    Ghostdriver issue

    After upgrading from 1.0.3 -> 1.1.0, I get the following issue, when using PhantomJS:

    mx/webapp/tests/acceptance/test_foo.py:34: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    /home/bhe/.virtualenvs/mx-py34/lib/python3.4/site-packages/pytest_bdd/scenario.py:168: in _execute_scenario
        _execute_step_function(request, feature, step, step_func, example=example)
    /home/bhe/.virtualenvs/mx-py34/lib/python3.4/site-packages/pytest_bdd/scenario.py:123: in _execute_step_function
        step_func(**kwargs)
    /home/bhe/.virtualenvs/mx-py34/lib/python3.4/site-packages/pytest_bdd/steps.py:146: in <lambda>
        step_func = lambda request: request.getfuncargvalue(func.__name__)
    /home/bhe/.virtualenvs/mx-py34/lib/python3.4/site-packages/_pytest/python.py:1337: in getfuncargvalue
        return self._get_active_fixturedef(argname).cached_result[0]
    /home/bhe/.virtualenvs/mx-py34/lib/python3.4/site-packages/_pytest/python.py:1351: in _get_active_fixturedef
        result = self._getfuncargvalue(fixturedef)
    /home/bhe/.virtualenvs/mx-py34/lib/python3.4/site-packages/_pytest/python.py:1403: in _getfuncargvalue
        val = fixturedef.execute(request=subrequest)
    /home/bhe/.virtualenvs/mx-py34/lib/python3.4/site-packages/_pytest/python.py:1820: in execute
        fixturedef = request._get_active_fixturedef(argname)
    /home/bhe/.virtualenvs/mx-py34/lib/python3.4/site-packages/_pytest/python.py:1351: in _get_active_fixturedef
        result = self._getfuncargvalue(fixturedef)
    /home/bhe/.virtualenvs/mx-py34/lib/python3.4/site-packages/_pytest/python.py:1403: in _getfuncargvalue
        val = fixturedef.execute(request=subrequest)
    /home/bhe/.virtualenvs/mx-py34/lib/python3.4/site-packages/_pytest/python.py:1853: in execute
        self.yieldctx)
    /home/bhe/.virtualenvs/mx-py34/lib/python3.4/site-packages/_pytest/python.py:1779: in call_fixture_func
        res = fixturefunc(**kwargs)
    /home/bhe/.virtualenvs/mx-py34/lib/python3.4/site-packages/pytest_splinter/plugin.py:274: in browser
        return browser_instance_getter(browser)
    /home/bhe/.virtualenvs/mx-py34/lib/python3.4/site-packages/pytest_splinter/plugin.py:251: in prepare_browser
        browser = browser_pool[browser_key] = get_browser()
    /home/bhe/.virtualenvs/mx-py34/lib/python3.4/site-packages/pytest_splinter/plugin.py:232: in get_browser
        visit_condition_timeout=splinter_browser_load_timeout, **copy.deepcopy(kwargs)
    /home/bhe/.virtualenvs/mx-py34/lib/python3.4/site-packages/pytest_splinter/plugin.py:27: in __init__
        self.browser = splinter.Browser(*args, **kwargs)
    /home/bhe/.virtualenvs/mx-py34/lib/python3.4/site-packages/splinter/browser.py:53: in Browser
        return driver(*args, **kwargs)
    /home/bhe/.virtualenvs/mx-py34/lib/python3.4/site-packages/splinter/driver/webdriver/phantomjs.py:28: in __init__
        self.driver = PhantomJS(desired_capabilities=capabilities, **kwargs)
    /home/bhe/.virtualenvs/mx-py34/lib/python3.4/site-packages/selenium/webdriver/phantomjs/webdriver.py:50: in __init__
        self.service.start()
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    
    self = <selenium.webdriver.phantomjs.service.Service object at 0x7f47ab8c5470>
    
        def start(self):
            """
                Starts PhantomJS with GhostDriver.
    
                :Exceptions:
                 - WebDriverException : Raised either when it can't start the service
                   or when it can't connect to the service
                """
            try:
                self.process = subprocess.Popen(self.service_args, stdin=subprocess.PIPE,
                                                close_fds=platform.system() != 'Windows',
                                                stdout=self._log, stderr=self._log)
    
            except Exception as e:
                raise WebDriverException("Unable to start phantomjs with ghostdriver.", e)
            count = 0
            while not utils.is_connectable(self.port):
                count += 1
                time.sleep(1)
                if count == 30:
    >                raise WebDriverException("Can not connect to GhostDriver")
    E                selenium.common.exceptions.WebDriverException: Message: 'Can not connect to GhostDriver'
    
    opened by bh 11
  • browser instance not clean

    browser instance not clean

    I came across an issue I'd hope to get some help to resolve. pytest-splinter 1.6.6.

    When using a the default browser fixture, something is being cached across the tests and browser instance is in fact not clean when the test starts. Particularly, OAuth2 login to an third party site (Facebook, others) made through the browser is still available in the next test and Facebook doesn't present the login page.

    For example, I have two tests (test_presto_login and test_presto_non_evaluated_user) which login to a third party website using a browser. The latter test doesn't log in a different user, but OAuth provider (third party website) somehow remembers the login from the previous test and thus gives wrong authorization.

    The workaround is to create a different browser instance for tests using different OAuth users, but I'd like to track down what is causing this behavior and make sure browser is cleaned up properly.

    Any idea where I should start to poke this and see what's stored inside the browser which is not being cleaned up?

    Below is the sample code:

    def do_presto_login(browser, presto_user=PRESTO_USER_WITH_RECOMMENDATION, presto_password=PRESTO_PASSWORD):
    
        b = browser
    
        assert b.is_text_present("Sign in to your account")
    
        b.fill("user[email]", presto_user)
        b.fill("user[password]", presto_password)
        b.find_by_css("input[name='commit']").click()
    
        # First time login pops up allow permission dialog.
        if b.is_text_present("Authorization required"):
            b.find_by_css("input[name='commit']").click()
    
    def test_presto_login(web_server, browser, DBSession, init):
    
        b = browser
    
        # Initiate Presto login with Authomatic
        b.visit("{}/login".format(web_server))
        b.find_by_css(".btn-login-prestodoctor").click()
    
        do_presto_login_if_needed(b)
    
    def test_presto_non_evaluated_user(web_server, browser, DBSession, init):
    
        b = browser
    
        # Initiate Presto login with Authomatic
        b.visit("{}/login".format(web_server))
        b.find_by_css(".btn-login-prestodoctor").click()
    
        do_presto_login_if_needed(b, presto_user=PRESTO_USER_WITHOUT_RECOMMENDATION)
    

    As a workaround you can create another browser instance for the another OAuth user:

    @pytest.fixture
    def non_evaluated_user_browser(request, browser_instance_getter):
        return browser_instance_getter(request, non_evaluated_user_browser)
    
    def test_presto_non_evaluated_user(web_server, non_evaluated_user_browser, DBSession, init):
    
        b = non_evaluated_user_browser
    
        # Initiate Presto login with Authomatic
        b.visit("{}/login".format(web_server))
        b.find_by_css(".btn-login-prestodoctor").click()
    
        do_presto_login_if_needed(b, presto_user=PRESTO_USER_WITHOUT_RECOMMENDATION)
    
        assert b.is_text_present("You are now logged in")
    
    opened by miohtama 10
  • Do not close browser on test failures (optionally)

    Do not close browser on test failures (optionally)

    I am just experimenting with pytest-splinter, and have already used the following method before:

    @pytest.yield_fixture(scope='function', …)
    def browser(request, live_server):
        # …
    
        failed_before = request.session._testsfailed
        yield browser
    
        # Quit the browser only if the test has not failed.
        # ...or request.config.option.maxfail > request.session._testsfailed:
        if request.session._testsfailed == failed_before:
            b.quit()
    

    This uses a rather new feature of py.test (yield.fixture), instead of adding a finalizer to the request.

    Do you think it makes sense to add such a feature to pytest-splinter?

    I am currently wrapping pytest-splinter's browser fixture with this method and have defined the fixture splinter_close_browser to return False, which appears to work.

    opened by blueyed 10
  • I'm unable to make splinter on CI return anything else than

    I'm unable to make splinter on CI return anything else than "flask" webdriver

    Hi,

    PR: #163

    All I get on CI is "flask" web driver. There is Firefox installed, there is gecko driver executable, I even made it download Selenium - just like the old times - and I'm unable to replicate this on my local setup.

    If anybody has any ideas please help, we could have working CI by now if not that bug.

    help-needed 
    opened by mpasternak 9
  • Simplify --splinter-headless

    Simplify --splinter-headless

    It feels a bit strange doing true/false for a headless option. It could be my own aesthetic / tastes.

    argparse has 'store_true' for cases like this (see docs):

    'store_true' and 'store_false' - These are special cases of 'store_const' used for storing the values True and False respectively. In addition, they create default values of False and True respectively..

    So --headless sets it to True.

    I can't think of a case where a user would want to accept False considering the default behavior is that, but if they did, they can always add their own option via pytest_addoption)

    Not entering --splinter-headless infers False (this is backed by default values in pytest-splinter and probably user intuition). Entering --headless implies the user wants to run in headless mode.

    opened by tony 9
  • pytest-splinter does not work with splinter>=0.18.0

    pytest-splinter does not work with splinter>=0.18.0

    
        def patch_webdriverelement():  # pragma: no cover
            """Patch the WebDriverElement to allow firefox to use mouse_over."""
        
            def mouse_over(self):
                """Perform a mouse over the element which works."""
                (
                    ActionChains(self.parent.driver)
                    .move_to_element_with_offset(self._element, 2, 2)
                    .perform()
                )
        
            # Apply the monkey patch for Firefox WebDriverElement
    >       firefox.WebDriverElement.mouse_over = mouse_over
    E       AttributeError: module 'splinter.driver.webdriver.firefox' has no attribute 'WebDriverElement'
    
    .venv/lib64/python3.10/site-packages/pytest_splinter/splinter_patches.py:21: AttributeError
    
    opened by enkidulan 8
  • AttributeError: 'function' object has no attribute 'ensure'

    AttributeError: 'function' object has no attribute 'ensure'

    I've tried to make a patch but I don't get why all those branches are there. Why is screenshot_dir recreated in certain conditions?

    [gw1] linux2 -- Python 2.7.12 /usr/bin/python2.7
    Traceback (most recent call last):
      File "/usr/local/lib/python2.7/dist-packages/pytest_splinter/plugin.py", line 522, in _take_screenshot_on_failure
        splinter_screenshot_getter_png=splinter_screenshot_getter_png,
      File "/usr/local/lib/python2.7/dist-packages/pytest_splinter/plugin.py", line 376, in _take_screenshot
        screenshot_dir = session_tmpdir.ensure('screenshots', dir=True).strpath
    AttributeError: 'function' object has no attribute 'ensure'
    
    opened by ionelmc 8
  • Lint won't pass - for now

    Lint won't pass - for now

    In the old tox configuration I can find that there was lint running, which used black.

    The current codebase is not very likely to be black-compatible, as you can see here: https://github.com/pytest-dev/pytest-splinter/runs/7750268300?check_suite_focus=true

    I am against re-formatting the whole codebase. But I am totally for keeping up the code quality of changes introduced. On the other hand, isort or pyupgrade will mess the codebase a bit. As you can see in the lint run.

    Is there any good solution? We can disable lint build target manually in GA, of course. This is one of the reasons I separated it from the "main" tests.

    Ideas?

    opened by mpasternak 0
  • Mixing implicit and explicit wait

    Mixing implicit and explicit wait

    Hi there, it seems in pytest-splinter it is not possible to disable implicit wait (see here https://github.com/pytest-dev/pytest-splinter/blob/5522d59fcabfa8904385c1e10ca61460a25193e0/pytest_splinter/plugin.py#L596)

    but the issue is that if I want to use an explicit wait (pytest-splinter allow this) it will result in mixing explicit (the one I define) and implicit wait and this can take to strange waits behaviour (see: https://octopus.com/blog/selenium/8-mixing-waits/mixing-waits).

    How to address this issue or disable implicit wait?

    opened by jobezic 2
  • Screenshots won't work with pytest 5

    Screenshots won't work with pytest 5

    In _browser_screenshot_session, you have the following code:

    
        fixture_values = (
            # pytest 3
            getattr(request, '_fixture_values', {}) or
            # pytest 2
            getattr(request, '_funcargs', {})
        )
    
        for name, value in fixture_values.items():
    

    None of these getters are set in pytest 5.

    opened by pedrospdc 1
Releases(2.0.0)
  • 2.0.0(Aug 31, 2018)

    • Bump minimum splinter version to 0.9.0 (jsfehler)
      • status code support is removed
      • file download is not working due to https://bugzilla.mozilla.org/show_bug.cgi?id=1366035
    • Remove phantomjs support. (jsfehler)
    Source code(tar.gz)
    Source code(zip)
Owner
pytest-dev
pytest-dev
Pytest-rich - Pytest + rich integration (proof of concept)

pytest-rich Leverage rich for richer test session output. This plugin is not pub

Bruno Oliveira 170 Dec 2, 2022
:game_die: Pytest plugin to randomly order tests and control random.seed

pytest-randomly Pytest plugin to randomly order tests and control random.seed. Features All of these features are on by default but can be disabled wi

pytest-dev 471 Dec 30, 2022
ApiPy was created for api testing with Python pytest framework which has also requests, assertpy and pytest-html-reporter libraries.

ApiPy was created for api testing with Python pytest framework which has also requests, assertpy and pytest-html-reporter libraries. With this f

Mustafa 1 Jul 11, 2022
a wrapper around pytest for executing tests to look for test flakiness and runtime regression

bubblewrap a wrapper around pytest for assessing flakiness and runtime regressions a cs implementations practice project How to Run: First, install de

Anna Nagy 1 Aug 5, 2021
splinter - python test framework for web applications

splinter - python tool for testing web applications splinter is an open source tool for testing web applications using Python. It lets you automate br

Cobra Team 2.6k Dec 27, 2022
splinter - python test framework for web applications

splinter - python tool for testing web applications splinter is an open source tool for testing web applications using Python. It lets you automate br

Cobra Team 2.3k Feb 5, 2021
The pytest framework makes it easy to write small tests, yet scales to support complex functional testing

The pytest framework makes it easy to write small tests, yet scales to support complex functional testing for applications and libraries. An example o

pytest-dev 9.6k Jan 2, 2023
Selects tests affected by changed files. Continous test runner when used with pytest-watch.

This is a pytest plug-in which automatically selects and re-executes only tests affected by recent changes. How is this possible in dynamic language l

Tibor Arpas 614 Dec 30, 2022
Playwright Python tool practice pytest pytest-bdd screen-play page-object allure cucumber-report

pytest-ui-automatic Playwright Python tool practice pytest pytest-bdd screen-play page-object allure cucumber-report How to run Run tests execute_test

moyu6027 11 Nov 8, 2022
pytest plugin providing a function to check if pytest is running.

pytest-is-running pytest plugin providing a function to check if pytest is running. Installation Install with: python -m pip install pytest-is-running

Adam Johnson 21 Nov 1, 2022
Pytest-typechecker - Pytest plugin to test how type checkers respond to code

pytest-typechecker this is a plugin for pytest that allows you to create tests t

vivax 2 Aug 20, 2022
A library to make concurrent selenium tests that automatically download and setup webdrivers

AutoParaSelenium A library to make parallel selenium tests that automatically download and setup webdrivers Usage Installation pip install autoparasel

Ronak Badhe 8 Mar 13, 2022
Automated tests for OKAY websites in Python (Selenium) - user friendly version

Okay Selenium Testy Aplikace určená k testování produkčních webů společnosti OKAY s.r.o. Závislosti K běhu aplikace je potřeba mít v počítači nainstal

Viktor Bem 0 Oct 1, 2022
User-oriented Web UI browser tests in Python

Selene - User-oriented Web UI browser tests in Python (Selenide port) Main features: User-oriented API for Selenium Webdriver (code like speak common

Iakiv Kramarenko 575 Jan 2, 2023
LuluTest is a Python framework for creating automated browser tests.

LuluTest LuluTest is an open source browser automation framework using Python and Selenium. It is relatively lightweight in that it mostly provides wr

Erik Whiting 14 Sep 26, 2022
A rewrite of Python's builtin doctest module (with pytest plugin integration) but without all the weirdness

The xdoctest package is a re-write of Python's builtin doctest module. It replaces the old regex-based parser with a new abstract-syntax-tree based pa

Jon Crall 174 Dec 16, 2022
Docker-based integration tests

Docker-based integration tests Description Simple pytest fixtures that help you write integration tests with Docker and docker-compose. Specify all ne

Avast 326 Dec 27, 2022
Integration layer between Requests and Selenium for automation of web actions.

Requestium is a Python library that merges the power of Requests, Selenium, and Parsel into a single integrated tool for automatizing web actions. The

Tryolabs 1.7k Dec 27, 2022
A command-line tool and Python library and Pytest plugin for automated testing of RESTful APIs, with a simple, concise and flexible YAML-based syntax

1.0 Release See here for details about breaking changes with the upcoming 1.0 release: https://github.com/taverntesting/tavern/issues/495 Easier API t

null 909 Dec 15, 2022