Godot自动化测试框架

GodotPlay是一个为Godot 4.x设计的类Playwright自动化测试框架,支持C#插件和.NET客户端库,适用于游戏开发和AI代理集成。

  • by bifteki-crew
  • C#
  • 本地部署
  • 更新于
在 GitHub 查看 bifteki-crew/GodotPlay

使用说明

GodotPlay

Godot 4.x的类似剧作家的测试自动化框架。

组件

  • Godotplay。插件 --嵌入gRPC服务器的C#Godot插件
  • GodotPlay。客户 — .NET客户端库,带有以剧作家为灵感的API
  • godotplay mcp --用于AI代理集成的MCP服务器

快速开始

1.将插件添加到Godot C#项目中

dotnet add package GodotPlay.Plugin
dotnet build

这会自动复制插件,注册自动加载,并拉取依赖项。

2.写一个测试

var session = await GodotPlayLauncher.LaunchAsync(new LaunchOptions {
    ProjectPath = "../my-game",
    Headless = true
});

var button = session.Locator(className: "Button", namePattern: "Start*");
await button.ClickAsync();
await Expect.That(button).ToExistAsync();

await session.DisposeAsync();

3.与AI代理(MCP)一起使用

添加到您的 .mcp.json 或克劳德代码MCP设置:

{
  "mcpServers": {
    "godotplay": {
      "command": "npx",
      "args": ["godotplay-mcp"]
    }
  }
}

发展

dotnet build GodotPlay.sln          # Build .NET projects
dotnet test                          # Run unit tests
cd src/godotplay-mcp && npm run build  # Build MCP server

状态

MVP——概念验证。看 设计文件 为了获得全面的视野。