Skip to content

code-philia/WebTestPilot-SJTU-Course

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebTestPilot

English简体中文 (Simplified Chinese)

WebTestPilot is an LLM-driven automated web testing framework for end-to-end browser testing.

This version is specifically intended for course teaching at Shanghai Jiao Tong University (SJTU).

Prerequisites

Before getting started, please make sure you have installed the uv package manager. (Guide)

Installation

  1. Clone the code repository

  2. Install the WebTestPilot PyTest plugin

    # Install all project dependencies
    uv sync
  3. Configure environment variables

    We use a .env file to store configuration options and secrets (such as API keys).

    Copy the template file and modify it as needed:

    cp .env.example .env

Usage

  1. Start the Chrome browser

    WebTestPilot does not launch a new browser each time. Instead, it connects to an already running Chrome instance.

    Run the following command based on your operating system:

    根据你的操作系统运行:

    # macOS / Linux / WSL
    source ./browsers/browser.sh
    # Windows
    powershell -ExecutionPolicy Bypass -File ./browsers/browser.ps1

    This will start a Chrome browser with special configurations that WebTestPilot can control.

  2. Manual login (only required once)

    In the opened Chrome browser, visit the website you want to test and log in manually. The login state will be saved in the browser profile and automatically reused in subsequent tests.

    Please do not close the browser, otherwise you will need to log in again.

  3. Run tests with Pytest

    Run the following command:

    uv run pytest [test file or directory path] -v --url [target website URL]
    # Example
    uv run pytest ./tests/12306/dining-view-merchant-details.json -v --url https://www.12306.cn

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •