Skip to main content

Autotester - E2E testing for your codebase

Project description

Autotester

GitHub license Discord Documentation GitHub

Autotester is an open-source testing automation tool to make E2E automated.

  • 🤖 Run end-to-end tests using natural language descriptions
  • 🐛 Detect potential bugs and provide detailed fix explanations
  • Reduce testing overhead while improving code quality

Currently supporting Python and TypeScript, with more languages coming soon.

Quickstart

Install the package

pip install autotester

Add a config file to your project called autotester.yml. This tells Autotester what to test and how.

e2e:
  login-test: # Name of the test. You can add more
    url: "localhost:3000" # Starting URL of your app. It can be a local server or a remote server
    steps:
      - Login with Github
      - Go to the team page
      - Change the team name to "e2e"
      - Click on the "Save" button
      - Check that the team name is "e2e" # use words like "Check that" to assert the results of the test

If your environment is protected by HTTP Basic Auth, add an auth block:

e2e:
  auth:
    type: basic
    username: "dev"
    password: "dev123"
  login-test:
    url: "https://staging.example.com"
    steps:
      - Check the homepage loads

You can also provide auth credentials via environment variables (these take precedence over YAML):

export AUTOTESTER_AUTH_USERNAME="dev"
export AUTOTESTER_AUTH_PASSWORD="dev123"

That's it. To run it, you need to have an OpenAI API key and Chrome/Chromium installed.

If you don't already have Chrome installed, you can use the browser-use CLI to install Chromium:

browser-use install

Then export your OpenAI key and run:

export OPENAI_API_KEY="your-openai-api-key"
autotester

You will get a summary report like the following:

🖥️ 1/1 E2E tests

login-test: Success!

GitHub Action

Autotester can be used in a GitHub Action to run E2E tests after you release a new version.

Check out the action's README for more information, but here's a quick example:

name: Run Autotester

on:
  pull_request:
    types: [opened, synchronize, reopened]

jobs:
  after-deployment:
    runs-on: ubuntu-latest
    steps:
      - uses: cyberwave-os/autotester-action@v0.1.0
        with:
          action-type: "e2e"
        env:
          OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
          STARTING_URL: "http://yourstaging.yourwebsite.com"
          # Optional: for Basic Auth protected environments
          # AUTOTESTER_AUTH_USERNAME: ${{ secrets.AUTOTESTER_AUTH_USERNAME }}
          # AUTOTESTER_AUTH_PASSWORD: ${{ secrets.AUTOTESTER_AUTH_PASSWORD }}

CLI Reference

Commands

  • autotester: Without any command, runs E2E tests if defined in autotester.yml
  • autotester e2e: Runs end-to-end tests defined in autotester.yml

Command Options

Global Options

  • -v, --verbose: Enable verbose logging output
  • --version: Display Autotester version number

E2E Test Command

autotester e2e [--config <config_file>] [--verbose]
  • --config: (Optional) Path to the YAML configuration file (defaults to autotester.yml)
  • -v, --verbose: (Optional) Enable verbose logging output

Environment Variables

  • OPENAI_API_KEY: (Required) Your OpenAI API key
  • CHROME_INSTANCE_PATH: Path to your Chrome instance. Defaults to /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
  • AUTOTESTER_AUTH_USERNAME: Username for HTTP Basic Auth (overrides auth.username in YAML)
  • AUTOTESTER_AUTH_PASSWORD: Password for HTTP Basic Auth (overrides auth.password in YAML)

Run Tests with Docker

For contributors who want a reproducible test environment, you can run the test suite in Docker.

From the repository root:

make test-docker

This command mounts your local project into the container and runs pytest. If you want to build manually first:

make test-docker-build
docker compose -f tests/docker-compose.yml run --rm test

Roadmap

  • Add support for simple auth, since test environment often have auth.
  • Add support for screen recording with Posthog, so that QA engineers can easily review failed tests.

Credits

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

autotester-0.0.7.tar.gz (36.5 kB view details)

Uploaded Source

Built Distribution

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

autotester-0.0.7-py3-none-any.whl (43.5 kB view details)

Uploaded Python 3

File details

Details for the file autotester-0.0.7.tar.gz.

File metadata

  • Download URL: autotester-0.0.7.tar.gz
  • Upload date:
  • Size: 36.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for autotester-0.0.7.tar.gz
Algorithm Hash digest
SHA256 5f490df8077b98c468bfe2a851b2b4a297635ca35e09e6a8d69dd7fa072d7ea3
MD5 ed0560993a043592ffc44bec94824ffa
BLAKE2b-256 5a3d8082595590afc62439ccdb79c4fc1e3572370c211b5a604c003cf63a6ecf

See more details on using hashes here.

Provenance

The following attestation bundles were made for autotester-0.0.7.tar.gz:

Publisher: release.yml on cyberwave-os/autotester

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file autotester-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: autotester-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 43.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for autotester-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 93ee730b623265620a92e617eaa6c6c5ac848237cf2119de69c371f1fa4aaab6
MD5 d75218b061b5bd7f1690f2013861973f
BLAKE2b-256 f8cf4761579b78e07d9e531b7a7caa0ee63a7bd629f3b67aa05f11382eafcf0d

See more details on using hashes here.

Provenance

The following attestation bundles were made for autotester-0.0.7-py3-none-any.whl:

Publisher: release.yml on cyberwave-os/autotester

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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