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 write 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.2.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.2-py3-none-any.whl (21.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: betatester-0.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 b19466367cde893b406146294c0bb23aab3f67d6dc96d5ffecf903423bda980e
MD5 a73e74769596b6f0fcf251264e75951a
BLAKE2b-256 e54180d3ff6ede3973f26d683124a347f4d5c1670f2d41347fbbcb6fdbb1f5d1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: betatester-0.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1bb1896fa4a922e7c718fe9dbe71253369886e08091317a22e2dc4d4ba22541e
MD5 570e7241bae8bcbafbe9631f225feefe
BLAKE2b-256 fbd4f623484f99c27808ed4bc41202dc8349e901ae1b488e8a9a9f64c8c8fb94

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