Commit Graph
12 Commits
Author SHA1 Message Date
alex f056893f87 Implement comprehensive test suite improvements
- Added 42 new tests covering critical functionality:
  * WiFi connection flow tests (6 tests)
  * Callback firing verification tests (4 tests)
  * DNS server lifecycle tests (3 tests)
  * Error condition tests (7 tests)
  * Parameter value management tests (5 tests)
  * WiFi scanning tests (4 tests)
  * State transition tests (4 tests)
  * Integration tests (5 tests)
  * Stress tests (5 tests)

- Fixed compilation errors by replacing protected connectWifi() calls with public autoConnect()
- Fixed config reset callback test to use resetSettings() instead of erase()
- Added delays around resetSettings() calls to prevent ESP8266 WiFi stack crashes
- Reduced stress test iterations to avoid excessive output
- Improved test stability with better state checking and error handling

Total test count: 86 tests (up from 44)
All tests passing successfully
2025-11-05 23:25:06 +10:00
alex b94f34f06a Remove blocking config portal mode and refactor API
- Remove setConfigPortalBlocking() API and _configPortalIsBlocking member variable
- Remove blocking while(1) loop from startConfigPortal()
- Change startConfigPortal() return type from boolean to void
- Change stopConfigPortal() return type from bool to void
- Make stopConfigPortal() immediately shutdown portal (call shutdownConfigPortal() directly)
- Remove unused portalAbortResult and portalTimeoutResult variables
- Update all comments to remove blocking mode references
- Simplify debug messages (remove 'non-blocking' references)
- Update tests to remove setConfigPortalBlocking() calls
- All 43 tests passing

The config portal is now always non-blocking, requiring users to call
process() periodically in their main loop. This aligns with the async
web server architecture and simplifies the API.
2025-11-05 20:49:22 +10:00
alex d533f4d754 Refactor WiFi scanning to be fully async for ESPAsyncWebServer
- Remove blocking WiFi scan operations from HTTP handlers
- Make WiFi_scanNetworks() always async, remove sync path
- Remove blocking wait loop that caused WDT resets
- Add scan status polling in process() function
- Make getScanItemOut() cache-only, never triggers scans
- Add /wifi/scanstatus JSON endpoint for AJAX polling
- Add client-side JavaScript for async network list updates
- Remove _asyncScan toggle, always use async scanning
- Add scan state management variables (_scanInProgress, _scanRequested)
2025-11-05 19:18:48 +10:00
alex d62f680132 Refactor to use ESPAsyncWebServer instead of ESP8266WebServer/WebServer
- Replace ESP8266WebServer/WebServer with ESPAsyncWebServer
- Update all route handlers to async pattern with AsyncWebServerRequest*
- Replace synchronous HTTPSend() with request->send()
- Add configurable delay constants (REBOOT_DELAY_MS, EXIT_DELAY_MS, ERASE_REBOOT_DELAY_MS)
- Implement scheduled reboot/abort flags instead of blocking delays
- Update WiFiManagerRequestArgs to use AsyncWebServerRequest
- Remove server->handleClient() and server->stop() calls (not needed for AsyncWebServer)
- Update parameter access to use request->getParam() instead of server->arg()
- Add ESPAsyncWebServer to platformio.ini dependencies
2025-11-04 22:51:22 +10:00
alex c2e1e7f95c Bump version to 2.0.18 2025-11-04 20:16:44 +10:00
alex 4b1226bd05 Add WiFiManagerRequestArgs class and update saveParamsCallback to pass request arguments
- Created WiFiManagerRequestArgs nested class to encapsulate HTTP request arguments
- Updated setSaveParamsCallback to accept WiFiManagerRequestArgs by value
- Updated handleWifiSave() and handleParamSave() to build RequestArgs early
- Updated doParamSave() to accept and use RequestArgs for custom HTML params
- Updated test callbacks to match new signature
- All tests passing (43/43)
2025-11-04 20:06:24 +10:00
alex 64c987a560 Remove examples directory and update tests for ESP32 compatibility
- Remove examples directory (not maintained)
- Remove ArduinoJson dependency from platformio.ini (only needed for examples)
- Update platformio.ini comments for test configuration
- Fix test_reset_settings to handle ESP32 NVS behavior differences
2025-11-02 14:17:07 +10:00
alex ca373b2b8e Consolidate and optimize test suite (80 -> 43 tests) 2025-11-02 13:44:49 +10:00
alex afb5bb61b8 Add comprehensive test suite for WiFiManager (80 tests) 2025-11-02 13:25:58 +10:00
alex b2a17d81bf Restructure project for PlatformIO best practices and add test framework
- Move library code from src/ to lib/WiFiManager/src/
- Move headers from include/ to lib/WiFiManager/include/
- Move library.json to lib/WiFiManager/
- Update platformio.ini with Unity test framework configuration
- Add test structure following PlatformIO unit testing best practices
- Remove empty src/ directory (not needed for library-only projects)
2025-11-02 12:50:57 +10:00
alex e6a0813666 Tidy up fork: remove .github, update LICENSE and README 2025-11-02 12:02:32 +10:00
alex 2b40362ff7 Refactor to proper PlatformIO library structure
- Move source files to src/ and headers to include/ directories
- Remove Arduino IDE specific files (.travis.yml, keywords.txt, library.properties, CMakeLists.txt, travis/)
- Update library.json with export section pointing to include/
- Add platformio.ini for development and testing
- Update .gitignore with PlatformIO-specific entries
- Update LICENSE with fork attribution
- Update README.md with PlatformIO-focused installation instructions

Verified working with:
- ESP8266 examples (Basic, Advanced)
- ESP32 examples (Basic)

All builds successful ✅
2025-11-02 01:05:34 +10:00