Skip to main content

Test runner for Lavague

Project description

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.

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

lavague_tests-0.0.3.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

lavague_tests-0.0.3-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file lavague_tests-0.0.3.tar.gz.

File metadata

  • Download URL: lavague_tests-0.0.3.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.11.4 Linux/6.2.0-39-generic

File hashes

Hashes for lavague_tests-0.0.3.tar.gz
Algorithm Hash digest
SHA256 f931662b777a8bf6b1751d4fd150df32a13bdab4933ad32d89760a95a7663ba8
MD5 31659610b215cbe54c09d62b510e2774
BLAKE2b-256 5363f2bda9ebe0fa524198ea217e473558b9168ece106d5d2961de599bc54fef

See more details on using hashes here.

File details

Details for the file lavague_tests-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: lavague_tests-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.11.4 Linux/6.2.0-39-generic

File hashes

Hashes for lavague_tests-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2db11ebc4570365ce513ef1911450eb5325d799acbe5a58a4c82504266f2e6b7
MD5 4fef869b8cec1271301e2404971d540b
BLAKE2b-256 c443fff0fda9cf6d6c0e00d1674894d3f08f573c807fd5daafac0b3b7974230c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page