An AI-powered VS Code extension for automated web testing and test case generation.
git clone --recurse-submodules https://github.com/code-philia/WebTestPilot-extension.git
cd WebTestPilot-extension
git submodule sync --recursive
git submodule update --init --recursive- Google Chrome installed locally
- Node.js >= 22.9.0
- Python 3.12
# Copy sample .env file
cp .env.example .env
# Fill in the OPENAI_API_KEY in .env ...Install uv using the following scripts:
# For MacOS
curl -LsSf https://astral.sh/uv/install.sh | sh
# For Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
# Test the command
uvFor more details, refer to original uv document.
# If don't have yarn
npm install --global yarn
# MacOS / Linux / WSL
source setup.sh
# Windows
powershell -ExecutionPolicy Bypass -File setup.ps1if you see the output below, it means the extension is installed successfully.

- Start chrome browser instance:
# MacOS / Linux / WSL
source browser.sh
# Windows
powershell -ExecutionPolicy Bypass -File browser.ps1you will see this output and a chrome browser instance opened.

- Open file
src/extension.ts. - Press
Ctrl+Shift+P(orCmd+Shift+Pon Mac) and search for command: "Debug: Start Debugging", click it and choose "VS Code Extension Development".

- In the extension debug window (with the title of "[Extention Development Host]")
- Open the
samplefolder inside theWebTestPilot-extensionrepo. - Press
Ctrl+Shift+Pand type "WebTestPilot: Set Workspace...", then select the WebTestPilot-extension folder.

- Click the WebTestPilot extension icon in the sidebar.

- Check the "Real Sites" option in the WebTestPilot sidebar for running test on real websites.

- Click "Run test" to run single test.

- Write your own testcases in json format in the
samplefolder, and back to WebTestPilot sidebar to run the test.
When there are updates to the code base, run the following command and then restart the extension.
First, update build
# MacOS / Linux / WSL
source setup.sh
# Windows
sh setup.shSecond, restart the extension. Click the restart button here (after debugging started)

or, stop the debugger and start again:
A walkthrough demo of WebTestPilot
There are 3 main functionalities of WebTestPilot:
- Test cases: steps to perform (i.e. "Click Login button") and its expected result (i.e. "Login screen show up").
- Fixtures: shared common steps before a test case, i.e. many test cases need login, we can have a fixture for login.
- Environment variables: we define common variables such as WEBSITE_URL, USERNAME, PASSWORD, ... these can be used in fixtures and test cases in the form of
${WEBSITE_URL}.
Examples: fixtures, testcases and environments in ./sample.
This image shows how all three functionalities can be used together.


