Skip to main content

swiftbrowse

The AI browser for browser automation and end-to-end testing. A native engine (Rust, driving Chromium over the DevTools Protocol) with one contract across a test runner, this Python SDK, a TypeScript SDK, and an MCP server for AI agents. Standard library only.

📖 Documentation: https://steady-ember-82q7.here.now/

pip install swiftbrowse
npx playwright install chromium chromium-headless-shell   # a Chromium for SwiftBrowse to drive
swiftbrowse doctor                                       # check what this machine can run

Tests in code

import pytest
from swiftbrowse import launch

@pytest.fixture(scope="session")
def browser():
    with launch() as b:
        yield b

@pytest.fixture
def page(browser):
    with browser.new_session() as s:   # isolated: own cookies, storage, tabs
        yield s

def test_signs_in(page):
    page.navigate("http://localhost:3000/login")
    page.fill("Email", "ada@example.com")
    page.click({"by": "role", "role": "button", "name": "Sign in"},
               expect={"type": "url_contains", "value": "/dashboard"})
    page.expect({"type": "text_visible", "text": "Welcome, Ada"})
  • Every engine operation is a method with its documented signature (navigate, click, fill, check, hover, select_option, upload_file, route, switch_tab, switch_frame, save_storage_state, …), with required arguments positional and the rest by keyword.
  • A target is a string (accessible name, label, test id or text) or a locator (role, label, test_id, text, css, xpath). Several matches are an error, never a guess.
  • Actions wait until the element is visible, enabled, not covered and not moving. expect assertions retry until they pass.
  • A failed action or assertion raises SwiftBrowseError with the full result attached.
  • Sessions attach to a warm background browser, so creating one per test is cheap.

Tests as JSON, with the built-in runner

{
  "name": "sign in",
  "tests": [
    { "name": "signs in", "steps": [
      { "op": "navigate", "url": "login" },
      { "op": "fill", "target": "Email", "value": "ada@example.com" },
      { "op": "click", "target": "Sign in", "expect": { "type": "url_contains", "value": "/dashboard" } }
    ] }
  ]
}
swiftbrowse test --base-url http://localhost:3000/ -j 4 --retries 2 --html report.html --trace retain-on-failure

The runner supports parallel workers, retries and flaky detection, sharding, saved logins, network mocking, tabs, frames, uploads, traces with a live DOM, video, and JUnit/HTML reports. On the project's benchmark suite it runs 2–3× faster than Playwright Test.

For AI agents

{ "mcpServers": { "swiftbrowse": { "command": "swiftbrowse", "args": ["mcp"] } } }

Learn more

Platform wheels include the native binary (Linux x86_64/aarch64, macOS arm64/x86_64, Windows x64). Elsewhere, the pure-Python wheel uses a swiftbrowse on your PATH, or SWIFTBROWSE_BIN. Apache-2.0.

Metadata

Release files for swiftbrowse 0.1.2

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 swiftbrowse 0.1.2
File
swiftbrowse-0.1.2-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
swiftbrowse-0.1.2-py3-none-manylinux_2_35_x86_64.whl Python 3 none Linux glibc 2.35+ x86-64 Details
swiftbrowse-0.1.2-py3-none-manylinux_2_35_aarch64.whl Python 3 none Linux glibc 2.35+ ARM64 Details
swiftbrowse-0.1.2-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details
swiftbrowse-0.1.2-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details
swiftbrowse-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 16.7 MB

Release files / swiftbrowse-0.1.2-py3-none-win_amd64.whl

Download URL swiftbrowse-0.1.2-py3-none-win_amd64.whl
Size 3.5 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
2947a74c79da75462e21199bc9944959676b599a737d1ea05a59625545a1dd3b
BLAKE2b-256 checksum
How to use checksums
37410dbe12c581b6fa53025c879f5bf777c28b7dd009283957a1d244b19edd73
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.15

Release files / swiftbrowse-0.1.2-py3-none-manylinux_2_35_x86_64.whl

Download URL swiftbrowse-0.1.2-py3-none-manylinux_2_35_x86_64.whl
Size 3.5 MB
Tags Linux glibc 2.35+ x86-64 Python 3
SHA-256 checksum
How to use checksums
07568643eb58dff06cad8ad4098d99e7318c8be5714bc9cbf9ec6f505d3ffc00
BLAKE2b-256 checksum
How to use checksums
b70fe30e8371326615071b8360d8521b64e104e4ed6f7beaaa41e03612bba427
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.15

Release files / swiftbrowse-0.1.2-py3-none-manylinux_2_35_aarch64.whl

Download URL swiftbrowse-0.1.2-py3-none-manylinux_2_35_aarch64.whl
Size 3.2 MB
Tags Linux glibc 2.35+ ARM64 Python 3
SHA-256 checksum
How to use checksums
21a9675c8a0caa48a3ae8e61e18b9f3cd87e393fc4c61311f328eb13f2b8bacb
BLAKE2b-256 checksum
How to use checksums
8a1ced387f951a6952e80ca3875fe788158f6ee5d4ebbe15142679434ec1a2a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.15

Release files / swiftbrowse-0.1.2-py3-none-macosx_11_0_arm64.whl

Download URL swiftbrowse-0.1.2-py3-none-macosx_11_0_arm64.whl
Size 3.1 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
05f019333742eb0d2af24f125c6f7f7c2e0297f143b87c89db8c5f511e057498
BLAKE2b-256 checksum
How to use checksums
83c4d9f9f61e66d18e480a9094c7fd5cb8f5fd0e0f4dd49a7a37d264b5b078eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.15

Release files / swiftbrowse-0.1.2-py3-none-macosx_10_12_x86_64.whl

Download URL swiftbrowse-0.1.2-py3-none-macosx_10_12_x86_64.whl
Size 3.4 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
b78e4a4e50764e20013319afde0bb71ffb8a76a728567de3bceaf782a34f8a65
BLAKE2b-256 checksum
How to use checksums
c35f1e6b9c6bf5681ca97739ed4ffe2d14faf134245f353a6f4eb10939827c1d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.15

Release files / swiftbrowse-0.1.2-py3-none-any.whl

Download URL swiftbrowse-0.1.2-py3-none-any.whl
Size 13.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c2df4344b20bfa41a4fb438e67c70e09a1472d3361644e2f3c85ff5cbefa6cf9
BLAKE2b-256 checksum
How to use checksums
c2837bd1dbbc2eeb24802d10c9dd4f05c6845db7a70dcce8c0af1332a3d9f4d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.15

Security for swiftbrowse 0.1.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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