Skip to main content

Plain English web test automation using Selenium and Playwright. No code. No maintenance.

Project description

snakeoil-web

PyPI version Python 3.8+ License: MIT

Selector-free, self-healing web test automation.

No XPaths. No CSS selectors. No waiting. Tests that describe what users see, not how developers built it.


Install

pip install snakeoil-web

Your first test

from snakeoil_web import WebAgent

agent = WebAgent()
agent.click("Sign in")
agent.type("harish@example.com", into="Email")
agent.type("password123", into="Password")
agent.click("Sign in")
agent.verify_text("Dashboard")

That's it. No selectors. No waits. No maintenance.


Why snake-oil?

Most test automation breaks when a developer renames a CSS class or moves an element. snakeoil-web finds elements by what users actually see — visible text, labels, and position on screen — not by how the DOM is built.

# Selenium — breaks when developer renames the class
driver.find_element(By.XPATH, '//button[@data-testid="login-btn"]').click()

# snakeoil-web — works regardless of how the DOM changes
agent.click("Sign in")

When the DOM changes, your tests don't.


Two ways to write tests

Pythonic — IDE guided, autocomplete friendly:

agent = WebAgent()
agent.click("Sign in")
agent.type("harish@example.com", into="Email")
agent.verify_text("Dashboard")

English — human readable, shareable with non-developers:

agent = WebAgent()
agent.run([
    'click "Sign in"',
    'type "harish@example.com" into "Email"',
    'verify text "Dashboard" is present',
])

Using variables

Pythonic — pass variables directly:

email    = "harish@example.com"
password = "secret123"

agent.type(email, into="Email")
agent.type(password, into="Password")
agent.click("Sign in")

English — embed variables with f-strings:

email    = "harish@example.com"
password = "secret123"

agent.run([
    f'type "{email}" into "Email"',
    f'type "{password}" into "Password"',
    'click "Sign in"',
])

Mix Pythonic and English freely

Use whichever style fits each step — they work together in the same test:

from snakeoil_web import WebAgent

# Get test data from your API
user = api.create_test_user()

agent = WebAgent()

# English for readable setup steps
agent.run([
    'click "Sign in"',
    f'type "{user.email}" into "Email"',
    f'type "{user.password}" into "Password"',
    'click "Sign in"',
])

# Pythonic for assertions — IDE helps you get it right
agent.verify_text("Dashboard")
balance = agent.extract_text(next_to="Balance")

# Back to Python for logic
assert balance == user.expected_balance

# English for teardown
agent.run([
    'click "Settings"',
    'click "Sign out"',
])

Spatial targeting

No visible text on that icon button? Use its position instead.

agent.click("button", below="Total Price")
agent.click("icon", next_to="Search")
agent.click("button", index=2)
agent.extract_text(next_to="Balance")
agent.verify_text("$0.00", next_to="Balance")

Mix with Python

Use Python for data setup, snakeoil for the UI steps.

from snakeoil_web import WebAgent

user = api.create_test_user()

agent = WebAgent()
agent.type(user.email, into="Email")
agent.type(user.password, into="Password")
agent.click("Sign in")
agent.verify_text("Dashboard")

balance = agent.extract_text(next_to="Balance")
assert balance == user.expected_balance

Configuration

Create a snakeoil.web.config.py in your project root:

URL      = "https://yourapp.com"
BROWSER  = "chromium"   # chromium | firefox | webkit | msedge
HEADLESS = False
TIMEOUT  = 30_000       # milliseconds
MAXIMIZED = True

Supported browsers

Browser Support
Chrome / Chromium
Firefox
Safari / WebKit
Edge

Related packages


Status

Early development. Feedback and contributions welcome.

GitHub · PyPI

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

snakeoil_web-0.1.6-cp312-cp312-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.12Windows x86-64

snakeoil_web-0.1.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

snakeoil_web-0.1.6-cp312-cp312-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

snakeoil_web-0.1.6-cp311-cp311-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.11Windows x86-64

snakeoil_web-0.1.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

snakeoil_web-0.1.6-cp311-cp311-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

snakeoil_web-0.1.6-cp310-cp310-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.10Windows x86-64

snakeoil_web-0.1.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

snakeoil_web-0.1.6-cp310-cp310-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

snakeoil_web-0.1.6-cp39-cp39-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.9Windows x86-64

snakeoil_web-0.1.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.7 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

snakeoil_web-0.1.6-cp39-cp39-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

Details for the file snakeoil_web-0.1.6-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for snakeoil_web-0.1.6-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 b53236a8f17e38f94dfa97a4600a631ce2edc031b9c1bcd5da9b857f96370335
MD5 a46297e2198a8f47f04e1c34067b8841
BLAKE2b-256 054e8862ca7cc3ef84eb5fd87caeee7ee1ed714b74ea563144013de7772dd570

See more details on using hashes here.

Provenance

The following attestation bundles were made for snakeoil_web-0.1.6-cp312-cp312-win_amd64.whl:

Publisher: publish.yml on snakeoiltool/snakeoil-web

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file snakeoil_web-0.1.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for snakeoil_web-0.1.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 63dfd7f32645542e6fb07e1fd77ae444cf3ec8c352464b5224db4dbd77677fcb
MD5 dd43a7837e3c24bde6536c9db8cd9aa6
BLAKE2b-256 c7612efab18243e04e20b72cf71eac024ce28997dc53140a1c2a641754be8b10

See more details on using hashes here.

Provenance

The following attestation bundles were made for snakeoil_web-0.1.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on snakeoiltool/snakeoil-web

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file snakeoil_web-0.1.6-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for snakeoil_web-0.1.6-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a2f865aa5df9b92cf98322b4317be9060b303917e5bc124845d96e6b1a83705a
MD5 78c2076895935379dc5d1a16a0d04703
BLAKE2b-256 d99aed76c4e1dd08914a4bd9a18116a723473eda4b97088f325e75ae9505f5a3

See more details on using hashes here.

Provenance

The following attestation bundles were made for snakeoil_web-0.1.6-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: publish.yml on snakeoiltool/snakeoil-web

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file snakeoil_web-0.1.6-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for snakeoil_web-0.1.6-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 fc28d384e3dafff170e00d879d8ff0eefc9c191e6d62a1dff3fd51a6fe3652ab
MD5 5afb537e862b66a1578fd795ec3eeb14
BLAKE2b-256 72c765301b69abb41848721568bb354159b2f0ed8dd4e1f1d5b9a6c5cc6a7cfe

See more details on using hashes here.

Provenance

The following attestation bundles were made for snakeoil_web-0.1.6-cp311-cp311-win_amd64.whl:

Publisher: publish.yml on snakeoiltool/snakeoil-web

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file snakeoil_web-0.1.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for snakeoil_web-0.1.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4e75f0298998df64b7589fc69b844fe3bcc18b7160aca6b2a33abde27e53ef8a
MD5 5055a8a12eda1f2fddedbdf202cbcd5e
BLAKE2b-256 df9f2cf07311cae65dffb6e4e20baa391878f7c5fb8fdd005d81b0239b38a1f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for snakeoil_web-0.1.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on snakeoiltool/snakeoil-web

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file snakeoil_web-0.1.6-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for snakeoil_web-0.1.6-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 48a0770582e7293bffa769b3e8489e019a3fbcdaabdaa2e81d408da48e942295
MD5 366987771fce95da73b2177fc508a245
BLAKE2b-256 a26fef7e0ca9c59d306fe0653bc2098fc133880deed63333b2f49bf67f77f960

See more details on using hashes here.

Provenance

The following attestation bundles were made for snakeoil_web-0.1.6-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: publish.yml on snakeoiltool/snakeoil-web

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file snakeoil_web-0.1.6-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for snakeoil_web-0.1.6-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 45b80f8cb56ef363313ce4438e3c46d450d51fa1c725f69fd39dbd776031c5ba
MD5 a5094d0656423415f0e08d98820707d0
BLAKE2b-256 1ce09b63edbb167ae480c952cc3f95ea5c1dc2ab99abd6afee0ee68312c91cdd

See more details on using hashes here.

Provenance

The following attestation bundles were made for snakeoil_web-0.1.6-cp310-cp310-win_amd64.whl:

Publisher: publish.yml on snakeoiltool/snakeoil-web

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file snakeoil_web-0.1.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for snakeoil_web-0.1.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1ad74c3d43d3c2915a618f7d12baf4f3d1ccc715e804c843770396fbaeb9ba15
MD5 b4ae535f945499f9fca86797479831e0
BLAKE2b-256 c61c214680748d250c420004024ce715f211e919bf4321c7e6b70c8c13b46399

See more details on using hashes here.

Provenance

The following attestation bundles were made for snakeoil_web-0.1.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on snakeoiltool/snakeoil-web

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file snakeoil_web-0.1.6-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for snakeoil_web-0.1.6-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e018872918dcf60c9c3c1cc83655f60744aca895753534d45df6ba1bd941ec2b
MD5 27cc631ca112e10bb91d23e746c3d251
BLAKE2b-256 9b548d18572db639794d6f04fd62bfde978600e8aed7abee95e6a7972e8ad358

See more details on using hashes here.

Provenance

The following attestation bundles were made for snakeoil_web-0.1.6-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: publish.yml on snakeoiltool/snakeoil-web

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file snakeoil_web-0.1.6-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: snakeoil_web-0.1.6-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for snakeoil_web-0.1.6-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 9502f5dcf4233e04ba71e634772445c9d50ca48e84460b6356932fc026137af3
MD5 e9e6e2914fd34ca54ae8929373150fc1
BLAKE2b-256 1dfe556b9ba4e82c53637ffee13a841bfb9cab5f86091358f7cfd9ad20b43355

See more details on using hashes here.

Provenance

The following attestation bundles were made for snakeoil_web-0.1.6-cp39-cp39-win_amd64.whl:

Publisher: publish.yml on snakeoiltool/snakeoil-web

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file snakeoil_web-0.1.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for snakeoil_web-0.1.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c1108f96fb3c789c5ef3528b970605ba39e5aface8e624e0f75553a52f48ba9a
MD5 82bf96bf724f3c02f3838b939ac34acf
BLAKE2b-256 8a857862ce90ddcc6500e806fabc285be26ed62460ebb8406af40d2429c4bd58

See more details on using hashes here.

Provenance

The following attestation bundles were made for snakeoil_web-0.1.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on snakeoiltool/snakeoil-web

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file snakeoil_web-0.1.6-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for snakeoil_web-0.1.6-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1a9861e0b865f9379bb2ed6c6266e8a250737431f6e159d2f590500d6069535a
MD5 997188ce334d472b40d59e61c055d6f7
BLAKE2b-256 842ca9a2b0e29984798c2ac6549d8963180ab7b5991375e0b762946c057536e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for snakeoil_web-0.1.6-cp39-cp39-macosx_11_0_arm64.whl:

Publisher: publish.yml on snakeoiltool/snakeoil-web

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page