ESPSomfy-RTS/test/e2e
cjkas 657b345eaf fix: review fixes for the OTA slot
- The field is hasOtaSlot, like hasEthernet and the other "has" bools.
- The web UI shows the device's reason for any failed upload, not only
  for /restore, so it shows "no OTA slot" from a page that missed the
  header. The update routes' 500 replies give Update.errorString()
  instead of an empty reason.
- Native: the writer leaves hasOtaSlot out when true and writes "os":0.
- e2e: header() next to uptime(); the test skips on firmware without
  the field instead of failing, and matches the reason loosely. The
  README says what the test sends.
- PROTOCOL.md and the comments name only the builds that exist.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 22:19:27 +01:00
..
conftest.py fix: restore reads the options the web UI ticks 2026-10-28 21:02:39 +01:00
proto_client.py feat!: the token on every route, Secure Config Only goes (step 4b) 2026-10-27 23:03:59 +01:00
README.md fix: review fixes for the OTA slot 2026-10-28 22:19:27 +01:00
test_auth.py fix: review findings on the token key 2026-10-27 20:39:08 +01:00
test_commands.py feat: command ops for socket protocol 2 2026-10-24 13:42:41 +02:00
test_edits.py fix: edit ops second review findings 2026-10-24 18:29:34 +02:00
test_messages.py fix: protocol 2 core review findings 2026-10-24 13:17:15 +02:00
test_restore.py fix: refuse a restore with no part chosen 2026-10-28 21:19:22 +01:00
test_routes.py fix: review fixes for the OTA slot 2026-10-28 22:19:27 +01:00
test_settings.py fix: review fixes for the OTA slot 2026-10-28 22:19:27 +01:00
test_survival.py test(e2e): the slot tests fill the free slots 2026-10-27 22:24:48 +01:00
test_sync.py feat!: remove the old API, ports 8081 and 8080 (step 4a) 2026-10-27 21:49:38 +01:00

e2e suite

Runs against a real device on your network, by hand, never in CI. It checks socket protocol 2 (PROTOCOL.md) and that the device survives the loads that used to run its heap out.

~/.platformio/penv/Scripts/uv run --no-project --with pytest -- pytest test/e2e --device 192.168.1.120
Option Use
--device the device's address (required)
--password, --username / --pin the credentials of a Secured device
--radio --shade <id> also send real commands: that shade moves a little and back
--edit also add a room and delete it again
--reboot also reboot the device and wait for it to come back, and restore the settings from a backup taken a moment before (it changes the NTP server, which the restore puts back)
--lockout on a Secured device, also fail /login until this PC is refused, then wait out the 30 s lockout
--record save hello, the sync and the schema to test/fixtures/proto2/, for the web UI and Home Assistant tests

A plain run sends nothing on air, changes no setting (it saves only values the device already has) and doesn't reboot the device. The command tests send ops that are refused before they reach the radio, and one setPositions that sets a shade to the position the sync gave: that drops the fraction of a percent the shade's believed position may have had. The edit tests send edits that are refused, and one shade sort order set to the order it has, which saves the shades again unchanged. The settings tests send saves that are refused, and one that saves the NTP server and time zone the device already has. The restore test sends options that aren't JSON with a file that isn't a backup, so nothing is restored. A firmware upload goes only to a device without an OTA slot, which refuses it. The frequency scan test pauses the radio's sending for a second or two, as a scan does. It does fill every socket slot for a few seconds, and replays a page load.

The web UI holds one of the device's 5 socket slots for each open tab, and Home Assistant holds one. The tests that fill every slot fill the ones left, so close the UI's tabs for the full load.

The tests run in whatever security mode the device is in; the suite never changes it. To test both modes, run the suite once in each.