Skip to content

Commit 540c351

Browse files
authored
v0.2.0: Two-phase Planning, GPT-5 Responses API & Enhanced Execution
2 parents 09bd66c + 2fce5ce commit 540c351

31 files changed

+5031
-666
lines changed

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.11

README.md

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,16 @@ git clone https://github.com/MigoXLab/webqa-agent.git
9292
cd webqa-agent
9393
```
9494

95-
Install Python >= 3.10 and run the following commands:
95+
1. Recommended: Install dependencies with [uv](https://github.com/astral-sh/uv) (Python>=3.11):
9696

9797
```bash
98-
pip install -r requirements.txt
99-
playwright install
98+
uv sync
99+
```
100+
101+
2. Install Chromium browser:
102+
103+
```bash
104+
uv run playwright install chromium
100105
```
101106

102107
Performance Analysis - Lighthouse (Optional)
@@ -124,9 +129,25 @@ nuclei -version # Verify successful installation
124129
After configuring `config/config.yaml` (refer to "Usage > Test Configuration"), run:
125130

126131
```bash
127-
python webqa-agent.py
132+
uv run python webqa-agent.py
128133
```
129134

135+
### 🖥️ Visual Web Interface
136+
137+
WebQA Agent provides a user-friendly visual interface powered by Gradio.
138+
139+
```bash
140+
# Install Gradio
141+
uv add "gradio>5.44.0"
142+
# Launch the Web UI
143+
uv run python app.py
144+
145+
# Launch with Chinese interface
146+
GRADIO_LANGUAGE=zh-CN uv run python app.py
147+
```
148+
149+
Access the interface at http://localhost:7860.
150+
130151
## Usage
131152

132153
### Test Configuration
@@ -192,14 +213,14 @@ UX (User Experience) testing focuses on usability and user-friendliness. Uses mu
192213

193214
### 🧠 Recommended Models
194215

195-
Based on our testing, these models work well with WebQA Agent:
216+
The following models have been adapted and verified, and are recommended:
196217

197-
| Model | Key Strengths | Notes |
198-
|-----------------------------------|-----------------------------|---------------------------------|
199-
| **gpt-4.1-2025-04-14** | High accuracy & reliability | **Best choice** |
200-
| **gpt-4.1-mini-2025-04-14** | Cost-effective | **Economical and practical** |
201-
| **qwen3-vl-235b-a22b-instruct** | Open-source, GPT-4.1 level | **Best for on-premise** |
202-
| **doubao-seed-1-6-vision-250815** | Vision capabilities | **Excellent web understanding** |
218+
| Model | Recommendation |
219+
|-----------------------------------|-----------------------------|
220+
| **gpt-4.1-2025-04-14** | High accuracy and reliability |
221+
| **gpt-4.1-mini-2025-04-14** | Economical and practical |
222+
| **qwen3-vl-235b-a22b-instruct** | Open-source model, preferred for on-premise |
223+
| **doubao-seed-1-6-vision-250815** | Good web understanding, supports visual recognition |
203224

204225

205226
### View Results

README_zh-CN.md

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
<p align="center">
2525
体验Demo 🤗<a href="https://huggingface.co/spaces/mmmay0722/WebQA-Agent">HuggingFace</a> | 🚀<a href="https://modelscope.cn/studios/mmmmei22/WebQA-Agent/summary">ModelScope</a><br>
26-
加入我们 🎮<a href="https://discord.gg/K5TtkVcx">Discord</a> | 💬<a href="https://aicarrier.feishu.cn/docx/NRNXdIirXoSQEHxhaqjchUfenzd">微信群</a>
26+
加入我们 🎮<a href="https://discord.gg/fG5QAxYyNr">Discord</a> | 💬<a href="https://aicarrier.feishu.cn/docx/NRNXdIirXoSQEHxhaqjchUfenzd">微信群</a>
2727
</p>
2828

2929
<p align="center"><a href="README.md">English</a> · <a href="README_zh-CN.md">简体中文</a></p>
@@ -92,20 +92,23 @@ git clone https://github.com/MigoXLab/webqa-agent.git
9292
cd webqa-agent
9393
```
9494

95-
安装 Python >= 3.10,运行以下命令
95+
1. 推荐使用 [uv](https://github.com/astral-sh/uv) 安装依赖(Python>=3.11)
9696

9797
```bash
98-
pip install -r requirements.txt
99-
playwright install
98+
uv sync
99+
```
100+
101+
2. 安装 Chromium 浏览器:
100102

103+
```bash
104+
uv run playwright install chromium
101105
```
102106

103107
性能分析 - Lighthouse 安装(可选)
104108

105109
```bash
106-
# 需要 Node.js >= 18.0.0 package.json
110+
# 需要 Node.js >= 18.0.0
107111
npm install
108-
109112
```
110113

111114
安全扫描 - Nuclei 安装(可选)
@@ -124,12 +127,28 @@ nuclei -version # 验证安装成功
124127

125128
```
126129

127-
参考使用说明 > 测试配置进行 `config/config.yaml` 配置后,运行下方命令。
130+
参考"使用说明 > 测试配置"进行 `config/config.yaml` 配置后,运行下方命令。
128131

129132
```bash
130-
python webqa-agent.py
133+
uv run python webqa-agent.py
131134
```
132135

136+
### 🖥️ 可视化 Web 界面
137+
138+
WebQA Agent 提供了基于 Gradio 的可视化界面,操作更加便捷。
139+
140+
```bash
141+
# 安装 Gradio
142+
uv add "gradio>5.44.0"
143+
# 启动 Web UI
144+
uv run python app.py
145+
146+
# 启动中文界面
147+
GRADIO_LANGUAGE=zh-CN uv run python app.py
148+
```
149+
150+
访问地址:http://localhost:7860。
151+
133152
## 使用说明
134153

135154
### 测试配置
@@ -195,14 +214,14 @@ UX(用户体验)评估关注网页可用性与友好性。采用多模态分
195214

196215
### 🧠 推荐模型
197216

198-
基于实际测试结果,以下模型表现较好,推荐使用:
217+
以下模型经过适配与验证,推荐使用:
199218

200-
| 模型 | 核心优势 | 使用建议 |
201-
|-----------------------------------|--------------|------------|
202-
| **gpt-4.1-2025-04-14** | 高准确性与可靠性 | **最佳选择** |
203-
| **gpt-4.1-mini-2025-04-14** | 性价比高 | **经济实用** |
204-
| **qwen3-vl-235b-a22b-instruct** | 媲美gpt-4.1,开源 | **私有部署首选** |
205-
| **doubao-seed-1-6-vision-250815** | 支持视觉识别 | **网页理解优异** |
219+
| 模型 | 推荐理由 |
220+
|-----------------------------------|------|
221+
| **gpt-4.1-2025-04-14** | 准确性与可靠性较高 |
222+
| **gpt-4.1-mini-2025-04-14** | 经济实用,性价比高 |
223+
| **qwen3-vl-235b-a22b-instruct** | 开源模型,私有部署首选 |
224+
| **doubao-seed-1-6-vision-250815** | 网页理解较优异,支持视觉识别 |
206225

207226
### 查看结果
208227

app.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,24 @@ def get_gradio_language():
2727

2828
# Import and launch Gradio application
2929
if __name__ == "__main__":
30+
# Check Gradio installation and version
31+
try:
32+
import gradio
33+
except ImportError:
34+
print("❌ Error: Gradio is not installed.")
35+
print("Please install Gradio: uv add \"gradio>5.44.0\"")
36+
sys.exit(1)
37+
38+
try:
39+
from packaging import version
40+
required_gradio_version = "5.44.0"
41+
if version.parse(gradio.__version__) <= version.parse(required_gradio_version):
42+
print(f"❌ Error: Gradio version {gradio.__version__} is installed, but > {required_gradio_version} is required.")
43+
print(f"Please upgrade Gradio: uv add \"gradio>{required_gradio_version}\"")
44+
sys.exit(1)
45+
except ImportError:
46+
pass # packaging not found, skip version check
47+
3048
try:
3149
from app_gradio.demo_gradio import create_gradio_interface, queue_manager, process_queue
3250
import threading
@@ -36,7 +54,7 @@ def get_gradio_language():
3654
print("📱 Interface will start at http://localhost:7860")
3755
print(f"🌐 Interface language: {GRADIO_LANGUAGE}")
3856
print("💡 Tip: Set environment variable GRADIO_LANGUAGE=en-US for English or GRADIO_LANGUAGE=zh-CN for Chinese")
39-
print("⚠️ Note: Please ensure all dependencies are installed (pip install -r requirements.txt)")
57+
print("⚠️ Note: Please ensure all dependencies are installed (uv sync)")
4058
print("🔍 Checking Playwright browser dependencies...")
4159

4260
async def _check_playwright():

config/config.yaml.example

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ llm_config: # LLM configuration, currently only supports OpenAI SDK compatible f
2727
temperature: 0.1 # Optional, default 0.1
2828
# top_p: 0.9 # Optional, if not set, this parameter will not be passed
2929
# max_tokens: 8192 # Optional, maximum output tokens (supports generating more test cases)
30+
# GPT-5 family reasoning & text verbosity configuration (optional)
31+
# reasoning:
32+
# effort: none # none | low | medium | high (gpt-5.1 defaults to 'none' for low-latency)
33+
# text:
34+
# verbosity: medium # low | medium | high (default 'medium')
3035

3136
browser_config:
3237
viewport: {"width": 1280, "height": 720}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "webqa-agent",
3-
"version": "0.1.0",
4-
"description": "WebQA Agent - 全自动网页评估测试",
3+
"version": "0.2.0",
4+
"description": "WebQA Agent is an autonomous web browser agent that audits performance, functionality & UX for engineers and vibe-coding creators.",
55
"dependencies": {
66
"chrome-launcher": "^1.2.0",
77
"lighthouse": "^12.8.1"

pyproject.toml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[project]
2+
name = "webqa-agent"
3+
version = "0.2.0"
4+
description = "WebQA Agent is an autonomous web browser agent that audits performance, functionality & UX for engineers and vibe-coding creators."
5+
readme = "README.md"
6+
requires-python = ">=3.11"
7+
dependencies = [
8+
"html2text>=2025.4.15",
9+
"jinja2>=3.1.6",
10+
"langchain==0.3.26",
11+
"langchain-core==0.3.68",
12+
"langchain-openai==0.3.27",
13+
"langgraph==0.5.1",
14+
"langgraph-checkpoint==2.1.0",
15+
"openai>=1.93.0",
16+
"pillow==11.3.0",
17+
"playwright==1.52.0",
18+
"pydantic==2.9.2",
19+
"pytest>=8.4.1",
20+
"pytest-asyncio>=1.3.0",
21+
"python-dotenv>=1.1.1",
22+
"pyyaml>=6.0.2",
23+
"requests>=2.32.4",
24+
"typing-extensions==4.14.0",
25+
]

requirements.txt

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
html2text
2-
jinja2
3-
langchain
4-
langchain-openai
5-
langgraph
6-
openai
1+
html2text==2025.4.15
2+
jinja2==3.1.6
3+
langchain==0.3.26
4+
langchain-core==0.3.68
5+
langchain-openai==0.3.27
6+
langgraph==0.5.1
7+
langgraph-checkpoint==2.1.0
8+
openai==1.93.0
9+
pillow==11.3.0
710
playwright==1.52.0
8-
pydantic
9-
pytest
10-
pytest-asyncio
11-
python-dotenv
12-
requests
13-
pillow
14-
gradio
15-
pyyaml
11+
pydantic==2.9.2
12+
pytest==8.4.1
13+
pytest-asyncio==1.3.0
14+
python-dotenv==1.1.1
15+
requests==2.32.4
16+
pyyaml==6.0.2
17+
typing-extensions==4.14.0

tests/mocks/action_mocks.json

Lines changed: 34 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -336,56 +336,53 @@
336336
"actions": [
337337
{
338338
"type": "Scroll",
339-
"locate": null,
340-
"param": {
341-
"direction": "down",
342-
"scrollType": "untilBottom",
343-
"distance": null
344-
}
339+
"locate": {"id": "1"},
340+
"param": null
345341
},
346342
{
347343
"type": "Scroll",
348-
"locate": null,
349-
"param": {
350-
"direction": "up",
351-
"scrollType": "untilTop",
352-
"distance": null
353-
}
344+
"locate": {"id": "2"},
345+
"param": null
354346
}
355347
],
356-
"id_map": {}
348+
"id_map": {
349+
"1": {
350+
"id": 100,
351+
"tagName": "footer",
352+
"isInViewport": false,
353+
"selector": "footer#site-footer",
354+
"xpath": "//*[@id=\"site-footer\"]",
355+
"center_y": 2000
356+
},
357+
"2": {
358+
"id": 101,
359+
"tagName": "header",
360+
"isInViewport": false,
361+
"selector": "header#site-header",
362+
"xpath": "//*[@id=\"site-header\"]",
363+
"center_y": 50
364+
}
365+
}
357366
},
358367
{
359368
"url": "https://arxiv.org/list/astro-ph/new",
360369
"actions": [
361370
{
362371
"type": "Scroll",
363-
"locate": null,
364-
"param": {
365-
"direction": "down",
366-
"scrollType": "once"
367-
}
368-
},
369-
{
370-
"type": "Scroll",
371-
"locate": null,
372-
"param": {
373-
"direction": "down",
374-
"scrollType": "once",
375-
"distance": 400
376-
}
377-
},
378-
{
379-
"type": "Scroll",
380-
"locate": null,
381-
"param": {
382-
"direction": "up",
383-
"scrollType": "once",
384-
"distance": 200
385-
}
372+
"locate": {"id": "1"},
373+
"param": null
386374
}
387375
],
388-
"id_map": {}
376+
"id_map": {
377+
"1": {
378+
"id": 200,
379+
"tagName": "section",
380+
"isInViewport": false,
381+
"selector": "section.results",
382+
"xpath": "//section[@class='results']",
383+
"center_y": 1500
384+
}
385+
}
389386
}
390387
],
391388
"SelectDropdown": [

0 commit comments

Comments
 (0)