Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions desktop/electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ win:
- target: nsis
arch: [x64]
icon: build/icon.ico
verifyUpdateCodeSignature: false

mac:
target:
- target: dmg
arch: [x64, arm64]
icon: build/icon.icns
category: public.app-category.developer-tools
minimumSystemVersion: "12.0"

linux:
target:
Expand Down
54 changes: 54 additions & 0 deletions mobile/COMPATIBILITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Test-Agent 兼容性矩阵

## 桌面版 (Electron + PyInstaller)

| 操作系统 | 版本 | 架构 | 状态 |
|----------|------|------|------|
| Windows 11 | 21H2+ | x64 | 完整支持 |
| Windows 10 | 21H2+ | x64 | 完整支持 |
| Windows 10 | 1809-21H1 | x64 | 支持 (无 WebView2 需系统自带) |
| Windows 7/8/8.1 | — | — | **不支持** |
| macOS 15 Sequoia | 15.0+ | arm64, x64 | 完整支持 |
| macOS 14 Sonoma | 14.0+ | arm64, x64 | 完整支持 |
| macOS 13 Ventura | 13.0+ | arm64, x64 | 支持 |
| macOS 12 Monterey | 12.0+ | x64 | 支持 (仅 x64) |
| Linux (AppImage) | Ubuntu 22.04+ / Debian 12+ | x64 | 支持 |

## 移动版 (PWA + Capacitor)

| 平台 | 最低版本 | 安装方式 |
|------|----------|---------|
| iOS | 14.0+ | App Store / PWA "添加到主屏幕" |
| iPadOS | 14.0+ | App Store / PWA |
| Android | 8.0 (API 26)+ | Google Play / PWA "安装" |
| Android Go | 12+ | PWA (lite) |
| ChromeOS | 91+ | Google Play / PWA |

## 浏览器 (Web UI)

| 浏览器 | 最低版本 | 备注 |
|--------|----------|------|
| Chrome | 90+ | 完整支持 |
| Firefox | 90+ | 完整支持 |
| Safari | 15+ | PWA + 添加到主屏幕 |
| Edge | 90+ | 完整支持 |
| Samsung Internet | 16+ | 支持 |
| Opera | 76+ | 支持 |

## 后端 (Python Runtime)

| 环境 | 最低版本 |
|------|----------|
| Python | 3.10+ (推荐 3.11) |
| PostgreSQL | 14+ (可选,stub 模式不需要) |
| Docker | 24+ (可选) |
| Node.js | 18+ (仅 Web UI 开发需要) |

## 屏幕适配

| 设备 | 宽度 | 布局 |
|------|------|------|
| 手机 | < 640px | 单列,底部导航 |
| 平板 | 640-1024px | 双列 |
| 桌面 | > 1024px | 完整布局 |
| 超大屏 | > 1536px | 宽屏优化 |
55 changes: 55 additions & 0 deletions mobile/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Test-Agent Mobile

PWA + Capacitor mobile app for iOS and Android. Connects to a Test-Agent backend server.

## Architecture

```
Mobile App (Capacitor)
└── Web UI (React PWA — runtime/web/)
└── HTTP → Test-Agent Backend (FastAPI :8800)
```

## Quick Start (Browser PWA)

1. Start backend: `uvicorn runtime.api.main:app --host 0.0.0.0 --port 8800`
2. Open `http://<server-ip>:5173` on your phone (same WiFi)
3. "Add to Home Screen" from browser menu → installs as PWA

## Build for App Stores

```bash
# 1. Install Capacitor
cd mobile && npm install

# 2. Build web UI
npm run build

# 3. Add platforms
npx cap add ios
npx cap add android

# 4. Open in Xcode / Android Studio
npx cap open ios # → Xcode → Archive → App Store
npx cap open android # → Android Studio → Build → Play Store
```

## App Store Requirements

- **iOS**: Apple Developer account ($99/yr), Xcode 16+, macOS
- **Android**: Google Play Console ($25 one-time), Android Studio

## Compatibility

| Platform | Min Version | Status |
|----------|-------------|--------|
| iOS | 14.0+ | Full PWA + Capacitor |
| Android | 8.0+ (API 26) | Full PWA + Capacitor |
| iPadOS | 14.0+ | PWA adaptive layout |
| Android Tablet | 8.0+ | PWA adaptive layout |

## Backend Connection

The mobile app connects to a Test-Agent backend server. Set the server address in Settings → Backend URL. Default: `http://localhost:8800`.

For remote use, deploy the backend to a cloud server and configure the URL.
18 changes: 18 additions & 0 deletions mobile/capacitor.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"appId": "com.testagent.mobile",
"appName": "Test-Agent",
"webDir": "../runtime/web/dist",
"bundledWebRuntime": false,
"server": {
"androidScheme": "https"
},
"plugins": {
"SplashScreen": {
"launchShowDuration": 2000,
"backgroundColor": "#3b82f6"
}
},
"ios": {
"contentInset": "automatic"
}
}
19 changes: 19 additions & 0 deletions mobile/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "test-agent-mobile",
"version": "1.32.0",
"description": "Test-Agent Mobile — AI Testing Framework for iOS & Android",
"scripts": {
"build": "cd ../runtime/web && npm run build",
"sync:ios": "npx cap sync ios",
"sync:android": "npx cap sync android",
"open:ios": "npx cap open ios",
"open:android": "npx cap open android",
"build:all": "npm run build && npx cap sync"
},
"dependencies": {
"@capacitor/core": "^7.0.0",
"@capacitor/ios": "^7.0.0",
"@capacitor/android": "^7.0.0",
"@capacitor/cli": "^7.0.0"
}
}
10 changes: 7 additions & 3 deletions runtime/web/index.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
<!doctype html>
<html lang="zh-CN">
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
<meta name="theme-color" content="#3b82f6" />
<meta name="description" content="Test-Agent — AI Testing Framework" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Test-Agent · Runtime UI</title>
<link rel="manifest" href="/manifest.json" />
<link rel="apple-touch-icon" href="/icon-192.png" />
<title>Test-Agent</title>
</head>
<body>
<div id="root"></div>
Expand Down
14 changes: 14 additions & 0 deletions runtime/web/public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "Test-Agent",
"short_name": "TestAgent",
"description": "AI Testing Framework — autonomous from PRD to bug report",
"start_url": "/",
"display": "standalone",
"background_color": "#ffffff",
"theme_color": "#3b82f6",
"orientation": "any",
"icons": [
{ "src": "/icon-192.png", "sizes": "192x192", "type": "image/png" },
{ "src": "/icon-512.png", "sizes": "512x512", "type": "image/png" }
]
}
22 changes: 22 additions & 0 deletions runtime/web/public/sw.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Test-Agent service worker — offline shell + API proxy
const CACHE = "tagent-v1";
const SHELL = ["/", "/index.html"];

self.addEventListener("install", (e) => {
e.waitUntil(caches.open(CACHE).then((c) => c.addAll(SHELL)));
});

self.addEventListener("fetch", (e) => {
if (e.request.method !== "GET") return;
e.respondWith(
caches.match(e.request).then((cached) => cached || fetch(e.request))
);
});

self.addEventListener("activate", (e) => {
e.waitUntil(
caches.keys().then((keys) =>
Promise.all(keys.filter((k) => k !== CACHE).map((k) => caches.delete(k)))
)
);
});
11 changes: 11 additions & 0 deletions runtime/web/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,14 @@ body {
outline: 2px solid #2563eb;
outline-offset: 2px;
}

/* Mobile responsive — bottom nav on small screens */
@media (max-width: 640px) {
header nav ul { gap: 0.5rem; font-size: 0.75rem; }
main { padding: 0.75rem; }
}

/* Safe area for notch phones (iOS) */
@supports (padding: env(safe-area-inset-bottom)) {
footer { padding-bottom: env(safe-area-inset-bottom); }
}
5 changes: 5 additions & 0 deletions runtime/web/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,8 @@ ReactDOM.createRoot(document.getElementById("root")!).render(
</QueryClientProvider>
</React.StrictMode>,
);

// Register service worker for PWA / offline
if ("serviceWorker" in navigator) {
navigator.serviceWorker.register("/sw.js");
}
Loading