mirror of
https://github.com/alexhopeoconnor/WiFiManager.git
synced 2026-10-04 02:48:13 +10:00
feat: add reproducible portal README media
This commit is contained in:
@@ -20,8 +20,13 @@ void setup() {
|
||||
Serial.begin(115200);
|
||||
delay(300);
|
||||
|
||||
// The fixture intentionally has no station credentials. A finite window
|
||||
// exercises timeout reset without leaving a board in a permanent portal.
|
||||
// This fixture must be independent of whichever sketch was previously
|
||||
// flashed to the board. Clear saved station credentials before starting
|
||||
// the portal so browser artifacts always show the unconfigured flow.
|
||||
wifi.resetSettings();
|
||||
|
||||
// A finite window exercises timeout reset without leaving a board in a
|
||||
// permanent portal.
|
||||
wifi.setConfigPortalTimeout(15 * 60);
|
||||
wifi.setAPStaticIPConfig(
|
||||
IPAddress(192, 168, 4, 1),
|
||||
|
||||
@@ -105,6 +105,7 @@ TestCase tests[] = {
|
||||
TEST_ENTRY(test_scan_cancels_when_connect_pending),
|
||||
TEST_ENTRY(test_scan_cancels_when_lifecycle_blocked),
|
||||
TEST_ENTRY(test_scan_generation_invalidated_on_reset),
|
||||
TEST_ENTRY(test_scan_restart_interval_is_platform_appropriate),
|
||||
|
||||
TEST_ENTRY(test_real_async_scan_completes),
|
||||
// Template rendering tests
|
||||
|
||||
@@ -107,6 +107,7 @@ void test_scan_completion_wait();
|
||||
void test_scan_cancels_when_connect_pending();
|
||||
void test_scan_cancels_when_lifecycle_blocked();
|
||||
void test_scan_generation_invalidated_on_reset();
|
||||
void test_scan_restart_interval_is_platform_appropriate();
|
||||
void test_real_async_scan_completes();
|
||||
|
||||
// Template rendering tests
|
||||
|
||||
@@ -150,3 +150,24 @@ void test_scan_generation_invalidated_on_reset() {
|
||||
Serial.println("[TEST] Scan generation invalidation on reset test completed successfully");
|
||||
}
|
||||
|
||||
void test_scan_restart_interval_is_platform_appropriate() {
|
||||
Serial.println("[TEST] Testing platform scan restart interval...");
|
||||
|
||||
WiFiManager wm;
|
||||
|
||||
#ifdef UNIT_TEST
|
||||
#ifdef ESP32
|
||||
TEST_ASSERT_EQUAL_UINT32_MESSAGE(
|
||||
5000, wm.wmTestGetScanRestartIntervalMs(),
|
||||
"ESP32 must wait for the radio to settle after a completed scan");
|
||||
#else
|
||||
TEST_ASSERT_EQUAL_UINT32_MESSAGE(
|
||||
2000, wm.wmTestGetScanRestartIntervalMs(),
|
||||
"ESP8266 keeps the established responsive scan restart interval");
|
||||
#endif
|
||||
#else
|
||||
TEST_IGNORE_MESSAGE("UNIT_TEST helpers unavailable");
|
||||
#endif
|
||||
|
||||
Serial.println("[TEST] Platform scan restart interval test completed successfully");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user