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
Python selenium script to bypass simaster.ugm.ac.id weak captcha.

Python selenium script to bypass simaster.ugm.ac.id weak "captcha".

Hafidh R K 1 Feb 01, 2022
AutoExploitSwagger is an automated API security testing exploit tool that can be combined with xray, BurpSuite and other scanners.

AutoExploitSwagger is an automated API security testing exploit tool that can be combined with xray, BurpSuite and other scanners.

6 Jan 28, 2022
Mockoon is the easiest and quickest way to run mock APIs locally. No remote deployment, no account required, open source.

Mockoon Mockoon is the easiest and quickest way to run mock APIs locally. No remote deployment, no account required, open source. It has been built wi

mockoon 4.4k Dec 30, 2022
A small faсade for the standard python mocker library to make it user-friendly

unittest-mocker Inspired by the pytest-mock, but written from scratch for using with unittest and convenient tool - patch_class Installation pip insta

Vertliba V.V. 6 Jun 10, 2022
Lightweight, scriptable browser as a service with an HTTP API

Splash - A javascript rendering service Splash is a javascript rendering service with an HTTP API. It's a lightweight browser with an HTTP API, implem

Scrapinghub 3.8k Jan 03, 2023
自动化爬取并自动测试所有swagger-ui.html显示的接口

swagger-hack 在测试中偶尔会碰到swagger泄露 常见的泄露如图: 有的泄露接口特别多,每一个都手动去试根本试不过来 于是用python写了个脚本自动爬取所有接口,配置好传参发包访问 原理是首先抓取http://url/swagger-resources 获取到有哪些标准及对应的文档地

jayus 534 Dec 29, 2022
Argument matchers for unittest.mock

callee Argument matchers for unittest.mock More robust tests Python's mocking library (or its backport for Python 3.3) is simple, reliable, and easy

Karol Kuczmarski 77 Nov 03, 2022
pytest plugin that let you automate actions and assertions with test metrics reporting executing plain YAML files

pytest-play pytest-play is a codeless, generic, pluggable and extensible automation tool, not necessarily test automation only, based on the fantastic

pytest-dev 67 Dec 01, 2022
pytest plugin for testing mypy types, stubs, and plugins

pytest plugin for testing mypy types, stubs, and plugins Installation This package is available on PyPI pip install pytest-mypy-plugins and conda-forg

TypedDjango 74 Dec 31, 2022
Front End Test Automation with Pytest Framework

Front End Test Automation Framework with Pytest Installation and running instructions: 1. To install the framework on your local machine: clone the re

Sergey Kolokolov 2 Jun 17, 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 08, 2022
UUM Merit Form Filler is a web automation which helps automate entering a matric number to the UUM system in order for participants to obtain a merit

About UUM Merit Form Filler UUM Merit Form Filler is a web automation which helps automate entering a matric number to the UUM system in order for par

Ilham Rachmat 3 May 31, 2022
bulk upload files to libgen.lc (Selenium script)

LibgenBulkUpload bulk upload files to http://libgen.lc/librarian.php (Selenium script) Usage ./upload.py to_upload uploaded rejects So title and autho

8 Jul 07, 2022
FauxFactory generates random data for your automated tests easily!

FauxFactory FauxFactory generates random data for your automated tests easily! There are times when you're writing tests for your application when you

Og Maciel 37 Sep 23, 2022
Tattoo - System for automating the Gentoo arch testing process

Naming origin Well, naming things is very hard. Thankfully we have an excellent

Arthur Zamarin 4 Nov 07, 2022
Test utility for validating OpenAPI documentation

DRF OpenAPI Tester This is a test utility to validate DRF Test Responses against OpenAPI 2 and 3 schema. It has built-in support for: OpenAPI 2/3 yaml

snok 103 Dec 21, 2022
WEB PENETRATION TESTING TOOL 💥

N-WEB ADVANCE WEB PENETRATION TESTING TOOL Features 🎭 Admin Panel Finder Admin Scanner Dork Generator Advance Dork Finder Extract Links No Redirect H

56 Dec 23, 2022
Python wrapper of Android uiautomator test tool.

uiautomator This module is a Python wrapper of Android uiautomator testing framework. It works on Android 4.1+ (API Level 16~30) simply with Android d

xiaocong 1.9k Dec 30, 2022
Flexible test automation for Python

Nox - Flexible test automation for Python nox is a command-line tool that automates testing in multiple Python environments, similar to tox. Unlike to

Stargirl Flowers 941 Jan 03, 2023
BDD library for the py.test runner

BDD library for the py.test runner pytest-bdd implements a subset of the Gherkin language to enable automating project requirements testing and to fac

pytest-dev 1.1k Jan 09, 2023