ESP32 WiFi Test Specification
This skill provides a standard WiFi test suite for ESP32 projects. Tests are conditionally included based on detected project features.
Feature Detection Workflow
Before including tests, detect which features the project uses:
Step 1: Scan Project for Features
Search the FSD document and/or source code for these indicators:
| Feature |
Detection Patterns |
If Found, Include |
| WiFi STA |
WiFi.begin, esp_wifi_connect, "WiFi station", "STA mode" |
WIFI-001 to WIFI-007 |
| WiFi AP |
WiFi.softAP, esp_wifi_set_mode(WIFI_MODE_AP), "captive portal", "AP mode" |
AP-001 to AP-006, TC-300 |
| MQTT |
PubSubClient, esp_mqtt, mosquitto, "MQTT broker", "publish", "subscribe" |
WIFI-006, EC-101, EC-118 |
| OTA |
ArduinoOTA, esp_ota, httpUpdate, "firmware update", "OTA" |
TC-301, EC-114, EC-120 |
| Ethernet |
W5500, ETH.begin, esp_eth, "dual network", "Ethernet" |
TEST-001 to TEST-005, EC-100 |
| Watchdog |
esp_task_wdt, TWDT, "watchdog", "health check" |
EC-116 to EC-120 |
| NVS Config |
Preferences, nvs_, "NVS", "stored credentials" |
WIFI-002, EC-112 |
Step 2: Build Test Matrix
Based on detected features, include only relevant tests:
Detected: WiFi STA + MQTT + OTA + Watchdog
Include: WIFI-001 to WIFI-007, TC-301, EC-101, EC-114, EC-116 to EC-120
Detected: WiFi STA + AP (no MQTT)
Include: WIFI-001 to WIFI-005, AP-001 to AP-006, TC-300
Exclude: WIFI-006, EC-101, MQTT-related edge cases
Step 3: Customize and Insert
- Read
references/wifi-test-spec.md for test details
- Copy only the tests matching detected features
- Update project-specific values (see Customization Points below)
Test Categories
| Category |
Test IDs |
Required Feature |
| WiFi STA Requirements |
WIFI-001 to WIFI-005 |
WiFi STA (always if WiFi used) |
| MQTT-specific |
WIFI-006, WIFI-007 |
MQTT over WiFi |
| AP Requirements |
AP-001 to AP-006 |
Captive portal |
| Test Mode |
TEST-001 to TEST-005 |
Ethernet + WiFi |
| Captive Portal Test |
TC-300 |
AP mode |
| OTA Test |
TC-301 |
OTA updates |
| Network Disconnect |
EC-100, EC-101 |
Ethernet or MQTT |
| Signal/Congestion |
EC-110, EC-111 |
Any WiFi |
| Credential Change |
EC-112 |
NVS credentials |
| AP+STA Concurrent |
EC-113 |
AP fallback mode |
| OTA Resilience |
EC-114 |
OTA updates |
| DHCP |
EC-115 |
Any WiFi |
| Watchdog Tests |
EC-116 to EC-120 |
Watchdog enabled |
Customization Points
Update these project-specific values when copying tests:
| Placeholder |
Example |
Where Used |
PROJECT-{MAC_LAST_4} |
SENSOR-A1B2 |
AP SSID format |
192.168.1.1 |
192.168.4.1 |
AP gateway IP |
192.168.1.50:1883 |
Your broker |
MQTT broker address |
project/# |
sensor/data/# |
MQTT topic prefix |
5 seconds |
3 seconds |
CONFIG button hold time |
60s |
30s |
Watchdog timeout |
Reference
Complete test specifications with step-by-step procedures:
- Full Test Spec: See references/wifi-test-spec.md
Quick Reference: Minimal Sets
WiFi-Only Project (no MQTT, no OTA)
| ID | Requirement | Priority |
|----|-------------|----------|
| WIFI-001 | System SHALL connect to configured WiFi network in STA mode | Must |
| WIFI-002 | WiFi credentials SHALL be stored encrypted in NVS | Must |
| WIFI-003 | System SHALL automatically reconnect on WiFi disconnect | Must |
| WIFI-004 | System SHALL log WiFi connection status changes | Should |
| WIFI-005 | System SHALL support WPA2/WPA3 authentication | Must |
WiFi + MQTT Project
Add to above:
| WIFI-006 | MQTT client SHALL only use WiFi interface | Must |
| WIFI-007 | System SHALL sync time via NTP over WiFi | Should |
Plus edge cases: EC-101, EC-110, EC-111, EC-115
Full Feature Project (WiFi + MQTT + OTA + Watchdog)
Include all tests from references/wifi-test-spec.md
1---2name: esp32-wifi-tests3description: Include standard WiFi test cases in ESP32 Functional Specification Documents (FSDs). Use when creating or updating any ESP32 project FSD that involves WiFi connectivity, captive portal, MQTT over WiFi, or OTA updates. Triggers on "ESP32 FSD", "functional specification", "WiFi test cases", or when writing test requirements for ESP32 WiFi features.4---5
6# ESP32 WiFi Test Specification
7
8This skill provides a standard WiFi test suite for ESP32 projects. Tests are conditionally included based on detected project features.
9
10## Feature Detection Workflow
11
12**Before including tests, detect which features the project uses:**
13
14### Step 1: Scan Project for Features
15
16Search the FSD document and/or source code for these indicators:
17
18| Feature | Detection Patterns | If Found, Include |
19|---------|-------------------|-------------------|
20| **WiFi STA** | `WiFi.begin`, `esp_wifi_connect`, "WiFi station", "STA mode" | WIFI-001 to WIFI-007 |
21| **WiFi AP** | `WiFi.softAP`, `esp_wifi_set_mode(WIFI_MODE_AP)`, "captive portal", "AP mode" | AP-001 to AP-006, TC-300 |
22| **MQTT** | `PubSubClient`, `esp_mqtt`, `mosquitto`, "MQTT broker", "publish", "subscribe" | WIFI-006, EC-101, EC-118 |
23| **OTA** | `ArduinoOTA`, `esp_ota`, `httpUpdate`, "firmware update", "OTA" | TC-301, EC-114, EC-120 |
24| **Ethernet** | `W5500`, `ETH.begin`, `esp_eth`, "dual network", "Ethernet" | TEST-001 to TEST-005, EC-100 |
25| **Watchdog** | `esp_task_wdt`, `TWDT`, "watchdog", "health check" | EC-116 to EC-120 |
26| **NVS Config** | `Preferences`, `nvs_`, "NVS", "stored credentials" | WIFI-002, EC-112 |
27
28### Step 2: Build Test Matrix
29
30Based on detected features, include only relevant tests:
31
32```
33Detected: WiFi STA + MQTT + OTA + Watchdog
34Include: WIFI-001 to WIFI-007, TC-301, EC-101, EC-114, EC-116 to EC-120
35
36Detected: WiFi STA + AP (no MQTT)
37Include: WIFI-001 to WIFI-005, AP-001 to AP-006, TC-300
38Exclude: WIFI-006, EC-101, MQTT-related edge cases
39```
40
41### Step 3: Customize and Insert
42
431. Read `references/wifi-test-spec.md` for test details
442. Copy only the tests matching detected features
453. Update project-specific values (see Customization Points below)
46
47## Test Categories
48
49| Category | Test IDs | Required Feature |
50|----------|----------|------------------|
51| WiFi STA Requirements | WIFI-001 to WIFI-005 | WiFi STA (always if WiFi used) |
52| MQTT-specific | WIFI-006, WIFI-007 | MQTT over WiFi |
53| AP Requirements | AP-001 to AP-006 | Captive portal |
54| Test Mode | TEST-001 to TEST-005 | Ethernet + WiFi |
55| Captive Portal Test | TC-300 | AP mode |
56| OTA Test | TC-301 | OTA updates |
57| Network Disconnect | EC-100, EC-101 | Ethernet or MQTT |
58| Signal/Congestion | EC-110, EC-111 | Any WiFi |
59| Credential Change | EC-112 | NVS credentials |
60| AP+STA Concurrent | EC-113 | AP fallback mode |
61| OTA Resilience | EC-114 | OTA updates |
62| DHCP | EC-115 | Any WiFi |
63| Watchdog Tests | EC-116 to EC-120 | Watchdog enabled |
64
65## Customization Points
66
67Update these project-specific values when copying tests:
68
69| Placeholder | Example | Where Used |
70|-------------|---------|------------|
71| `PROJECT-{MAC_LAST_4}` | `SENSOR-A1B2` | AP SSID format |
72| `192.168.1.1` | `192.168.4.1` | AP gateway IP |
73| `192.168.1.50:1883` | Your broker | MQTT broker address |
74| `project/#` | `sensor/data/#` | MQTT topic prefix |
75| `5 seconds` | `3 seconds` | CONFIG button hold time |
76| `60s` | `30s` | Watchdog timeout |
77
78## Reference
79
80Complete test specifications with step-by-step procedures:
81
82- **Full Test Spec**: See [references/wifi-test-spec.md](references/wifi-test-spec.md)
83
84## Quick Reference: Minimal Sets
85
86### WiFi-Only Project (no MQTT, no OTA)
87
88```markdown
89| ID | Requirement | Priority |
90|----|-------------|----------|
91| WIFI-001 | System SHALL connect to configured WiFi network in STA mode | Must |
92| WIFI-002 | WiFi credentials SHALL be stored encrypted in NVS | Must |
93| WIFI-003 | System SHALL automatically reconnect on WiFi disconnect | Must |
94| WIFI-004 | System SHALL log WiFi connection status changes | Should |
95| WIFI-005 | System SHALL support WPA2/WPA3 authentication | Must |
96```
97
98### WiFi + MQTT Project
99
100Add to above:
101```markdown
102| WIFI-006 | MQTT client SHALL only use WiFi interface | Must |
103| WIFI-007 | System SHALL sync time via NTP over WiFi | Should |
104```
105
106Plus edge cases: EC-101, EC-110, EC-111, EC-115
107
108### Full Feature Project (WiFi + MQTT + OTA + Watchdog)
109
110Include all tests from `references/wifi-test-spec.md`