A package for automatically testing the UX / UI of a website.
Project description
BetaTester
BetaTester is a simple tool to help you automatically test the UI / UX of your web application on different browsers and devices without having to right brittle front-end tests. It uses LLMs to plan and select actions and Playwright to execute those actions.
As you develop and change your web application, you can specify BetaTester to continuously test high level flows like "Sign up", "Login", "Add to cart", etc. Failures can indicate either a bug in the UI or potentially non-intuitive UX, which you can investigate further using the application or the Playwright trace it automatically generates.
If you don't want to keep using LLMs for every test, BetaTester generates a scrape spec from an LLM run that can be run deterministically.
Contents
Python Package
Installation
- Install the package
pip install betatester
- If you have not run Playwright before, you will need to install the browser dependencies. This only needs to be done once per system
playwright install --with-deps chromium`
- Make sure to retrieve an your OpenAI API key if you have not already done so.
Usage
Run the test using LLMs. See the docstring here for more information on the avaiable parameters.
from betatester import ScrapeAiExecutor
from betatester.file.local import LocalFileClient
file_client = LocalFileClient("./app-data/")
scrape_executor = ScrapeAiExecutor(
url="https://google.com",
high_level_goal="Find images of cats",
openai_api_key="...",
file_client=file_client,
)
await scrape_executor.run()
Run the test using a scrape spec (with no LLM calls) generated from a previous LLM run. See the docstring here for more information on the avaiable parameters.
from betatester import ScrapeSpecExecutor
from betatester.file.local import LocalFileClient
file_client = LocalFileClient("./app-data/")
scrape_spec = await file_client.load_scrape_spec("/path/to/scrape_spec.json")
scrape_spec_executor = ScrapeSpecExecutor(
scrape_spec=scrape_spec,
)
await scrape_spec_executor.run()
CLI
Installation
- Install the package
pip install betatester[cli]
- If you have not run Playwright before, you will need to install the browser dependencies. This only needs to be done once per system
playwright install --with-deps chromium`
- Make sure to retrieve an your OpenAI API key if you have not already done so and set it as an environment variable
OPENAI_API_KEY.
Usage
Run the test using LLMs. Use betatester start_ai --help for more information on the avaiable parameters.
FILE_CLIENT_CONFIG='{"save_path": "./app-data/"}' betatester start_ai --url "https://google.com" --high-level-goal "Find images of cats" --file-client-type "local"
Run the test using a scrape spec (with no LLM calls) generated from a previous LLM run. Use betatester start_spec --help for more information on the avaiable parameters.
FILE_CLIENT_CONFIG='{"save_path": "./app-data/"}' betatester start_spec --scrape-spec-path "/path/to/scrape_spec.json" --file-client-type "local"
Extensions
File
AutoTransform provides a file extension that allows you to store your files in the storage provider of your choice. To use the file extension, you will need to provide the following environment variables:
- FILE_CLIENT_TYPE: The file client you are using, currently only
localis supported - FILE_CLIENT_CONFIG: A string that contains the configuration for your file client. The format of this object is specific to the provider you are using.
- For
localthe format is a json obejct with the following keys:- save_path: The path to the directory where you want to store your files
- For
You can add other file proviers by:
- Adding a new class that inherits from FileClient. See local.py for an example.
- Updating __init__.py to return your new class when the
FILE_CLIENT_TYPEenvironment variable is set to the name of your new class. - Updating the FileCLientType enum to include your new client type
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 betatester-0.0.0.tar.gz.
File metadata
- Download URL: betatester-0.0.0.tar.gz
- Upload date:
- Size: 18.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c20f1b9591be7a2337547046249e698d2dcdcaf5a0e454d1af67c852a163ffdd
|
|
| MD5 |
84fccf784b858cdbe87b9c4da1a3039a
|
|
| BLAKE2b-256 |
2368441df4a637c9f3ea162b44647c64a1a106d217dcd4245418478bbd3799d7
|
File details
Details for the file betatester-0.0.0-py3-none-any.whl.
File metadata
- Download URL: betatester-0.0.0-py3-none-any.whl
- Upload date:
- Size: 21.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61df1cb49bb249633a2bf584b0202a93f46fd0e383ce41e185ce9dccb6150626
|
|
| MD5 |
4a61562e19728f88b9613f9c04ee2dd9
|
|
| BLAKE2b-256 |
6bf91cf4c10731191d0f9f3c3849a656c6be315639d7cc3ee871d9e7070a9893
|