@testrelic/maestro-analytics 1.0.0-next.14
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 +108 -0
- package/dist/cli.cjs +4078 -0
- package/dist/index.cjs +1256 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +583 -0
- package/dist/index.d.ts +583 -0
- package/dist/index.js +1256 -0
- package/dist/index.js.map +1 -0
- package/dist/merge.cjs +3 -0
- package/dist/merge.cjs.map +1 -0
- package/dist/merge.d.cts +10 -0
- package/dist/merge.d.ts +10 -0
- package/dist/merge.js +3 -0
- package/dist/merge.js.map +1 -0
- package/package.json +81 -0
package/README.md
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# @testrelic/maestro-analytics
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@testrelic/maestro-analytics)
|
|
4
|
+
[](https://testrelic.ai)
|
|
5
|
+
|
|
6
|
+
Maestro mobile testing analytics for the [TestRelic](https://testrelic.ai) observability platform.
|
|
7
|
+
|
|
8
|
+
Wraps the Maestro CLI to capture rich test telemetry — JUnit results, step-level timing, screenshots, video, AI defect reports, and visual regression data — then uploads everything to the TestRelic dashboard.
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install @testrelic/maestro-analytics
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Quick Start
|
|
17
|
+
|
|
18
|
+
### Mode 1: CLI Wrapper (recommended)
|
|
19
|
+
|
|
20
|
+
Zero changes to your YAML flows. The wrapper runs Maestro with the right flags and reports results automatically.
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npx testrelic-maestro test ./flows
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Mode 2: Post-Run Parser
|
|
27
|
+
|
|
28
|
+
If you already run Maestro in CI, parse existing artifacts after the fact:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
maestro test --format junit --output report.xml --test-output-dir ./artifacts ./flows
|
|
32
|
+
npx testrelic-maestro report --junit report.xml --artifacts ./artifacts
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Cloud Reporting
|
|
36
|
+
|
|
37
|
+
Set the `TESTRELIC_API_KEY` environment variable or add it to `.testrelic/testrelic-config.json`:
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
{
|
|
41
|
+
"cloud": {
|
|
42
|
+
"apiKey": "${TESTRELIC_API_KEY}"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## What Gets Captured
|
|
48
|
+
|
|
49
|
+
| Data | Source |
|
|
50
|
+
|------|--------|
|
|
51
|
+
| Flow pass/fail/skip | JUnit XML |
|
|
52
|
+
| Per-step timing | commands-*.json |
|
|
53
|
+
| Assertions | commands-*.json |
|
|
54
|
+
| Screenshots | --test-output-dir |
|
|
55
|
+
| Video recordings | --test-output-dir |
|
|
56
|
+
| AI defect reports | --analyze output |
|
|
57
|
+
| Flow metadata | YAML header (appId, tags, properties) |
|
|
58
|
+
| Device/platform info | CLI output |
|
|
59
|
+
| CI/CD context | Environment detection |
|
|
60
|
+
| Git metadata | Local git |
|
|
61
|
+
|
|
62
|
+
## E2E Integration Test (Real Device Recording)
|
|
63
|
+
|
|
64
|
+
The `scripts/e2e-integration-test.mjs` script runs the sample flows in `e2e/flows/` against a real Android device or emulator and uploads the actual screen recordings to TestRelic.
|
|
65
|
+
|
|
66
|
+
### Prerequisites
|
|
67
|
+
|
|
68
|
+
1. **Maestro CLI** — install from [maestro.mobile.dev](https://maestro.mobile.dev):
|
|
69
|
+
```bash
|
|
70
|
+
curl -Ls "https://get.maestro.mobile.dev" | bash
|
|
71
|
+
```
|
|
72
|
+
2. **Android emulator or device** connected and visible in `adb devices`
|
|
73
|
+
3. **Wikipedia APK** installed on the device — download from [github.com/wikimedia/apps-android-wikipedia/releases](https://github.com/wikimedia/apps-android-wikipedia/releases):
|
|
74
|
+
```bash
|
|
75
|
+
adb install -r wikipedia.apk
|
|
76
|
+
```
|
|
77
|
+
4. **TESTRELIC_API_KEY** environment variable set (or `testrelic.config.yaml` present)
|
|
78
|
+
|
|
79
|
+
### Running
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
# Build the package first
|
|
83
|
+
pnpm build
|
|
84
|
+
|
|
85
|
+
# Start an Android emulator (if not already running)
|
|
86
|
+
emulator -avd <AVD_NAME>
|
|
87
|
+
|
|
88
|
+
# Run the real E2E test — captures actual screen recordings
|
|
89
|
+
node scripts/e2e-integration-test.mjs
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
The script prints a run URL at the end. Open it in your browser to verify:
|
|
93
|
+
- The video shows the **actual app screen recording** (not a placeholder clip)
|
|
94
|
+
- Each flow shows its **own recording** when selected in the sidebar
|
|
95
|
+
|
|
96
|
+
### Synthetic Test Scripts (pipeline validation only)
|
|
97
|
+
|
|
98
|
+
The other scripts in `scripts/` use placeholder/synthetic video data and do **not** run real device tests:
|
|
99
|
+
|
|
100
|
+
| Script | What it uploads |
|
|
101
|
+
|--------|----------------|
|
|
102
|
+
| `cloud-upload-test.mjs` | 32-byte stub MP4 (non-playable) |
|
|
103
|
+
| `cloud-realtime-test.mjs` | ffmpeg black frame or Big Buck Bunny sample |
|
|
104
|
+
| `e2e-integration-test.mjs` | **Real app screen recording** ← use this |
|
|
105
|
+
|
|
106
|
+
## License
|
|
107
|
+
|
|
108
|
+
MIT
|