prompttest 1.3.4 → 1.4.0
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/LICENSE +6 -0
- package/README.md +129 -13
- package/TERMS.md +134 -0
- package/dist/bin/prompttest.js +329 -190
- package/dist/bin/server.d.ts +1 -0
- package/dist/engine.bundle.js +999 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +283 -146
- package/dist/lib/adb-provisioner.d.ts +55 -0
- package/dist/lib/adb.d.ts +28 -0
- package/dist/lib/baseline.d.ts +52 -4
- package/dist/lib/dfs-engine.d.ts +43 -0
- package/dist/lib/explorer.d.ts +44 -0
- package/dist/lib/feedback.d.ts +35 -0
- package/dist/lib/live-server.d.ts +5 -0
- package/dist/lib/recorder.d.ts +24 -0
- package/dist/lib/reporter.d.ts +2 -0
- package/dist/lib/triage.d.ts +50 -0
- package/dist/lib/wizard.d.ts +42 -0
- package/dist/lib/zip-util.d.ts +36 -0
- package/package.json +14 -2
package/LICENSE
CHANGED
|
@@ -34,3 +34,9 @@ Apache License, Version 2.0
|
|
|
34
34
|
Notice:
|
|
35
35
|
For commercial licensing inquiries, enterprise agreements, or custom SLAs, contact:
|
|
36
36
|
PromptTest (https://github.com/shriramsingh/promptTest)
|
|
37
|
+
|
|
38
|
+
Scope Notice:
|
|
39
|
+
This License applies solely to the Licensed Work identified above (the PromptTest
|
|
40
|
+
command-line interface, SDK, and associated engine). PromptTest Studio and any other
|
|
41
|
+
PromptTest-branded products or services are separate products governed by their own
|
|
42
|
+
license agreements and are NOT licensed under this License.
|
package/README.md
CHANGED
|
@@ -53,6 +53,8 @@ You can run PromptTest instantly with `npx` or install it as a dev dependency:
|
|
|
53
53
|
npm install --save-dev prompttest
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
+
> **⚖️ Licensing note**: PromptTest is source-available under **BSL 1.1** — free for personal, educational, open-source, and small-team use (< $100k revenue *and* < 10 employees). Larger organizations and commercial QA agencies need a [commercial license](#-license). It converts to Apache 2.0 in 2030. See [License](#-license).
|
|
57
|
+
|
|
56
58
|
---
|
|
57
59
|
|
|
58
60
|
### 5 Core CLI Workflows
|
|
@@ -281,18 +283,121 @@ npx prompttest memory <package>
|
|
|
281
283
|
|
|
282
284
|
---
|
|
283
285
|
|
|
284
|
-
## 🎯
|
|
286
|
+
## 🎯 Platform Support, Expectations & Boundaries
|
|
285
287
|
|
|
286
|
-
To maintain honest expectations, here is what PromptTest
|
|
288
|
+
To maintain honest expectations, here is what PromptTest currently supports, what is under active development, and its architectural boundaries:
|
|
287
289
|
|
|
288
|
-
|
|
|
290
|
+
| Platform / Framework | Supported? | Notes |
|
|
289
291
|
| :--- | :---: | :--- |
|
|
290
|
-
| **
|
|
291
|
-
| **
|
|
292
|
-
| **
|
|
293
|
-
| **
|
|
294
|
-
| **
|
|
295
|
-
| **
|
|
292
|
+
| **Android (Physical & Emulators)** | **✅ Production Ready** | React Native, Expo, Flutter, Native Views, Jetpack Compose. |
|
|
293
|
+
| **iOS / iPhone & iPad** | **🚧 Under Development** | Native iOS engine is in active development; not supported in v1.3.x. |
|
|
294
|
+
| **Websites / Desktop Browsers** | **❌ Not Supported** | Dedicated strictly to mobile apps. For web, use Playwright or Cypress. |
|
|
295
|
+
| **Standard UI Hierarchy** | **✅ Full** | Operates 100% via native ADB hierarchy stream (`uiautomator dump`). |
|
|
296
|
+
| **Self-Healing Dynamic Locators** | **✅ Full** | Auto-resolves modified counts and labels dynamically via `--heal`. |
|
|
297
|
+
| **Bottom-Tab Discovery** | **✅ Full** | Explores hubs, nested master-detail views, and backtracks cleanly. |
|
|
298
|
+
| **Game Engines & Canvas** | **⚠️ Not Supported** | Fully custom OpenGL/Vulkan/Unity games lack accessible UI nodes. |
|
|
299
|
+
| **Biometrics / OS Dialogs** | **⚠️ Limited** | System-level biometric prompts require hardware-level mocks. |
|
|
300
|
+
|
|
301
|
+
---
|
|
302
|
+
|
|
303
|
+
## ⚠️ Common Pitfalls & How to Solve Them
|
|
304
|
+
|
|
305
|
+
### 1. Hardware Back Button Minimizing the App
|
|
306
|
+
* **What happens**: Running `Press back` while on the app's root dashboard or home tab tells the Android OS to minimize or exit the app.
|
|
307
|
+
* **How to solve it**:
|
|
308
|
+
- In specs, tap the in-app back icon/button (e.g. `Tap 'Back'` or `Tap '<'`) instead of the hardware key on top-level screens.
|
|
309
|
+
- In autonomous exploration (`explore`), PromptTest's built-in **Package Jail Guard** automatically detects if the app was backgrounded and restores it.
|
|
310
|
+
- Add the `--fresh` flag when running specs to cold-start your app cleanly before tests.
|
|
311
|
+
|
|
312
|
+
### 2. Android OS Permission Dialogs ("Allow Notifications / Location")
|
|
313
|
+
* **What happens**: System dialogs belong to Android OS (`com.android.permissioncontroller`), not your app, and can appear unexpectedly on new installs.
|
|
314
|
+
* **How to solve it**:
|
|
315
|
+
- Use conditional handling in your spec:
|
|
316
|
+
```text
|
|
317
|
+
Tap 'While using the app' (if present)
|
|
318
|
+
Tap 'Allow' (if present)
|
|
319
|
+
```
|
|
320
|
+
- Or auto-grant permissions via ADB before running tests:
|
|
321
|
+
```bash
|
|
322
|
+
adb shell pm grant com.yourcompany.app android.permission.POST_NOTIFICATIONS
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
### 3. Off-Screen Items in Long Lists (FlatList / RecyclerView)
|
|
326
|
+
* **What happens**: Mobile frameworks only render visible items on screen to save memory. Elements located further down the page are not in the hierarchy yet.
|
|
327
|
+
* **How to solve it**:
|
|
328
|
+
- Scroll before tapping:
|
|
329
|
+
```text
|
|
330
|
+
Scroll down
|
|
331
|
+
Verify 'Save Changes' is visible
|
|
332
|
+
Tap 'Save Changes'
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
### 4. Layout Animations & Shimmer Settling
|
|
336
|
+
* **What happens**: Tapping an element during a layout animation or skeleton fade-in can cause touch coordinates to miss while elements shift.
|
|
337
|
+
* **How to solve it**:
|
|
338
|
+
- Add a brief settling pause: `Wait 500ms` or assert an anchor element first: `Verify 'Dashboard' is visible`.
|
|
339
|
+
- Disable animations on test devices to run tests 2x faster:
|
|
340
|
+
```bash
|
|
341
|
+
adb shell settings put global window_animation_scale 0
|
|
342
|
+
adb shell settings put global transition_animation_scale 0
|
|
343
|
+
adb shell settings put global animator_duration_scale 0
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
### 5. WebViews & In-App Browsers (OAuth & Payment Gateways)
|
|
347
|
+
* **What happens**: In-app web pages (like Google Sign-In or Stripe) expose rendered text to ADB, but not internal HTML DOM tags or CSS selectors.
|
|
348
|
+
* **How to solve it**:
|
|
349
|
+
- Use plain text matching (`Tap 'Sign in with Google'`). Deep DOM selector manipulation inside WebViews is not supported.
|
|
350
|
+
|
|
351
|
+
### 6. Multiple Devices Connected
|
|
352
|
+
* **What happens**: If a physical phone and an emulator are both plugged in, ADB doesn't know which one to target.
|
|
353
|
+
* **How to solve it**:
|
|
354
|
+
- Target a specific device serial using `--serial`:
|
|
355
|
+
```bash
|
|
356
|
+
npx prompttest run specs/login.txt com.app --serial=emulator-5554
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
---
|
|
360
|
+
|
|
361
|
+
## 💡 Pro-Tips & Best Practices
|
|
362
|
+
|
|
363
|
+
### 1. The "Record & Refine" Workflow
|
|
364
|
+
* `prompttest record` captures your natural physical device interactions and generates plain-English test steps in real time—scaffolding 90% of your test boilerplate in seconds.
|
|
365
|
+
* **QA Best Practice**: After recording, do a quick 30-second review of the generated `.txt` spec to fine-tune timings or add custom `Verify` assertions.
|
|
366
|
+
* Preview without touching your device:
|
|
367
|
+
```bash
|
|
368
|
+
npx prompttest run specs/flow.txt --dry-run
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
### 2. Deterministic Clean States (`--fresh`)
|
|
372
|
+
* Prevent "already-logged-in" test pollution by adding `--fresh` to cold-start the target app before execution:
|
|
373
|
+
```bash
|
|
374
|
+
npx prompttest run specs/login.txt com.yourcompany.app --fresh
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
### 3. Zero-Maintenance Dynamic Badges (`--heal`)
|
|
378
|
+
* When notification badges or counts change dynamically (e.g. `'Cart (1)'` vs `'Cart (3)'`), pass `--heal` to allow PromptTest's heuristic engine to self-heal the locator without failing.
|
|
379
|
+
|
|
380
|
+
### 4. Device & Screen Resolution Agnostic Portability
|
|
381
|
+
* PromptTest binds interactions to semantic accessibility labels and proportional gestures—not fragile hardware pixel coordinates. Specs recorded on a phone seamlessly run on foldables and tablets.
|
|
382
|
+
|
|
383
|
+
### 5. 🛡️ Enterprise Safety Guardrails & Custom Blacklists
|
|
384
|
+
Autonomous exploration is safe by default, but enterprise applications often have company-specific sensitive keywords (e.g. *"Deactivate"*, *"Transfer Funds"*, *"Revoke Access"*).
|
|
385
|
+
|
|
386
|
+
* **Default Protection**: PromptTest automatically detects and blocks destructive actions like `"Delete"`, `"Wipe"`, `"Remove"`, and `"Discard Changes"`.
|
|
387
|
+
* **Add Your Own Sensitive Keywords**: You can supply your own custom blocked keywords to run **alongside** the defaults:
|
|
388
|
+
```bash
|
|
389
|
+
# Via CLI flag:
|
|
390
|
+
npx prompttest explore com.yourcompany.app --safety-blacklist="Transfer,Deactivate,Revoke,Unsubscribe"
|
|
391
|
+
```
|
|
392
|
+
* **Or configure once in `.prompttestrc.json`**:
|
|
393
|
+
```json
|
|
394
|
+
{
|
|
395
|
+
"safety": {
|
|
396
|
+
"mode": "strict",
|
|
397
|
+
"customBlacklist": ["Transfer", "Deactivate", "Revoke", "Unsubscribe"]
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
```
|
|
296
401
|
|
|
297
402
|
---
|
|
298
403
|
|
|
@@ -352,8 +457,19 @@ Tested and verified against live physical Android devices running complex multi-
|
|
|
352
457
|
|
|
353
458
|
## 📄 License
|
|
354
459
|
|
|
355
|
-
PromptTest is licensed under the **Business Source License 1.1 (BSL 1.1)
|
|
460
|
+
PromptTest is licensed under the **Business Source License 1.1 (BSL 1.1)**, and automatically converts to the permissive **Apache License 2.0** on the Change Date: **September 14, 2030**.
|
|
461
|
+
|
|
462
|
+
**✅ Free to use — no license required for:**
|
|
463
|
+
- Personal, educational, academic, and open-source projects
|
|
464
|
+
- Evaluation use
|
|
465
|
+
- Internal software testing within organizations that have **both** under $100,000 USD in annual gross revenue **and** fewer than 10 employees
|
|
466
|
+
|
|
467
|
+
**💼 Commercial license required for:**
|
|
468
|
+
- Use within organizations exceeding either of the free-tier thresholds (revenue **or** headcount)
|
|
469
|
+
- Testing agencies providing commercial QA services to third-party clients
|
|
470
|
+
- Deployment into production commercial CI/CD pipelines
|
|
471
|
+
- Offering PromptTest (modified or unmodified) as a hosted or managed QA/cloud testing service
|
|
472
|
+
|
|
473
|
+
See the full [LICENSE](./LICENSE) and [Terms & Conditions](./TERMS.md) for exact terms.
|
|
356
474
|
|
|
357
|
-
|
|
358
|
-
- **Commercial License**: Required for organizations exceeding the annual revenue threshold or companies wrapping PromptTest into hosted cloud services.
|
|
359
|
-
- Commercial inquiries and enterprise licensing: `jairam.singh9@gmail.com`.
|
|
475
|
+
Commercial inquiries and enterprise licensing: `jairam.singh9@gmail.com` or open an issue at [github.com/shriramsingh/promptTest](https://github.com/shriramsingh/promptTest/issues).
|
package/TERMS.md
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# PromptTest Terms & Conditions
|
|
2
|
+
|
|
3
|
+
> **Status:** Draft for legal review. Have a qualified attorney review these terms
|
|
4
|
+
> before relying on them commercially. This document supplements — and does not
|
|
5
|
+
> replace — the [LICENSE](./LICENSE) (Business Source License 1.1).
|
|
6
|
+
|
|
7
|
+
Effective Date: 2026-09-20
|
|
8
|
+
Operator: PromptTest (Shriram Singh)
|
|
9
|
+
Contact: jairam.singh9@gmail.com
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 1. Definitions
|
|
14
|
+
|
|
15
|
+
- **"PromptTest CLI"** — the PromptTest command-line interface, SDK, and engine
|
|
16
|
+
distributed via npm under the BSL 1.1 license.
|
|
17
|
+
- **"PromptTest Studio"** — the PromptTest-branded web/desktop testing product with a
|
|
18
|
+
graphical user interface. Studio is a **separate commercial product** licensed under
|
|
19
|
+
its own agreement and is **not** governed by these terms or the BSL license.
|
|
20
|
+
- **"Commercial License"** — a paid license agreement signed with the Operator that
|
|
21
|
+
lifts the usage restrictions of the BSL 1.1 Additional Use Grant.
|
|
22
|
+
- **"License Key"** — a cryptographic token issued upon purchase that unlocks paid
|
|
23
|
+
tiers or removes free-tier usage limits.
|
|
24
|
+
|
|
25
|
+
## 2. Use Tiers
|
|
26
|
+
|
|
27
|
+
### 2.1 Free / Community Tier (BSL 1.1)
|
|
28
|
+
Use of the PromptTest CLI is free under the terms of the BSL 1.1 Additional Use Grant
|
|
29
|
+
for:
|
|
30
|
+
- Personal, educational, academic, and open-source purposes;
|
|
31
|
+
- Evaluation use; and
|
|
32
|
+
- Internal software testing within organizations with both (a) annual gross revenue
|
|
33
|
+
under $100,000 USD (or equivalent) and (b) fewer than 10 employees.
|
|
34
|
+
|
|
35
|
+
### 2.2 Commercial Tier
|
|
36
|
+
Organizations exceeding the free-tier thresholds, testing agencies providing QA
|
|
37
|
+
services to third parties, and production commercial CI/CD deployments require a
|
|
38
|
+
paid Commercial License. Contact the Operator for pricing and terms.
|
|
39
|
+
|
|
40
|
+
## 3. Acceptable Use
|
|
41
|
+
|
|
42
|
+
You agree **not** to:
|
|
43
|
+
1. Circumvent, bypass, or attempt to defeat any license-key validation, feature
|
|
44
|
+
gating, or usage limits in the PromptTest CLI or Studio.
|
|
45
|
+
2. Reverse-engineer, decompile, or extract source code, models, heuristics, or
|
|
46
|
+
proprietary logic from PromptTest Studio, except where such restriction is
|
|
47
|
+
prohibited by applicable law.
|
|
48
|
+
3. Use PromptTest against applications you do not own or lack explicit permission to
|
|
49
|
+
test, or in violation of any applicable law (including computer misuse and
|
|
50
|
+
unauthorized-access statutes).
|
|
51
|
+
4. Resell, sublicense, or redistribute PromptTest Studio or paid Commercial License
|
|
52
|
+
entitlements without written authorization.
|
|
53
|
+
5. Offer PromptTest (modified or unmodified) as a hosted, managed, or cloud testing
|
|
54
|
+
service to third parties (this mirrors the BSL 1.1 Hosting & Managed Service
|
|
55
|
+
Restriction).
|
|
56
|
+
6. Remove or obscure any license, copyright, or attribution notices.
|
|
57
|
+
|
|
58
|
+
## 4. Intellectual Property & Trademarks
|
|
59
|
+
|
|
60
|
+
- All rights, title, and interest in PromptTest, PromptTest Studio, and associated
|
|
61
|
+
documentation remain with the Operator.
|
|
62
|
+
- The names "PromptTest" and "PromptTest Studio," logos, and brand assets are
|
|
63
|
+
trademarks of the Operator. You may refer to PromptTest nominatively (e.g., in
|
|
64
|
+
tutorials or CI configurations), but you may not use the marks to brand a
|
|
65
|
+
competing product or imply endorsement.
|
|
66
|
+
- Nothing in these terms transfers ownership of any intellectual property.
|
|
67
|
+
|
|
68
|
+
## 5. License Keys & Paid Features
|
|
69
|
+
|
|
70
|
+
- License Keys are issued per organization/seat as specified in your order and are
|
|
71
|
+
non-transferable unless agreed in writing.
|
|
72
|
+
- Paid features unlocked by a License Key may be verified locally or require periodic
|
|
73
|
+
online validation; extended offline grace periods are available for air-gapped CI
|
|
74
|
+
environments on request.
|
|
75
|
+
- Sharing a License Key beyond its licensed scope is a material breach and will
|
|
76
|
+
terminate the license immediately.
|
|
77
|
+
|
|
78
|
+
## 6. Data & Privacy
|
|
79
|
+
|
|
80
|
+
- The PromptTest CLI operates 100% locally and collects no telemetry by default (see
|
|
81
|
+
[SECURITY.md](./SECURITY.md)).
|
|
82
|
+
- External LLM providers are strictly opt-in; you are responsible for the data you
|
|
83
|
+
choose to send to third-party providers.
|
|
84
|
+
- PromptTest Studio's data handling is described in its own privacy policy at the
|
|
85
|
+
time of its release.
|
|
86
|
+
|
|
87
|
+
## 7. Subscriptions, Billing & Refunds (Paid Products)
|
|
88
|
+
|
|
89
|
+
- Paid licenses and subscriptions are billed in advance per the pricing plan chosen
|
|
90
|
+
at purchase.
|
|
91
|
+
- Subscriptions renew automatically until cancelled; cancellation takes effect at the
|
|
92
|
+
end of the current billing period.
|
|
93
|
+
- Refunds are handled per the policy stated at the point of sale (default: 14-day
|
|
94
|
+
refund window for first-time purchases).
|
|
95
|
+
|
|
96
|
+
## 8. Support & Service Levels
|
|
97
|
+
|
|
98
|
+
- Free-tier users receive community support via GitHub Issues only.
|
|
99
|
+
- Commercial and Enterprise customers receive support per their signed agreement
|
|
100
|
+
(response SLAs are defined in SECURITY.md for vulnerabilities and in the Commercial
|
|
101
|
+
License for general support).
|
|
102
|
+
|
|
103
|
+
## 9. Disclaimers & Limitation of Liability
|
|
104
|
+
|
|
105
|
+
TO THE MAXIMUM EXTENT PERMITTED BY LAW, PROMPTTEST IS PROVIDED "AS IS" WITHOUT
|
|
106
|
+
WARRANTIES OF ANY KIND. THE OPERATOR IS NOT LIABLE FOR ANY INDIRECT, INCIDENTAL,
|
|
107
|
+
SPECIAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS OR DATA LOSS. TOTAL
|
|
108
|
+
AGGREGATE LIABILITY FOR PAID PRODUCTS IS LIMITED TO THE AMOUNTS PAID BY YOU IN THE
|
|
109
|
+
TWELVE (12) MONTHS PRECEDING THE CLAIM. (Note: this mirrors the BSL 1.1 warranty
|
|
110
|
+
disclaimer for the free CLI; negotiate specific terms in Commercial License
|
|
111
|
+
agreements.)
|
|
112
|
+
|
|
113
|
+
## 10. Termination
|
|
114
|
+
|
|
115
|
+
- Use in violation of the LICENSE or these terms terminates all rights immediately
|
|
116
|
+
(BSL 1.1 also terminates rights across all versions on violation).
|
|
117
|
+
- Upon termination, you must cease use and delete all copies of the Licensed Work.
|
|
118
|
+
|
|
119
|
+
## 11. Changes to These Terms
|
|
120
|
+
|
|
121
|
+
The Operator may update these terms; material changes will be announced via the
|
|
122
|
+
repository or the npm package notes at least 30 days before taking effect for
|
|
123
|
+
existing paid customers. Continued use after the effective date constitutes
|
|
124
|
+
acceptance.
|
|
125
|
+
|
|
126
|
+
## 12. Governing Law
|
|
127
|
+
|
|
128
|
+
These terms are governed by the laws of India (or the jurisdiction specified in your
|
|
129
|
+
Commercial License agreement), without regard to conflict-of-law rules.
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
*PromptTest Studio is developed and sold separately. This document does not grant
|
|
134
|
+
any rights to PromptTest Studio. See the Studio license agreement for details.*
|