Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

Repository files navigation

AIDAW-TestBot

AIDAW (Magda) DAW 的 GUI 自动化测试机器人。通过 HTTP API 接收 AI 发来的测试指令,自动操作 DAW 窗口并验证音频输出和视觉状态。

构建

build.bat

需要:CMake 3.20+, Ninja, MSVC (Visual Studio 2022)

使用

服务器模式(AI 发指令)

aidaw-testbot.exe

启动后监听 http://localhost:8765,AI agent 通过 HTTP POST 发送测试指令。

直接运行脚本

aidaw-testbot.exe --run scripts/test_keyboard_sound.json

HTTP API

端点 方法 说明
/health GET 健康检查
/status GET 机器人状态
/execute POST 执行单条指令
/run POST 运行完整测试脚本
/screenshot GET 截图
/focus POST 聚焦窗口
/find_window POST 查找窗口

指令格式

{
    "action": "press_key",
    "params": {"key": "C4", "hold_ms": 500},
    "description": "按下 C4 键",
    "verify_audio": {
        "expect_sound": true,
        "min_rms_db": -40,
        "duration_ms": 600
    },
    "verify_visual": {
        "reference": "ref_image.bmp",
        "tolerance": 0.95
    }
}

支持的 Action

Action 说明 参数
press_key 按键 key, hold_ms
release_key 释放键 key
mouse_click 鼠标点击 x, y, button, clicks
mouse_drag 鼠标拖拽 from_x, from_y, to_x, to_y, duration_ms
mouse_move 移动鼠标 x, y
type_text 输入文本 text
wait 等待 ms
screenshot 截图 filename
capture_audio 录音 duration_ms, filename
find_window 查找窗口 title
focus_window 聚焦窗口 -
compare_image 图片对比 reference, tolerance
check_audio_level 检查音量 duration_ms, min_db, max_db
send_midi 发送 MIDI note, velocity, channel, duration_ms

键名映射

  • 标准键:space, enter, tab, escape, backspace, delete, up/down/left/right
  • 修饰键组合:ctrl+s, ctrl+z, shift+a
  • 钢琴键:C3-E5(映射到 JUCE 默认键盘布局 ZSXDC...QW...)
  • F 键:f1-f12

AI Agent 集成示例

其他 AI 可以这样调用:

import requests

# 测试按键有没有声音
resp = requests.post("http://localhost:8765/execute", json={
    "action": "press_key",
    "params": {"key": "C4", "hold_ms": 500},
    "verify_audio": {"expect_sound": True, "min_rms_db": -40, "duration_ms": 600}
})
result = resp.json()
print(f"Passed: {result['passed']}, Audio: {result['audio_rms_db']}dB")

工作流

  1. 启动 Magda DAW
  2. 启动 aidaw-testbot.exe(自动找到 Magda 窗口)
  3. AI agent 通过 HTTP 发送测试指令
  4. TestBot 执行操作 + 验证结果
  5. 返回 JSON 报告(pass/fail + 截图 + 音频数据)

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages