WebTestPilot is an LLM-driven automated web testing framework for end-to-end browser testing.
Project description
WebTestpilot
WebTestPilot is an LLM-driven automated web testing framework for end-to-end browser testing.
This directory contains the core source code of WebTestPilot for development and maintenance.
pytest-webtestpilot: A pytest plugin that integrates WebTestPilot with pytest。
Installation
If you want to use WebTestPilot in your own projects, install it from PyPI:
pip install webtestpilot
WebTestPilot also provides an official pytest plugin for running test cases via pytest.
pip install pytest-webtestpilot
Below is a minimal working example demonstrating how to use WebTestPilot directly on top of Playwright.
from pathlib import Path
from playwright.sync_api import sync_playwright
from webtestpilot import WebTestPilot, Config, Session, Step
# WebTestPilot is built on top of Playwright
with sync_playwright() as p:
# Users can:
# 1. Connect to an existing managed or remote browser
# 2. Enable tracing, video, or screenshots at the browser context level
# 3. Reuse an authenticated browser session
# ...
browser = p.chromium.launch()
context = browser.new_context()
page = context.new_page()
page.goto("https://example.com")
# Load WebTestPilot configuration
config = Config.load(Path("./src/config.yaml"))
# Create a test session bound to the Playwright page
session = Session(page=page, config=config)
# Define test steps in natural language
steps = [
Step(
action="Click the login button",
expectation="The dashboard page is displayed",
),
Step(
action="Click the profile icon",
expectation="The user profile menu appears",
),
]
# Run the test steps
WebTestPilot.run(
session=session,
steps=steps,
assertion=False, # enable to verify expectations
)
Development
This section is only required if you are developing or modifying WebTestPilot itself.
Prerequisites
Before starting, make sure you have:
-
uvpackage managerWe use
uvto manage Python dependencies and run commands in a clean, reproducible environment.Installation guide: https://docs.astral.sh/uv/getting-started/installation/
Setup
-
Clone the repository.
-
Set Up the Python Environment.
cd ./webtestpilot # Installs all dependencies uv sync # Prepares code used for model interaction and reasoning. uv run baml-cli generate --from ./webtestpilot/baml_src
-
Configure Environment Variables.
We use a
.envfile to store configuration values and secrets (such as API keys).Create your own copy:
cp .env.example .env
Then open
.envand edit the following fields:# URL of the GUI grounding model (OpenAI-compatible API) GUI_GROUNDING_MODEL_BASE_URL="http://localhost:8000/v1" # Name of the GUI grounding model (HuggingFace format) GUI_GROUNDING_MODEL_NAME="inclusionAI/UI-Venus-Ground-7B" # URL for OpenAI-compatible LLM API OPENAI_BASE_URL="https://api.key77qiqi.com/v1" # Your API key (ask from the course staff) OPENAI_API_KEY=""
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file webtestpilot-0.1.3.tar.gz.
File metadata
- Download URL: webtestpilot-0.1.3.tar.gz
- Upload date:
- Size: 37.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9dc8face9f9397c6cba85968671d2ad97c49eb97bf8bcda8809f8d85b326bba7
|
|
| MD5 |
40957ef2d75737c26cbdd74667e9cf56
|
|
| BLAKE2b-256 |
c9506d168b6f5cda8c6bbd83eb5cd3f48e85af2c80d061e0e58de6b758a16c8c
|
File details
Details for the file webtestpilot-0.1.3-py3-none-any.whl.
File metadata
- Download URL: webtestpilot-0.1.3-py3-none-any.whl
- Upload date:
- Size: 48.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75a097b9836fa553f839f0c1abffef06ee4efb7cb5bd9916ac7e200bd9309221
|
|
| MD5 |
129694894c7c96a48d535f89df806639
|
|
| BLAKE2b-256 |
3db621f75a2353dcb4219da5fb6f827ad70adbe56fcc55d36c05020fc30014be
|