Skip to main content

Test runner for LaVague

LaVague Test Runner is a tool designed to run tests on real websites and generate comprehensive reports. It can be easily launched using the lavague-test command.

Usage

To run the LaVague Test Runner, use the lavague-test command. Below are the available options and their descriptions:

Command Options

  • --directory / -d

    • Default: current working directory + "/lavague-tests/sites"
    • Type: str
    • Description: Specifies the directory where the site test files are located.
  • --site / -s

    • Default: test on all sites described in -d directory
    • Type: str
    • Description: Specifies the site names to run tests on. This option can be used multiple times to specify multiple sites.
  • --display

    • Type: flag
    • Description: If set, the browser will be displayed during the tests.

Site Test Folder Structure

Each site to be tested must be a folder containing a config.yml file with the test configuration. Below is an example structure:

lavague-tests/sites/
└── example-site/
    └── config.yml

The config.yml file define tasks with the following structure:

type: web
max_steps: 5                      # max number of action engine retry
n_attempts: 1                     # max number of agent retry
user_data:                        # optional user data to feed the Agent
  key: value
tasks:
  - name: Name                    # Optional display name
    max_steps: 5                  # to override global value
    n_attempts: 1                 # to override global value
    url: https://example.com      # the intial task URL
    prompt: Prompt for the agent  # the agent prompt
    expect:                       # the list of tests to perform on task completion, see below for details
      - <property> <operator> <value>
    user_data:                    # optional task-scoped user data to feed the Agent
      key: value

Available operators:

Operator Python operation
is operator.eq
is not operator.ne
is lower than operator.lt
is greater than operator.gt
contains operator.contains
does not contain not operator.contains

Available properties:

Property Type
URL string
Status success / failure
Output string
Steps number
HTML string
Tabs string

Example of config.yml

tasks:
  - name: HuggingFace navigation
    url: https://huggingface.co/docs
    prompt: Go on the quicktour of PEFT
    expect:
      - URL is https://huggingface.co/docs/peft/quicktour
      - Status is success
      - HTML contains PEFT offers parameter-efficient methods for finetuning large pretrained models
  - name: HuggingFace search
    url: https://huggingface.co
    prompt: Find the-wave-250 dataset
    expect:
      - URL is https://huggingface.co/datasets/BigAction/the-wave-250
      - Status is success

Output

lavague-test will output a report with successes and failures. If all tests passed exit code will be 0, and -1 if at least one test failed.

Example:

[o] HuggingFace navigation
        URL is https://huggingface.co/docs/peft/quicktour
        Status is success
        HTML contains PEFT offers parameter-efficient methods for finetuning large pretrained models

[o] HuggingFace search
        URL is https://huggingface.co/datasets/BigAction/the-wave-250
        Status is success

[x] Go to LaVague.ai from https://google.com
    (x) URL is https://lavague.ai - was: https://www.google.com/
    (x) Status is success - was: failure

[o] Navigate using link
        URL is http://localhost:8000/menu.html
        Status is success
        HTML contains <h1>Menu</h1>

Result: 80 % (8 / 10)

Use with static local website

In config.yml set type to static to serve a static website locally.

The following options are available:

  • directory : the directory to serve files from. Defaults to www ;
  • port : the port to serve the files on. Defaults to 8000.

Use with dynamic local website

Initialization command for local websites will be available soon.

Metadata

Release files for lavague-tests 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lavague-tests 0.0.4
File Size Uploaded Provenance Actions
lavague_tests-0.0.4.tar.gz 8.5 kB Without provenance Details for lavague_tests-0.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lavague-tests 0.0.4
File Interpreter ABI Platform Actions
lavague_tests-0.0.4-py3-none-any.whl Python 3 none any Details for lavague_tests-0.0.4-py3-none-any.whl

Total release size: 17.7 kB

Release files / lavague_tests-0.0.4.tar.gz

Download URL lavague_tests-0.0.4.tar.gz
Size 8.5 kB
Tags Source
SHA-256 checksum
How to use checksums
866ea4d03fdc9bad9a4fb315bd8313f5bf364eec2e3fcb9789fc6bf7c1a3785d
BLAKE2b-256 checksum
How to use checksums
5058f3bce9c094ef9c8090c99f16f2534d0f18fa4e3b4061eb1d1db7d59951f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.11.4 Linux/6.2.0-39-generic

Release files / lavague_tests-0.0.4-py3-none-any.whl

Download URL lavague_tests-0.0.4-py3-none-any.whl
Size 9.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d1e6feb4acf32497df99cf2decedb03f4b751df31eace209afe7e5dd992f28b3
BLAKE2b-256 checksum
How to use checksums
2c387ffee491b89eda590093390835014c02472af5da9e1f6c8713b97fb8cce4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.11.4 Linux/6.2.0-39-generic

Security for lavague-tests 0.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page