Skip to main content

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

  1. Install the package
pip install betatester
  1. 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`
  1. 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

scrape_executor = ScrapeAiExecutor(
    url="https://google.com",
    high_level_goal="Find images of cats",
    openai_api_key="...",
)
scrape_spec = 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

scrape_spec_executor = ScrapeSpecExecutor(
    scrape_spec=scrape_spec,
)
await scrape_spec_executor.run()

CLI

Installation

  1. Install the package
pip install betatester[cli]
  1. 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`
  1. 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.

betatester start_ai --url "https://google.com" --high-level-goal "Find images of cats"  > "/path/to/scrape_spec.json"

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.

betatester start_spec --scrape-spec-path "/path/to/scrape_spec.json"

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 local is 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 local the format is a json obejct with the following keys:
      • save_path: The path to the directory where you want to store your files

You can add other file proviers by:

  1. Adding a new class that inherits from FileClient. See local.py for an example.
  2. Updating __init__.py to return your new class when the FILE_CLIENT_TYPE environment variable is set to the name of your new class.
  3. Updating the FileCLientType enum to include your new client type

Project details


Download files

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

Source Distribution

betatester-0.0.1.tar.gz (18.0 kB view details)

Uploaded Source

Built Distribution

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

betatester-0.0.1-py3-none-any.whl (21.6 kB view details)

Uploaded Python 3

File details

Details for the file betatester-0.0.1.tar.gz.

File metadata

  • Download URL: betatester-0.0.1.tar.gz
  • Upload date:
  • Size: 18.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.7

File hashes

Hashes for betatester-0.0.1.tar.gz
Algorithm Hash digest
SHA256 46861dd6481cbe9fdbf37f96898e8f7dfbc338bb04331427d7dcce485a0d9163
MD5 383bbf9d5d4dd9a020557df81fc5ea5e
BLAKE2b-256 1f91a32c80260daf2a3f799ac4d6eae49e3da230520788661283c143c06faceb

See more details on using hashes here.

File details

Details for the file betatester-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: betatester-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 21.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.7

File hashes

Hashes for betatester-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f7166c73422fa394ef17c8f1d37dbdf97129b6312f292e0afe7e9d02b0da8356
MD5 862f4ffd2f78910377a530a650f9b0ed
BLAKE2b-256 ecf57738424668baaffc66ae36b428f7f4302176ebab9dbc77eee5c3c64379a1

See more details on using hashes here.

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