๐ Table of Contents
๐ฏ Testing Overview
The fitness sensor testing framework provides three ways to run automated tests:
iOS App
Visual, interactive testing with real-time progress
EasiestPython Script
Command-line automation for CI/CD pipelines
Most FlexibleManual Control
Direct Matter commands for debugging
AdvancedWhat Gets Tested
- โ Intensity Changes - Smooth transitions between power zones
- โ BLE Broadcasting - Continuous data streaming to Zwift
- โ Matter Control - Remote command execution
- โ Edge Cases - Rapid changes, max/min values
- โ Duration Accuracy - Segment timing precision
- โ Value Stability - Consistent output at each intensity
๐๏ธ Available Test Scenarios
1. HIIT Intervals (30 minutes)
Purpose: Test rapid intensity changes and recovery
Profile: 4ร4min high intensity with 3min recovery
Warm-up (5m) โ Interval 1 (4m) โ Recovery (3m) โ
Interval 2 (4m) โ Recovery (3m) โ Interval 3 (4m) โ
Recovery (3m) โ Interval 4 (4m) โ Cool-down (5m)
Power Range: 115W - 327W
Heart Rate Range: 92 - 171 BPM
2. Endurance Ride (45 minutes)
Purpose: Test sustained steady-state output
Profile: Consistent moderate intensity
Warm-up (5m) โ Steady State (35m) โ Cool-down (5m)
Power Range: ~225W steady
Heart Rate Range: ~130 BPM steady
3. Recovery Spin (20 minutes)
Purpose: Test low-intensity baseline
Profile: Easy spin at minimal output
Easy Spin (20m)
Power Range: ~91W
Heart Rate Range: ~76 BPM
4. Pyramid Intervals (25 minutes)
Purpose: Test progressive intensity ramps
Profile: 1-2-3-2-1 minute intervals
Warm-up โ 1min โ Rest โ 2min โ Rest โ
3min โ Rest โ 2min โ Rest โ 1min โ Cool-down
Power Range: 115W - 350W
Heart Rate Range: 92 - 189 BPM
5. Tabata Protocol (4 minutes)
Purpose: Test maximum intensity sprints
Profile: 8ร(20s sprint, 10s rest)
Warm-up (2m) โ [20s max / 10s rest] ร 8 โ Cool-down (2m)
Power Range: 50W - 387W
Heart Rate Range: 60 - 197 BPM
View All 10 Test Scenarios โ
| Name | Duration | Purpose | Complexity |
|---|---|---|---|
| HIIT Intervals | 30m | Rapid changes | Medium |
| Endurance | 45m | Steady state | Easy |
| Recovery | 20m | Low intensity | Easy |
| Pyramids | 25m | Progressive ramps | Medium |
| Tabata | 4m | Max sprints | Hard |
| FTP Test | 25m | Threshold power | Medium |
| Warm-up | 10m | Gradual builds | Easy |
| Sweet Spot | 40m | Sub-threshold | Medium |
| VO2 Max | 30m | High intensity | Hard |
| Ramp Test | 15m | Progressive overload | Medium |
๐ฑ iOS App Testing
Getting Started
- Open FitnessSensorController app
- Tap your sensor from the device list
- Scroll down and tap "Test Workouts"
- Browse list of scenarios
Running a Workout
- Select any workout scenario
- Review segment breakdown
- Tap "Start Workout"
- Monitor real-time progress:
- Overall progress bar
- Current segment name
- Estimated power & HR
- Time remaining
- Use controls as needed:
- Pause - Temporarily stop
- Stop - End early
- Skip - Next segment
Example Progress Display
Overall: 45%
โโโโโโโโโโโโโโโโโโโโโ
13:30 / 16:30
Current: Interval 2
โโโโโโโโโโโโโโโโโโโโ
โก 327W | โค๏ธ 171 BPM
2:43 remaining
Quick Test Suite
Test all scenarios in 2 minutes:
- Tap "Test Workouts"
- Tap "Run Quick Test Suite"
- Wait ~2 minutes
- View results: โ 10/10 passed
๐ป Command Line Testing
Installation
# Install dependencies
pip install colorama tabulate
# Install Matter chip-tool (if not already installed)
# See: https://github.com/project-chip/connectedhomeip
Basic Usage
List Available Workouts
python test_automation.py --list
๐ Available Workout Scenarios:
intervals - HIIT Intervals
4x4 minute high intensity with recovery
Duration: 30:00, Segments: 9
endurance - Endurance Ride
Steady state for 45 minutes
Duration: 45:00, Segments: 3
...
Run a Specific Workout
# Run HIIT intervals
python test_automation.py --workout intervals
# Run Tabata with custom node ID
python test_automation.py --workout tabata --node-id 2
# Dry run (no commands sent)
python test_automation.py --workout ftp --dry-run
Quick Test All Scenarios
python test_automation.py --all
๐งช Running Quick Test Suite
Testing HIIT Intervals... โ
PASS
Testing Endurance Ride... โ
PASS
Testing Recovery Spin... โ
PASS
...
Test Results: 10/10 passed
Advanced Options
# Full command with all options
python test_automation.py \
--workout intervals \
--node-id 1 \
--endpoint 1 \
--verbose \
--dry-run
| Option | Description |
|---|---|
--workout, -w |
Workout name (intervals, endurance, etc.) |
--list, -l |
List all available workouts |
--all, -a |
Quick test all scenarios |
--custom, -c |
Load custom workout from JSON |
--node-id, -n |
Matter node ID (default: 1) |
--endpoint, -e |
Matter endpoint ID (default: 1) |
--dry-run, -d |
Simulate without sending commands |
--verbose, -v |
Detailed output |
๐จ Custom Workouts
JSON Format
Create a custom workout file (my_workout.json):
{
"name": "My Custom Workout",
"description": "Custom test scenario",
"segments": [
{
"name": "Warm-up",
"duration": 300,
"intensity": 100,
"notes": "5 minutes at low intensity"
},
{
"name": "Build Power",
"duration": 180,
"intensity": 120
},
{
"name": "Threshold",
"duration": 600,
"intensity": 180
},
{
"name": "Recovery",
"duration": 300,
"intensity": 70
},
{
"name": "Sprint",
"duration": 30,
"intensity": 254
},
{
"name": "Cool Down",
"duration": 300,
"intensity": 60
}
],
"metadata": {
"author": "Your Name",
"created": "2025-01-15"
}
}
Field Reference
| Field | Type | Required | Description |
|---|---|---|---|
name |
string | โ | Segment name |
duration |
integer | โ | Duration in seconds |
intensity |
integer | โ | Intensity level (0-254) |
notes |
string | โ | Optional description |
Intensity Mapping
| Intensity | Power | Heart Rate | Zone |
|---|---|---|---|
| 0 | 50W | 60 BPM | Recovery |
| 50 | 118W | 87 BPM | Easy |
| 100 | 187W | 115 BPM | Endurance |
| 127 | 225W | 130 BPM | Tempo (default) |
| 180 | 291W | 160 BPM | Threshold |
| 200 | 325W | 171 BPM | VO2 Max |
| 254 | 400W | 200 BPM | Sprint (max) |
Run Custom Workout
# Via Python script
python test_automation.py --custom my_workout.json
# Validate first
python test_automation.py --custom my_workout.json --dry-run
๐ฎ Zwift Integration Testing
Setup for Zwift Testing
- Start Sensor
python test_automation.py --workout warmup - Open Zwift and go to Settings โ Sensors
- Pair Sensors:
- Heart Rate: "Bike Sensor Matter"
- Power Meter: "Bike Sensor Matter"
- Start Riding in Zwift
- Run Test Workout
python test_automation.py --workout intervals
Validation Checklist
- Both sensors connect immediately
- Power updates every 1 second
- HR updates every 1 second
- No connection drops during workout
- Smooth transitions between segments
- Values match expected ranges
- Zwift avatar responds correctly
- No lag or delay in updates
๐ Performance Testing
Metrics to Track
| Metric | Target | Critical | How to Measure |
|---|---|---|---|
| Connection Time | <5s | <10s | Time from power-on to Zwift pairing |
| Update Rate | 1 Hz | >0.5 Hz | BLE notification frequency |
| Transition Time | <2s | <5s | Time to reach new intensity |
| Value Accuracy | ยฑ5% | ยฑ10% | Actual vs expected power/HR |
| Stability (1hr) | >99% | >95% | Success rate over time |
Running Performance Tests
# Test sustained load
python test_automation.py --workout endurance
# Test rapid changes
python test_automation.py --workout tabata
# Test all scenarios
python test_automation.py --all
๐ Troubleshooting
Common Issues
| Issue | Cause | Solution |
|---|---|---|
| Zwift doesn't see values changing | Sensor not enabled | Turn on sensor in iOS app |
| Python script fails | chip-tool not found | Install Matter SDK and chip-tool |
| Command timeout | Wrong node-id or device offline | Verify node-id, check device power |
| Inconsistent results | Network interference | Check Thread network stability |
| Segments don't transition | High Matter latency | Move closer to border router |
Next Steps
Ready to go deeper? Check out:
- Testing Integration Guide - Advanced workflows
- Complete System Guide - Full integration
- Quick Reference - Command cheat sheet