Contributing

The Source Code is hosted on GitHub.

For small fixes, opening a new Pull Request in the project’s repo is fine.

For larger issues or new features, please open an issue first.

If you want to add a new driver, check out our docs for creating new splinter drivers.

Before opening a new Pull Request, please ensure the linter and at least platform agnostic tests are passing on your branch.

Requirements

Development environments are managed using tox.

Generally, tox should be installed with pip:

pip install tox

See tox’s documentation if you need to use another method.

tox can then be run from the project root:

cd /path/to/source_code
# Lists the possible environments to use with `tox -e`
tox l

Linter

Splinter enforces code standards using various linting tools. They can be run from tox:

tox -e lint

Tests

Run

The tests are split into groups: Platform agnostic, Windows-only, and macOS-only.

To run the platform agnostic tests:

tox -e tests -- tests/
tox -e tests_selenium -- tests/

To run the Windows tests:

tox -e tests_windows_selenium -- tests/

To run the macOS tests:

tox -e tests_macos_selenium -- tests/

You can also specify one or more test files to run:

tox -e tests_windows_selenium -- tests/test_webdriver_firefox.py, tests/test_request_handler.py

Documentation

Write

Documentation is written using Sphinx, which uses RST.

We use the Sphinx-Immaterial Theme.

Build

The build_docs environment is a wrapper around Sphinx’s Makefile. Arguments will be passed to the Makefile. Thus, to build the docs in HTML format:

tox -e build_docs -- html

The documentation will then be built inside the docs/_build/html directory:

open docs/_build/html/index.html