Skip to main content

snakeoil-web

PyPI version Python 3.8+ License: MIT

Dependencies

  • Python 3.8+
  • A supported browser installed on your machine (Chrome, Firefox, Safari, or Edge)

Everything else — Playwright, pytest, pytest-html — is installed automatically by snakeoil init.


Install

pip install snakeoil-web

Quick start

pip install snakeoil-web
snakeoil init
pytest web-tests/

snakeoil init creates your project structure, installs pytest and pytest-html, installs browser binaries, and generates sample tests ready to run.


What snakeoil init creates

your-project/
├── snakeoil.web.config.py   ← configure URL, browser, headless mode
├── pytest.ini               ← pytest settings
└── web-tests/
    ├── test_english.py      ← English instruction style tests
    └── test_pythonic.py     ← Pythonic API style tests

After running your tests:

your-project/
└── report.html              ← test report (open in browser)

Configuration

Edit snakeoil.web.config.py in your project root to point at your site and set your preferences:

# URL of the site under test
URL = "https://yourapp.com"

# Browser to use: chrome | firefox | safari | edge
# chrome  — Google Chrome (must be installed)
# firefox — Mozilla Firefox (must be installed)
# safari  — Safari via WebKit (macOS only)
# edge    — Microsoft Edge (must be installed)
BROWSER = "chrome"

# Run browser without a visible window (True for CI, False for local debugging)
HEADLESS = False

# Launch browser maximized (ignored when HEADLESS = True)
MAXIMIZED = True

# Maximum time in milliseconds to wait for elements and page loads
TIMEOUT = 10_000

# Directory where report.html is saved after each test run
RESULT_DIR = "test_report"

# Capture a screenshot when a step fails and embed it in the report
SCREENSHOTS_ON_FAILURE = False

Two ways to write tests

English — human readable, shareable with non-developers:

def test_login(agent):
    agent.run([
        'type "harish@example.com" into "Email"',
        'type "secret123" into "Password"',
        'click "Sign in"',
        'verify text "Dashboard" is present',
    ])

Pythonic — IDE guided, autocomplete friendly:

def test_login(agent):
    (agent
        .type("harish@example.com", into="Email")
        .type("secret123", into="Password")
        .click("Sign in")
        .verify_text("Dashboard")
    )

Supported instructions

Actions

Instruction Example
Type into a field type "value" into "Field Label"
Click an element click "Button Text"
Click by position click "Add to cart" below "Product Name"
Click near element click "Edit" near "John Smith"
Click nth element click second "Add to cart"
Select a dropdown select "Option" from "dropdown_name"
Hover over element hover "element"
Press a key press Enter
Navigate to URL navigate "https://yourapp.com/page"

Verification

Instruction Example
Verify text is present verify text "Welcome" is present
Verify element is present verify "Submit" is present
Verify element is visible verify "Submit" is visible
Verify text next to element verify text next to "Balance" is "$100.00"
Verify text below element verify text below "Total" is "$29.99"

Extraction

Instruction Example
Extract from element extract text from "element_class"
Extract nth extract text from first "item name"
Extract next to element extract text next to "Balance"
Extract near element extract text near "Balance"
Extract below element extract text below "Label"
Extract above element extract text above "Label"
Capture into variable {{price}} = extract text next to "Total"

Spatial targeting

Use element position when there's no unique visible text:

# Pythonic
agent.click("Add to cart", below="Sauce Labs Backpack")
agent.click("Edit", next_to="John Smith")
agent.extract_text(next_to="Balance")

# English
agent.run('click "Add to cart" below "Sauce Labs Backpack"')
agent.run('extract text next to "Balance"')

Supported directions: next to, below, above, left of, right of, near


Extracting values

# Direct return
price = agent.run('extract text next to "Total"')
assert price == "$29.99"

# Variable capture inside run()
agent.run('{{balance}} = extract text next to "Balance"')
balance = agent.get("balance")

# Pythonic
price = agent.extract_text(next_to="Total")

Using variables in tests

username = "standard_user"
password = "secret_sauce"

def test_login(agent):
    agent.run([
        f'type "{username}" into "Username"',   # f-strings for Python variables
        f'type "{password}" into "Password"',
        'click "Login"',
        'verify text "Products" is present',
    ])

Running tests

# Run all tests
pytest web-tests/

# Run a single test
pytest web-tests/test_english.py::test_login

# Run headless (no browser window)
HEADLESS=True pytest web-tests/

# View the report
open report.html

Supported browsers

Config value Browser
chrome Google Chrome
firefox Mozilla Firefox
safari Safari (macOS only)
edge Microsoft Edge

Chrome, Firefox, and Edge must be installed on your machine. Safari is available on macOS without additional installation.

PyPI

Metadata

Release files for snakeoil-web 0.1.45

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for snakeoil-web 0.1.45
File Actions
snakeoil_web-0.1.45-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for snakeoil_web-0.1.45-cp312-cp312-win_amd64.whl
snakeoil_web-0.1.45-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details for snakeoil_web-0.1.45-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
snakeoil_web-0.1.45-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details for snakeoil_web-0.1.45-cp312-cp312-macosx_11_0_arm64.whl
snakeoil_web-0.1.45-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for snakeoil_web-0.1.45-cp311-cp311-win_amd64.whl
snakeoil_web-0.1.45-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details for snakeoil_web-0.1.45-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
snakeoil_web-0.1.45-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details for snakeoil_web-0.1.45-cp311-cp311-macosx_11_0_arm64.whl
snakeoil_web-0.1.45-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details for snakeoil_web-0.1.45-cp310-cp310-win_amd64.whl
snakeoil_web-0.1.45-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details for snakeoil_web-0.1.45-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
snakeoil_web-0.1.45-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details for snakeoil_web-0.1.45-cp310-cp310-macosx_11_0_arm64.whl
snakeoil_web-0.1.45-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details for snakeoil_web-0.1.45-cp39-cp39-win_amd64.whl
snakeoil_web-0.1.45-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details for snakeoil_web-0.1.45-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
snakeoil_web-0.1.45-cp39-cp39-macosx_11_0_arm64.whl CPython 3.9 CPython 3.9 macOS 11.0+ ARM64 Details for snakeoil_web-0.1.45-cp39-cp39-macosx_11_0_arm64.whl

Total release size: 30.1 MB

Release files / snakeoil_web-0.1.45-cp312-cp312-win_amd64.whl

Download URL snakeoil_web-0.1.45-cp312-cp312-win_amd64.whl
Size 1.7 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
5279c90701756bb9fb1aeb4f539140832105bb174d3f6d94bf99f9e25318d4ff
BLAKE2b-256 checksum
How to use checksums
b2801972abb6243c29cd810e03486d15c489f9bc4a1904ab82f800b87c509639
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 16, 2026.

Transparency log

Release files / snakeoil_web-0.1.45-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL snakeoil_web-0.1.45-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 4.1 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
644304e7a834067d1c6d7f130071f2558be02ebf0186fb738bd38be42234d3b2
BLAKE2b-256 checksum
How to use checksums
a7d12a548534056f7e3dec83a9ee2b2ae64587f295fb89442f4ddec48202f3f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 16, 2026.

Transparency log

Release files / snakeoil_web-0.1.45-cp312-cp312-macosx_11_0_arm64.whl

Download URL snakeoil_web-0.1.45-cp312-cp312-macosx_11_0_arm64.whl
Size 1.8 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
a9b2d2ec4248a58fed5c94a307c253a7ca2b0886e99c2fb22f92ad30f5d007f0
BLAKE2b-256 checksum
How to use checksums
91229bcdceac6ed9819830c65edd8df3dbd60f1461b1c4bae3678802e6599ebd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 16, 2026.

Transparency log

Release files / snakeoil_web-0.1.45-cp311-cp311-win_amd64.whl

Download URL snakeoil_web-0.1.45-cp311-cp311-win_amd64.whl
Size 1.7 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
fe1cfe4b6a3d566d568f5cea19d3b1da6b7a00ef2734dcdf863496cc33cd0b1a
BLAKE2b-256 checksum
How to use checksums
88b0213dbdfff628d5dc4834e4e163397834df2e1de348764833ab3c901c3aca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 16, 2026.

Transparency log

Release files / snakeoil_web-0.1.45-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL snakeoil_web-0.1.45-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 4.1 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
6d9ce8459aa8b5d3ff87aa5bf578400b88528fd238a3870f2f88b663f9451b5e
BLAKE2b-256 checksum
How to use checksums
ab52e95348cca2e04fd23f8df7ac3c17186e3f7af6848139a6d76149cb337b19
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 16, 2026.

Transparency log

Release files / snakeoil_web-0.1.45-cp311-cp311-macosx_11_0_arm64.whl

Download URL snakeoil_web-0.1.45-cp311-cp311-macosx_11_0_arm64.whl
Size 1.8 MB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c9355937a9678cb1592010617f8b16e7ca0c38b9f6caa2529017851d596a871b
BLAKE2b-256 checksum
How to use checksums
951612da9a6e7c5bad1c12bceb1a02ef94643cc40023ae53d1cd6082da302aa3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 16, 2026.

Transparency log

Release files / snakeoil_web-0.1.45-cp310-cp310-win_amd64.whl

Download URL snakeoil_web-0.1.45-cp310-cp310-win_amd64.whl
Size 1.7 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
1b19f166621b749868fceee6a6d27476391e464ea9e9c39df2fb619d4c9a6a4e
BLAKE2b-256 checksum
How to use checksums
668ccec5054ffe86f13a1dd94871d556aed62e15429f3103c5e4652d8856e837
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 16, 2026.

Transparency log

Release files / snakeoil_web-0.1.45-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL snakeoil_web-0.1.45-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 4.0 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
68663df5624007bc4ea20efe98d12545220d99f1956d7e7cf995807f3100aaa2
BLAKE2b-256 checksum
How to use checksums
b9b16e6a04220b2d82b72ff9193d12898007b003dd17c86af9569425602792d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 16, 2026.

Transparency log

Release files / snakeoil_web-0.1.45-cp310-cp310-macosx_11_0_arm64.whl

Download URL snakeoil_web-0.1.45-cp310-cp310-macosx_11_0_arm64.whl
Size 1.8 MB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
0d06103cc0a99a03e0085071fe58192000d3da605b349a71ae4ccee511a94805
BLAKE2b-256 checksum
How to use checksums
a6fdb8f27c9769bdef94e37c818303b3d6d335fffda95f272f39304ba318728e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 16, 2026.

Transparency log

Release files / snakeoil_web-0.1.45-cp39-cp39-win_amd64.whl

Download URL snakeoil_web-0.1.45-cp39-cp39-win_amd64.whl
Size 1.7 MB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
c33d21a02f758ccb326da8e8fa8c419c22fb7b9dc75eed8fa9bb025652bc1839
BLAKE2b-256 checksum
How to use checksums
4707cd8b72efe5760bb028237c766584063571ac1d95bdb715f98548bf6b1dc6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 16, 2026.

Transparency log

Release files / snakeoil_web-0.1.45-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL snakeoil_web-0.1.45-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 3.9 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
8d9ad71ecd500389efc93aa38d4db14936608c336e83b382fb06e9741122564f
BLAKE2b-256 checksum
How to use checksums
35535f602944c0ead54db75d29bfb98159ecaa875341a6fdb3234d776f396d9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 16, 2026.

Transparency log

Release files / snakeoil_web-0.1.45-cp39-cp39-macosx_11_0_arm64.whl

Download URL snakeoil_web-0.1.45-cp39-cp39-macosx_11_0_arm64.whl
Size 1.8 MB
Tags CPython 3.9 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ad5151e07949ca3f25e769b239b98f1c43ec762cbd382337e9050cd013e20e16
BLAKE2b-256 checksum
How to use checksums
2f2de24d0a0aa3d285942f2b8445f30a12902ac925bbf63d059bed373c12240a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 16, 2026.

Transparency log

Security for snakeoil-web 0.1.45

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 12 files in this release have been uploaded with provenance metadata.

Select from 12 files

Attestation for snakeoil_web-0.1.45-cp312-cp312-win_amd64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 16, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.45 This release

12 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page