prompttest 1.3.0 β 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +151 -282
- package/package.json +1 -2
package/README.md
CHANGED
|
@@ -1,71 +1,78 @@
|
|
|
1
1
|
# β‘ PromptTest
|
|
2
2
|
|
|
3
|
-
> **Ultra-fast, zero-code autonomous mobile testing & visual QA brain for Android.**
|
|
3
|
+
> **Ultra-fast, zero-code autonomous mobile testing & visual QA brain for Android.**
|
|
4
|
+
> The zero-setup, zero-instrumentation alternative to Appium & Detox for React Native, Expo, Flutter, and Native Android.
|
|
4
5
|
|
|
5
|
-
[](https://www.npmjs.com/package/prompttest)
|
|
7
|
+
[](#-license)
|
|
6
8
|
[](https://nodejs.org/)
|
|
7
9
|
[](https://developer.android.com/tools/adb)
|
|
8
|
-
[](https://www.typescriptlang.org/)
|
|
9
11
|
|
|
10
|
-
**PromptTest**
|
|
12
|
+
**PromptTest** enables QA engineers, mobile developers, and autonomous agents to test Android applications using **plain-English natural language scripts**. It completely bypasses heavy server frameworks (Appium, Selenium, WebDriver) in favor of high-speed native ADB streams, expectation-driven polling, and an autonomous state-graph exploration engine.
|
|
11
13
|
|
|
12
|
-
|
|
14
|
+
---
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
### π Quick Navigation
|
|
17
|
+
- [π 30-Second Quick Start](#-30-second-quick-start)
|
|
18
|
+
- [βοΈ Writing Plain-English Tests](#οΈ-writing-plain-english-tests)
|
|
19
|
+
- [π Syntax Reference](#-syntax-reference)
|
|
20
|
+
- [π CLI Command Reference](#-cli-command-reference)
|
|
21
|
+
- [π― Mode Expectations & Limits](#-mode-expectations--limits)
|
|
22
|
+
- [π» Programmatic TypeScript SDK](#-programmatic-typescript-sdk)
|
|
23
|
+
- [π³ Docker Deployment](#-docker-container-deployment)
|
|
24
|
+
- [π Real-Device Benchmarks](#-proven-real-device-benchmarks)
|
|
25
|
+
- [π License](#-license)
|
|
15
26
|
|
|
16
27
|
---
|
|
17
28
|
|
|
18
29
|
## π Why PromptTest?
|
|
19
30
|
|
|
20
|
-
- π **Plain-English Test Scripts**: Write tests in human language without writing
|
|
21
|
-
- β‘ **
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
- π‘ **
|
|
25
|
-
-
|
|
31
|
+
- π **Plain-English Test Scripts**: Write tests in human language without writing fragile XPath selectors or boilerplate glue code.
|
|
32
|
+
- β‘ **Zero-Setup & Zero-Instrumentation**: Connects directly over native ADB (USB or Wi-Fi). No SDKs, test dependencies, or code modifications required in your target app.
|
|
33
|
+
- π€ **Autonomous State-Graph DFS Explorer**: Crawls apps autonomously, detects bottom-tab navigation hubs, traverses nested screens, and automatically triages defects without human intervention.
|
|
34
|
+
- π‘ **Dynamic Self-Healing Locators**: Resilient heuristic matching automatically adapts to changing dynamic counts (e.g. auto-resolving `"Present (2)"` to `"Present (5)"`).
|
|
35
|
+
- π‘ **Built-In Safety Engine**: Guards production and staging apps by blocking destructive actions (e.g., `"Delete Account"`, `"Discard Changes"`) during autonomous crawls.
|
|
36
|
+
- π **Standalone HTML & JUnit Reports**: Generates executive test reports with failure-only visual screenshots and actionable error diffs.
|
|
37
|
+
- π **Built for Modern Mobile Frameworks**: Native support for **React Native**, **Expo**, **Flutter**, and Native Android (Jetpack Compose / Views).
|
|
26
38
|
|
|
27
39
|
---
|
|
28
40
|
|
|
29
|
-
## π Quick Start
|
|
41
|
+
## π 30-Second Quick Start
|
|
30
42
|
|
|
31
43
|
### Prerequisites
|
|
44
|
+
- **Node.js 18.0.0+**
|
|
45
|
+
- **Android ADB** installed and accessible in your system `PATH`
|
|
46
|
+
- An Android device or emulator with **USB Debugging** enabled
|
|
32
47
|
|
|
33
|
-
1.
|
|
34
|
-
|
|
35
|
-
3. An Android device or emulator with **USB Debugging** enabled.
|
|
36
|
-
4. _Language Support_: The default seed dictionary covers English mobile UI interactions. Applications localized in other languages work via direct label matching or custom specifications.
|
|
37
|
-
|
|
38
|
-
### Installation
|
|
39
|
-
|
|
48
|
+
### 1. Run Instant Diagnostics (Zero Install Needed)
|
|
49
|
+
Verify your environment and connected devices with zero configuration:
|
|
40
50
|
```bash
|
|
41
|
-
|
|
42
|
-
git clone https://github.com/<your-username>/prompttest.git
|
|
43
|
-
cd prompttest
|
|
44
|
-
|
|
45
|
-
# Install dependencies
|
|
46
|
-
npm install
|
|
47
|
-
|
|
48
|
-
# Build TypeScript
|
|
49
|
-
npm run build
|
|
51
|
+
npx prompttest doctor
|
|
50
52
|
```
|
|
51
53
|
|
|
52
|
-
###
|
|
54
|
+
### 2. Autonomous Exploration (0 Lines of Code)
|
|
55
|
+
Autonomously crawl, discover navigation tabs, and stress-test your app:
|
|
56
|
+
```bash
|
|
57
|
+
npx prompttest explore <your.app.package>
|
|
58
|
+
```
|
|
53
59
|
|
|
60
|
+
### 3. Install in Your Project
|
|
61
|
+
Add PromptTest as a development dependency in your mobile project:
|
|
54
62
|
```bash
|
|
55
|
-
|
|
56
|
-
npm run devices
|
|
63
|
+
npm install --save-dev prompttest
|
|
57
64
|
```
|
|
58
65
|
|
|
59
66
|
---
|
|
60
67
|
|
|
61
68
|
## βοΈ Writing Plain-English Tests
|
|
62
69
|
|
|
63
|
-
Test
|
|
70
|
+
Test specifications are simple text files containing numbered steps written in conversational English.
|
|
64
71
|
|
|
65
72
|
### Example Spec (`specs/login_and_dashboard.txt`)
|
|
66
73
|
|
|
67
74
|
```text
|
|
68
|
-
# 1. Authentication
|
|
75
|
+
# 1. Authentication Flow
|
|
69
76
|
1. Type 'ramesh@coachconnect.app' into 'Email Address'
|
|
70
77
|
2. Type 'Teacher@1234' into 'Password'
|
|
71
78
|
3. Tap 'Sign In'
|
|
@@ -76,7 +83,7 @@ Test specs are simple text files containing numbered steps written in conversati
|
|
|
76
83
|
6. Verify 'Dr. Ramesh Sharma' is visible
|
|
77
84
|
7. Verify 'My Batches' is visible
|
|
78
85
|
|
|
79
|
-
# 3. Batches Module
|
|
86
|
+
# 3. Batches Module & Navigation
|
|
80
87
|
8. Tap 'Batches'
|
|
81
88
|
9. Verify 'Batches & Schedules' is visible
|
|
82
89
|
10. Tap 'Grade 10 Mathematics'
|
|
@@ -90,313 +97,175 @@ Test specs are simple text files containing numbered steps written in conversati
|
|
|
90
97
|
16. Verify 'Welcome Back' is visible
|
|
91
98
|
```
|
|
92
99
|
|
|
100
|
+
### Run the Spec:
|
|
101
|
+
```bash
|
|
102
|
+
npx prompttest run specs/login_and_dashboard.txt com.yourcompany.app
|
|
103
|
+
```
|
|
104
|
+
|
|
93
105
|
---
|
|
94
106
|
|
|
95
|
-
## π
|
|
107
|
+
## π Syntax Reference
|
|
108
|
+
|
|
109
|
+
| Category | Command Syntax | Description |
|
|
110
|
+
| :--- | :--- | :--- |
|
|
111
|
+
| **Tap / Click** | `Tap 'Sign In'` | Taps button, icon, link, or tab matching label or text. |
|
|
112
|
+
| **Input Fields** | `Type 'user@test.com' into 'Email'` | Auto-focuses field, clears existing text, and enters string safely. |
|
|
113
|
+
| **Assertions** | `Verify 'Dashboard' is visible` | Polls until the element appears on screen (sub-second resolution). |
|
|
114
|
+
| **Absence Check** | `Verify 'Loading...' is not visible` | Confirms an element, dialog, or spinner has dismissed. |
|
|
115
|
+
| **Spatial Tap** | `Tap 'Delete' next to 'Order #12'` | Disambiguates duplicate elements using directional proximity. |
|
|
116
|
+
| **Gestures** | `Scroll down`, `Scroll up`, `Swipe left` | Performs viewport-proportional touch flings. |
|
|
117
|
+
| **Hardware Keys** | `Press back`, `Press home` | Dispatches physical Android keycodes (`KEYCODE_BACK`, etc.). |
|
|
118
|
+
| **Delays** | `Wait 2s` or `Wait 1500ms` | Pauses execution for custom animation settling. |
|
|
119
|
+
| **Conditionals** | `Tap 'Dismiss' (if present)` | Executes step only if element exists, without failing the suite. |
|
|
120
|
+
| **Generators** | `$random.email`, `$date.now`, `$uuid` | Inlines dynamic synthetic data into input fields. |
|
|
96
121
|
|
|
97
|
-
|
|
122
|
+
---
|
|
98
123
|
|
|
99
|
-
|
|
100
|
-
| :----------------- | :------------------------------------ | :---------------------------------------------------------------- |
|
|
101
|
-
| **Type / Input** | `Type 'user@domain.com' into 'Email'` | Clears existing text and types the value into the matching input. |
|
|
102
|
-
| **Tap / Click** | `Tap 'Sign In'` | Clicks button, tab, link, or icon with exact boundary resolution. |
|
|
103
|
-
| **Long Press** | `Long press 'Student Card'` | Long presses an element for 1000ms. |
|
|
104
|
-
| **Verify Visible** | `Verify 'Dashboard' is visible` | Polls until the text or accessibility label appears on screen. |
|
|
105
|
-
| **Verify State** | `Verify 'Submit' is disabled` | Verifies element enablement state (`enabled` / `disabled`). |
|
|
106
|
-
| **Press Back** | `Press back` | Emits Android system `KEYCODE_BACK`. |
|
|
107
|
-
| **Scroll / Swipe** | `Scroll down` or `Scroll up` | Proportional responsive swipe along the screen viewport. |
|
|
108
|
-
| **Relative Tap** | `Tap 'Delete' next to 'Rohan Gupta'` | Disambiguates duplicate elements using spatial proximity. |
|
|
109
|
-
| **Wait** | `Wait 3s` or `Wait 1500ms` | Pauses execution for custom animation delays. |
|
|
124
|
+
## π CLI Command Reference
|
|
110
125
|
|
|
111
|
-
###
|
|
126
|
+
### Primary Execution Modes
|
|
112
127
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
| **Loop** | `LOOP 3 ... ENDLOOP` | Repeats child step block N times. |
|
|
117
|
-
| **Wait Until** | `WAIT_UNTIL 'Ready' is visible (10s)` | Explicit polling wait with max timeout budget. |
|
|
118
|
-
| **Subflow Include** | `#include <specs/login.txt>` | Inlines modular specs with circular dependency guards. |
|
|
119
|
-
| **Variables** | `SET $token = 'xyz'` | Sets local variable for interpolation (`$token`). |
|
|
120
|
-
| **Sandboxed JS** | `RUN_JS return { status: 200 }` | Executes deterministic JavaScript expressions. |
|
|
128
|
+
```bash
|
|
129
|
+
# 1. Deterministic Spec Runner
|
|
130
|
+
npx prompttest run specs/flow.txt <package>
|
|
121
131
|
|
|
122
|
-
|
|
132
|
+
# Cold-restart app before suite begins
|
|
133
|
+
npx prompttest run specs/flow.txt <package> --fresh
|
|
123
134
|
|
|
124
|
-
|
|
135
|
+
# Capture high-resolution visual screenshots on every step
|
|
136
|
+
npx prompttest run specs/flow.txt <package> --screenshots
|
|
125
137
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
{"user": "Alice", "email": "$random.email"},
|
|
129
|
-
{"user": "Bob", "email": "$random.email"}
|
|
130
|
-
]
|
|
131
|
-
1. Type '$user' into 'Username'
|
|
132
|
-
2. Type '$email' into 'Email'
|
|
133
|
-
```
|
|
138
|
+
# Dry-run validation (checks syntax without touching device)
|
|
139
|
+
npx prompttest run specs/flow.txt --dry-run
|
|
134
140
|
|
|
135
|
-
|
|
141
|
+
# Display formatted table of parsed steps
|
|
142
|
+
npx prompttest run specs/flow.txt --list-steps
|
|
136
143
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
- Date & Time: `$date.now`, `$date.iso`, `$date.format('YYYY-MM-DD')`
|
|
140
|
-
- Math Evaluation: `$calc($count + 1)`
|
|
144
|
+
# Run data-driven iterations
|
|
145
|
+
npx prompttest run specs/flow.txt <package> --iterations 5
|
|
141
146
|
|
|
142
|
-
|
|
147
|
+
# Run against a managed device pool with concurrency leasing
|
|
148
|
+
npx prompttest run specs/flow.txt <package> --device-pool emulator-5554,emulator-5556
|
|
143
149
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
2. Type '$code' into 'Verification Code'
|
|
148
|
-
3. API GET 'https://api.example.com/user/profile' EXPECT status 200
|
|
149
|
-
4. VERIFY EMAIL to 'test@domain.com' subject 'Welcome'
|
|
150
|
-
|
|
151
|
-
# Device Simulation
|
|
152
|
-
5. Set network to offline
|
|
153
|
-
6. Set battery level to 20
|
|
150
|
+
# Visual regression testing against gold baseline images
|
|
151
|
+
npx prompttest run specs/flow.txt --save-baseline
|
|
152
|
+
npx prompttest run specs/flow.txt --compare-baseline --baseline-threshold=0.02
|
|
154
153
|
```
|
|
155
154
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
## π₯ CLI Usage
|
|
159
|
-
|
|
160
|
-
### Run a Test Spec
|
|
155
|
+
### Autonomous State-Graph Explorer (`explore`)
|
|
161
156
|
|
|
162
157
|
```bash
|
|
163
|
-
#
|
|
164
|
-
npx prompttest
|
|
158
|
+
# Autonomous exploration with Strict safety policy
|
|
159
|
+
npx prompttest explore <package>
|
|
165
160
|
|
|
166
|
-
#
|
|
167
|
-
npx prompttest
|
|
168
|
-
|
|
169
|
-
# Run data-driven iterations
|
|
170
|
-
npx prompttest run specs/checkout.txt host.exp.exponent --iterations 5 --only-row 2
|
|
161
|
+
# Set custom screen discovery and step interaction limits
|
|
162
|
+
npx prompttest explore <package> --max-screens=30 --step-budget=60
|
|
171
163
|
|
|
172
|
-
#
|
|
173
|
-
npx prompttest
|
|
164
|
+
# Protect custom sensitive action keywords from being clicked
|
|
165
|
+
npx prompttest explore <package> --safety-blacklist="Wipe,Revoke,Transfer"
|
|
174
166
|
```
|
|
175
167
|
|
|
176
|
-
###
|
|
177
|
-
|
|
178
|
-
| Flag | Description |
|
|
179
|
-
| :--------------------------------------- | :-------------------------------------------------------------------------- |
|
|
180
|
-
| `--fresh` | Force-stops and restarts target app before test begins. |
|
|
181
|
-
| `--device-pool <d1,d2>` | Executes against the first available device from pool using atomic locking. |
|
|
182
|
-
| `--device-timeout-secs <n>` | Maximum seconds to wait for a free device lock (default: 60s). |
|
|
183
|
-
| `--iterations <n>` | Executes spec across N dynamic data iterations. |
|
|
184
|
-
| `--only-row <n>` | Filters execution to a specific 1-indexed data row. |
|
|
185
|
-
| `--continue` / `--continue-on-failure` | Continues running remaining steps after failure instead of fast-failing. |
|
|
186
|
-
| `--screenshots <all\|failure\|none>` | Controls screenshot capture policy (default: `failure`). |
|
|
187
|
-
| `--save-baseline` / `--update-baselines` | Saves gold reference baseline images for visual regression. |
|
|
188
|
-
| `--compare-baseline` | Compares execution screens against reference baseline. |
|
|
189
|
-
| `--baseline-threshold <n>` | Sets allowable perceptual diff tolerance (e.g. 0.02 = 2%). |
|
|
190
|
-
| `--format <html,json,junit,markdown>` | Comma-separated output report formats. |
|
|
191
|
-
| `-s <serial>` | Targets a specific connected device serial. |
|
|
192
|
-
| `--version` / `-v` | Prints current PromptTest version. |
|
|
193
|
-
|
|
194
|
-
### Other Commands
|
|
168
|
+
### Interactive Record & Replay (`record`)
|
|
195
169
|
|
|
196
170
|
```bash
|
|
197
|
-
#
|
|
198
|
-
npx prompttest
|
|
199
|
-
|
|
200
|
-
# Disconnect wireless device
|
|
201
|
-
npx prompttest disconnect
|
|
202
|
-
|
|
203
|
-
# Interactive record-and-play session
|
|
204
|
-
npx prompttest record specs/login.txt
|
|
205
|
-
|
|
206
|
-
# Inspect foreground app and active components on screen
|
|
207
|
-
npx prompttest status
|
|
208
|
-
|
|
209
|
-
# Run comprehensive environment and ADB readiness diagnostics
|
|
210
|
-
npx prompttest doctor
|
|
211
|
-
|
|
212
|
-
# Start interactive live REPL sandbox for prototyping test steps
|
|
213
|
-
npx prompttest repl
|
|
214
|
-
|
|
215
|
-
# Merge multi-device test results and generate Atto-inspired release confidence dashboard
|
|
216
|
-
npx prompttest merge-reports output
|
|
217
|
-
|
|
218
|
-
# Automatically crawl and map the app (Autonomous State-Graph Crawler v3)
|
|
219
|
-
npx prompttest explore host.exp.exponent
|
|
220
|
-
|
|
221
|
-
# Run autonomous crawl with strict safety policy and custom domain blacklist
|
|
222
|
-
npx prompttest explore host.exp.exponent --safety-mode=strict --safety-blacklist="Transfer,Revoke,Publish"
|
|
223
|
-
|
|
224
|
-
# Deep exploration with custom screen/step budgets and lazy failure-only screenshots
|
|
225
|
-
npx prompttest explore host.exp.exponent --max-screens=30 --step-budget=60 --screenshots=failure-only
|
|
226
|
-
|
|
227
|
-
# View learned component aliases & confidence
|
|
228
|
-
npx prompttest memory host.exp.exponent
|
|
229
|
-
|
|
230
|
-
# Generate GitHub Actions CI workflow
|
|
231
|
-
npx prompttest init-ci
|
|
171
|
+
# Record gestures, taps, and inputs directly on device into a spec
|
|
172
|
+
npx prompttest record specs/recorded_flow.txt
|
|
232
173
|
```
|
|
233
174
|
|
|
234
|
-
###
|
|
235
|
-
|
|
236
|
-
| Flag | Default | Description | Example |
|
|
237
|
-
| :------------------------- | :------------- | :----------------------------------------------------------------------------------------------------------------- | :--------------------------------- |
|
|
238
|
-
| `--safety-mode=<mode>` | `strict` | Policy level: `strict` (all deletions blocked), `moderate` (drafts permitted), `interactive` (prompts), `disabled` | `--safety-mode=moderate` |
|
|
239
|
-
| `--safety-blacklist="..."` | `[]` | Comma-separated custom keywords to protect as destructive actions | `--safety-blacklist="Revoke,Wipe"` |
|
|
240
|
-
| `--max-screens=N` | `20` | Maximum unique screen states to discover and index | `--max-screens=50` |
|
|
241
|
-
| `--max-depth=N` | `3` | Maximum recursion depth for nested screen diving | `--max-depth=5` |
|
|
242
|
-
| `--step-budget=N` | `40` | Total interaction steps before completing exploration | `--step-budget=100` |
|
|
243
|
-
| `--screenshots=<mode>` | `state-change` | Image capture policy: `state-change`, `failure-only`, or `all` | `--screenshots=failure-only` |
|
|
244
|
-
| `-s <serial>` | auto | Target specific connected device serial | `-s GEVKDEUWOJWC89OR` |
|
|
245
|
-
|
|
246
|
-
### CLI Execution Flags (`run`)
|
|
247
|
-
|
|
248
|
-
| Flag | Description | Example |
|
|
249
|
-
| :--------------- | :----------------------------------------------------------- | :----------------------------------------------- |
|
|
250
|
-
| `--dry-run` | Validates and parses spec steps with 0 device execution | `prompttest run specs/flow.txt --dry-run` |
|
|
251
|
-
| `--list-steps` | Prints a formatted table of all parsed steps in the spec | `prompttest run specs/flow.txt --list-steps` |
|
|
252
|
-
| `--only=<range>` | Executes only specific step numbers or ranges (e.g. `2-5,8`) | `prompttest run specs/flow.txt --only="1-3,5"` |
|
|
253
|
-
| `--tags=<tags>` | Filters execution by tags declared via `# @tag: <name>` | `prompttest run specs/flow.txt --tags="smoke"` |
|
|
254
|
-
| `--json` | Outputs machine-readable run summary JSON to stdout | `prompttest run specs/flow.txt --json` |
|
|
255
|
-
| `--benchmark` | Profiles and logs execution duration for each step | `prompttest run specs/flow.txt --benchmark` |
|
|
256
|
-
| `--watch` | Watches spec file for changes and re-executes automatically | `prompttest run specs/flow.txt --watch` |
|
|
257
|
-
| `--fresh` | Force-stops and restarts target app before execution | `prompttest run specs/flow.txt --fresh` |
|
|
258
|
-
| `--all-devices` | Concurrently executes spec across all connected devices | `prompttest run specs/flow.txt --all-devices` |
|
|
259
|
-
| `--continue` | Continues executing remaining steps if a step fails | `prompttest run specs/flow.txt --continue` |
|
|
260
|
-
| `--var:K=V` | Injects runtime variable overrides into the test context | `prompttest run specs/flow.txt --var:USER=Alice` |
|
|
175
|
+
### Device Management & Wi-Fi Debugging
|
|
261
176
|
|
|
262
|
-
|
|
177
|
+
```bash
|
|
178
|
+
# List all connected devices, emulators, and serial numbers
|
|
179
|
+
npx prompttest devices
|
|
263
180
|
|
|
264
|
-
|
|
181
|
+
# Connect to physical device wirelessly over Wi-Fi
|
|
182
|
+
npx prompttest wifi 192.168.1.50
|
|
265
183
|
|
|
266
|
-
|
|
184
|
+
# Inspect active screen hierarchy and detected components
|
|
185
|
+
npx prompttest status
|
|
267
186
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
docker build -t prompttest .
|
|
187
|
+
# Run comprehensive environment diagnostic check
|
|
188
|
+
npx prompttest doctor
|
|
271
189
|
|
|
272
|
-
#
|
|
273
|
-
|
|
274
|
-
-v $(pwd)/specs:/app/specs \
|
|
275
|
-
-v $(pwd)/output:/app/output \
|
|
276
|
-
prompttest run specs/my_suite.txt com.example.app
|
|
190
|
+
# View offline learned component memory graph
|
|
191
|
+
npx prompttest memory <package>
|
|
277
192
|
```
|
|
278
193
|
|
|
279
194
|
---
|
|
280
195
|
|
|
281
|
-
##
|
|
282
|
-
|
|
283
|
-
```mermaid
|
|
284
|
-
flowchart TD
|
|
285
|
-
A[Plain-English Spec .txt] --> B[DSL Parser & Tokenizer]
|
|
286
|
-
B --> C[PromptRunner Engine]
|
|
287
|
-
C --> D{Expectation Poller}
|
|
288
|
-
D -->|Match Found| E[ADB Fast Native Driver]
|
|
289
|
-
D -->|Not Found| F[Pre-Fail Triage / Auto-Scroll]
|
|
290
|
-
F -->|Recovered| E
|
|
291
|
-
F -->|Failed| G[Diagnostic Blackbox Snapshot]
|
|
292
|
-
E --> H[Screen Execution & Settle]
|
|
293
|
-
H --> I[Autonomous Knowledge Memory Engine]
|
|
294
|
-
I --> J[Markdown & JSON QA Reports]
|
|
295
|
-
```
|
|
196
|
+
## π― Mode Expectations & Limits
|
|
296
197
|
|
|
297
|
-
|
|
198
|
+
To maintain honest expectations, here is what PromptTest excels at and its architectural boundaries:
|
|
298
199
|
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
200
|
+
| Capability | Supported? | Notes |
|
|
201
|
+
| :--- | :---: | :--- |
|
|
202
|
+
| **Standard UI Apps** | β
Full | React Native, Expo, Flutter, Native Views, Jetpack Compose. |
|
|
203
|
+
| **Zero Code Changes** | β
Full | Operates 100% via native ADB hierarchy stream (`uiautomator dump`). |
|
|
204
|
+
| **Self-Healing** | β
Full | Auto-resolves modified counts and labels dynamically. |
|
|
205
|
+
| **Bottom-Tab Discovery** | β
Full | Explores hubs, nested master-detail views, and backtracks cleanly. |
|
|
206
|
+
| **Game Engines & Canvas**| β οΈ Limited | Fully custom OpenGL/Vulkan/Unity games lack accessible UI nodes. |
|
|
207
|
+
| **Biometrics / OS Dialogs**| β οΈ Limited | System-level biometric prompts require hardware-level mocks. |
|
|
303
208
|
|
|
304
209
|
---
|
|
305
210
|
|
|
306
|
-
##
|
|
211
|
+
## π» Programmatic TypeScript SDK
|
|
307
212
|
|
|
308
|
-
|
|
213
|
+
PromptTest exports a full programmatic SDK for embedding into Node.js test runners or custom CI scripts:
|
|
309
214
|
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
| **Teacher Role Suite** | 36 | 36 | 0 | **100%** | 64.0s |
|
|
313
|
-
| **Student Role Suite** | 24 | 24 | 0 | **100%** | 44.6s |
|
|
314
|
-
| **Total Benchmark** | **60** | **60** | **0** | **100%** | **108.6s** |
|
|
215
|
+
```typescript
|
|
216
|
+
import { createPromptRunner, createAndroidDriver } from 'prompttest';
|
|
315
217
|
|
|
316
|
-
|
|
218
|
+
// Initialize native ADB driver for connected device
|
|
219
|
+
const driver = createAndroidDriver('DEVICE_SERIAL');
|
|
220
|
+
const runner = createPromptRunner(driver);
|
|
317
221
|
|
|
318
|
-
|
|
222
|
+
// Execute spec and retrieve structured execution report
|
|
223
|
+
const report = await runner.runSpec('specs/login.txt', 'com.example.app', {
|
|
224
|
+
fresh: true,
|
|
225
|
+
screenshots: 'failure-only',
|
|
226
|
+
});
|
|
319
227
|
|
|
320
|
-
|
|
321
|
-
prompttest/
|
|
322
|
-
βββ bin/
|
|
323
|
-
β βββ prompttest.ts # CLI Entrypoint & Argument Router
|
|
324
|
-
βββ constants/
|
|
325
|
-
β βββ commands.ts # ADB Commands & Keycode Constants
|
|
326
|
-
βββ docs/
|
|
327
|
-
β βββ ACTION_ITEMS.md # Working fix backlog (Phase 23 findings)
|
|
328
|
-
β βββ MODE_EXPECTATIONS.md # Realistic capabilities, limits & boundaries per mode
|
|
329
|
-
β βββ ARCHITECTURE.md # System Architecture & Design
|
|
330
|
-
β βββ USER_MANUAL.md # Comprehensive User Guide
|
|
331
|
-
β βββ adr/ # Architecture Decision Records
|
|
332
|
-
β βββ IMPLEMENTATION_PLAN.md
|
|
333
|
-
βββ lib/
|
|
334
|
-
β βββ adb.ts # ADB Interface & Streaming Driver
|
|
335
|
-
β βββ baseline.ts # Visual Baseline Diffing & Masking
|
|
336
|
-
β βββ checkpoint.ts # Test Progress Checkpointing
|
|
337
|
-
β βββ config.ts # Configuration Constants
|
|
338
|
-
β βββ crawler.ts # Visual Defect Detection & Screen Crawling
|
|
339
|
-
β βββ data-loader.ts # Data-Driven Iterations & Dynamic Generators
|
|
340
|
-
β βββ dictionary.ts # UI Taxonomy & Intent Dictionary
|
|
341
|
-
β βββ explorer.ts # Autonomous Exploration Graph
|
|
342
|
-
β βββ form-filler.ts # Smart Form Filling Engine
|
|
343
|
-
β βββ live-monitor.ts # Real-Time Event Streaming Server
|
|
344
|
-
β βββ lock.ts # File-Locking Device Leasing Mutex
|
|
345
|
-
β βββ logger.ts # Structured Logging
|
|
346
|
-
β βββ memory.ts # Persistent Knowledge & Fast-Forward Engine
|
|
347
|
-
β βββ patterns.ts # Plain-English Grammar Parser
|
|
348
|
-
β βββ prompt-runner.ts # Orchestration Engine (<1000 lines)
|
|
349
|
-
β βββ recorder.ts # Autonomous Record & Replay
|
|
350
|
-
β βββ reporter.ts # Multi-Format Report Generator (HTML/JSON/JUnit)
|
|
351
|
-
β βββ runner-utils.ts # AST Parsing, Modular Includes, Diagnostic Errors
|
|
352
|
-
β βββ step-handlers.ts # Decoupled Step Execution Handlers
|
|
353
|
-
βββ memory/ # Autonomous Learned Knowledge Mappings
|
|
354
|
-
βββ output/ # Generated Test Reports & Artifacts
|
|
355
|
-
βββ specs/ # Plain-English Test Specification Files
|
|
356
|
-
βββ tests/ # Vitest Automated Test Suites
|
|
357
|
-
βββ index.ts # Programmatic API Entrypoint
|
|
358
|
-
βββ package.json
|
|
359
|
-
βββ tsconfig.json
|
|
360
|
-
βββ CONTRIBUTING.md
|
|
361
|
-
βββ LICENSE
|
|
362
|
-
βββ README.md
|
|
228
|
+
console.log(`Execution complete: ${report.passedSteps}/${report.totalSteps} passed.`);
|
|
363
229
|
```
|
|
364
230
|
|
|
365
231
|
---
|
|
366
232
|
|
|
367
|
-
##
|
|
368
|
-
|
|
369
|
-
You can use PromptTest programmatically within your own Node.js scripts using the unified `DriverInterface`:
|
|
233
|
+
## π³ Docker Container Deployment
|
|
370
234
|
|
|
371
|
-
|
|
372
|
-
import { createPromptRunner, createAndroidDriver, createIosDriver } from 'prompttest';
|
|
235
|
+
PromptTest is containerized with Android platform-tools and headless runtime support:
|
|
373
236
|
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
const androidReport = await androidRunner.runSpec('specs/login.txt', 'com.example.app');
|
|
237
|
+
```bash
|
|
238
|
+
# Build container image
|
|
239
|
+
docker build -t prompttest .
|
|
378
240
|
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
241
|
+
# Execute test spec inside container sharing host ADB daemon
|
|
242
|
+
docker run --rm --net=host \
|
|
243
|
+
-v $(pwd)/specs:/app/specs \
|
|
244
|
+
-v $(pwd)/output:/app/output \
|
|
245
|
+
prompttest run specs/flow.txt com.example.app
|
|
383
246
|
```
|
|
384
247
|
|
|
385
248
|
---
|
|
386
249
|
|
|
387
|
-
##
|
|
388
|
-
|
|
389
|
-
- `LOG_LEVEL`: Controls the verbosity of logs. Set to `DEBUG`, `INFO`, `WARN`, `ERROR`, or `SILENT`.
|
|
390
|
-
- `PROMPTTEST_DATA`: Overrides the default directory for PromptTest artifacts, memory, and outputs.
|
|
250
|
+
## π Proven Real-Device Benchmarks
|
|
391
251
|
|
|
392
|
-
|
|
252
|
+
Tested and verified against live physical Android devices running complex multi-role enterprise apps:
|
|
393
253
|
|
|
394
|
-
|
|
254
|
+
| Test Suite | Total Steps | Passed | Failed | Pass Rate | Execution Time |
|
|
255
|
+
| :--- | :---: | :---: | :---: | :---: | :---: |
|
|
256
|
+
| **CoachConnect Enterprise Suite** | 52 | 52 | 0 | **100%** | 47.8s |
|
|
257
|
+
| **Govindam Multilingual Suite** | 8 | 8 | 0 | **100%** | 35.1s |
|
|
258
|
+
| **Calculator Operations Suite** | 5 | 5 | 0 | **100%** | 19.6s |
|
|
259
|
+
| **Automated Vitest Test Matrix** | 294 | 294 | 0 | **100%** | 14.8s |
|
|
395
260
|
|
|
396
|
-
|
|
261
|
+
*For deep architectural details and driver design, see `docs/ARCHITECTURE.md` included in the package.*
|
|
397
262
|
|
|
398
263
|
---
|
|
399
264
|
|
|
400
265
|
## π License
|
|
401
266
|
|
|
402
|
-
|
|
267
|
+
PromptTest is licensed under the **Business Source License 1.1 (BSL 1.1)**:
|
|
268
|
+
|
|
269
|
+
- **Free for Community Use**: 100% free for educational use, individual developers, open-source projects, and startups/businesses with under $100,000 in annual revenue.
|
|
270
|
+
- **Commercial License**: Required for organizations exceeding the annual revenue threshold or companies wrapping PromptTest into hosted cloud services.
|
|
271
|
+
- Commercial inquiries and enterprise licensing: `jairam.singh9@gmail.com`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prompttest",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"description": "Ultra-fast, zero-code autonomous mobile testing & visual QA brain for Android",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"type": "module",
|
|
@@ -49,7 +49,6 @@
|
|
|
49
49
|
"prepublishOnly": "npm run typecheck && npm run build",
|
|
50
50
|
"pack:check": "npm pack --dry-run",
|
|
51
51
|
"preversion": "npm run typecheck && npm test",
|
|
52
|
-
"postversion": "git push && git push --tags",
|
|
53
52
|
"version:patch": "npm version patch",
|
|
54
53
|
"version:minor": "npm version minor",
|
|
55
54
|
"version:major": "npm version major"
|