@@ -5,35 +5,49 @@ On-device E2E test agent for [FlutterProbe](https://flutterprobe.dev). Embeds in
55[ ![ pub package] ( https://img.shields.io/pub/v/flutter_probe_agent.svg )] ( https://pub.dev/packages/flutter_probe_agent )
66[ ![ Publisher] ( https://img.shields.io/pub/publisher/flutter_probe_agent.svg )] ( https://pub.dev/publishers/alphawavesystems.com )
77
8- ## What is FlutterProbe?
8+ ## How FlutterProbe Works
99
10- FlutterProbe lets you write E2E tests in plain English:
10+ FlutterProbe is a ** two-part system** :
11+
12+ 1 . ** This package** (` flutter_probe_agent ` ) — embeds in your Flutter app, listens for test commands
13+ 2 . ** The CLI** (` probe ` ) — a Go binary that parses ` .probe ` test files and sends commands to the agent
14+
15+ Both are required. The agent alone does nothing without the CLI to drive it.
1116
1217```
13- test "user can log in"
14- tap "Email"
15- type "user@test.com" into "Email"
16- tap "Password"
17- type "secret123" into "Password"
18- tap "Sign In"
19- wait until "Dashboard" appears
20- see "Welcome"
18+ ┌──────────────┐ WebSocket / HTTP ┌─────────────────────┐
19+ │ probe CLI │ ◄──────────────────► │ flutter_probe_agent │
20+ │ (Go binary) │ JSON-RPC 2.0 │ (in your app) │
21+ └──────────────┘ └─────────────────────┘
2122```
2223
23- Tests execute with sub-50ms command round-trips via direct widget-tree access — no UI automation layer, no WebDriver, no accessibility bridge.
24+ ## Step 1: Install the CLI
25+
26+ The ` probe ` CLI is a Go binary. Install via one of:
2427
25- ## Installation
28+ ``` bash
29+ # Option A: Go install
30+ go install github.com/AlphaWaveSystems/flutter-probe/cmd/probe@latest
31+
32+ # Option B: Download from GitHub Releases
33+ # https://github.com/AlphaWaveSystems/flutter-probe/releases/latest
34+ ```
35+
36+ Verify:
37+
38+ ``` bash
39+ probe --version
40+ ```
2641
27- Add to your ` pubspec.yaml ` :
42+ ## Step 2: Add the Agent to Your App
2843
2944``` yaml
45+ # pubspec.yaml
3046dev_dependencies :
31- flutter_probe_agent : ^0.5.1
47+ flutter_probe_agent : ^0.5.3
3248` ` `
3349
34- ## Setup
35-
36- Initialize the agent in your app's ` main.dart`:
50+ Initialize in your ` main.dart`:
3751
3852` ` ` dart
3953import 'package:flutter_probe_agent/flutter_probe_agent.dart';
@@ -50,50 +64,75 @@ Future<void> main() async {
5064}
5165` ` `
5266
53- Build with the agent enabled :
67+ The agent is **completely inactive** unless `PROBE_AGENT=true` is passed at build time. It adds zero overhead to your production app.
68+
69+ # # Step 3: Write a Test
70+
71+ Create `tests/login.probe` :
72+
73+ ` ` `
74+ test "user can log in"
75+ tap "Email"
76+ type "user@test.com" into "Email"
77+ tap "Password"
78+ type "secret123" into "Password"
79+ tap "Sign In"
80+ wait until "Dashboard" appears
81+ see "Welcome"
82+ ` ` `
83+
84+ # # Step 4: Run It
5485
5586` ` ` bash
87+ # Start your app with the agent enabled
5688flutter run --dart-define=PROBE_AGENT=true
89+
90+ # In another terminal, run the test
91+ probe test tests/login.probe --device <your-device> -v
5792` ` `
5893
59- The agent is **completely inactive** unless `PROBE_AGENT=true` is passed at build time. It adds zero overhead to your production app .
94+ Tests execute with sub-50ms command round-trips via direct widget-tree access — no UI automation layer, no WebDriver, no accessibility bridge .
6095
6196# # Physical Device Testing
6297
63- For physical iOS devices, WiFi testing is recommended :
98+ For physical iOS devices, ** WiFi is recommended** (USB-C causes intermittent connection drops) :
6499
65100` ` ` bash
66101# Build with WiFi enabled
67102flutter build ios --profile \
68103 --dart-define=PROBE_AGENT=true \
69104 --dart-define=PROBE_WIFI=true
70105
71- # Run tests over WiFi
72- probe test tests/ --host <device-ip> --token <probe-token>
106+ # Install and launch on device
107+ xcrun devicectl device install app --device <UDID> build/ios/iphoneos/Runner.app
108+ xcrun devicectl device process launch --device <UDID> <bundle-id>
109+
110+ # Run tests over WiFi (find token in app console: PROBE_TOKEN=...)
111+ probe test tests/ --host <device-ip> --token <probe-token> -v
73112` ` `
74113
75114# # Features
76115
77116- **WebSocket + HTTP transports** — persistent connection for simulators, stateless HTTP for physical devices
78117- **Profile mode support** — works on physical iOS devices (not just debug)
79118- **Release mode safeguards** — blocked by default, opt-in with `allowReleaseBuild: true`
80- - **Ping/pong keepalive** — prevents idle connection drops
81119- **WiFi testing** — bind to `0.0.0.0` with `PROBE_WIFI=true` for cable-free testing
82120- **Pre-shared restart token** — `restart the app` works over WiFi without USB log reading
121+ - **`tap "X" if visible`** — conditional actions that skip silently when widget is not found
122+
123+ # # Requirements
124+
125+ - **Flutter** 3.19+ (tested up to 3.41)
126+ - **Dart** 3.3+
127+ - **FlutterProbe CLI** — [install instructions](https://github.com/AlphaWaveSystems/flutter-probe#installation)
83128
84129# # Documentation
85130
86131- [Getting Started](https://flutterprobe.dev/getting-started/installation/)
87132- [ProbeScript Syntax](https://flutterprobe.dev/probescript/syntax/)
88133- [ProbeScript Dictionary](https://flutterprobe.dev/probescript/dictionary/)
89- - [iOS Integration Guide](https://flutterprobe.dev/platform/ios/)
90134- [CLI Reference](https://flutterprobe.dev/tools/cli-reference/)
91-
92- # # Requirements
93-
94- - Flutter 3.19+ (tested up to 3.41)
95- - Dart 3.3+
96- - [FlutterProbe CLI](https://github.com/AlphaWaveSystems/flutter-probe) (`probe` binary)
135+ - [iOS Integration Guide](https://flutterprobe.dev/platform/ios/)
97136
98137# # License
99138
0 commit comments