[GH-ISSUE #969] Continues Integration: automatic hardware tests #823

Open
opened 2026-02-28 01:27:13 +03:00 by kerem · 11 comments
Owner

Originally created by @dontsovcmc on GitHub (Nov 15, 2019).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/969

It's comfortable way to refactor library is to have a lot of tests.
I can write small software tests, but hardware tests are more interesting.

Idea:

  1. use platformio for command line build WiFiManager test examples
  2. connect to ESP8266 using python or bash language. For example:
    https://github.com/rockymeza/wifi
  3. test web pages content by HTTP requests
  4. check items, push buttons, fill labels by SeleniumHQ and etc

Pros:

  1. We can do a lot of refactor safety.

Cons:

  1. Control PC Wi-Fi is platform dependency.
Originally created by @dontsovcmc on GitHub (Nov 15, 2019). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/969 It's comfortable way to refactor library is to have a lot of tests. I can write small software tests, but hardware tests are more interesting. Idea: 1. use platformio for command line build WiFiManager test examples 2. connect to ESP8266 using python or bash language. For example: https://github.com/rockymeza/wifi 3. test web pages content by HTTP requests 4. check items, push buttons, fill labels by SeleniumHQ and etc Pros: 1. We can do a lot of refactor safety. Cons: 1. Control PC Wi-Fi is platform dependency.
Author
Owner

@dontsovcmc commented on GitHub (Dec 2, 2019):

@tablatronix I made it =)
Now we can check pages and refactor code safety:
https://github.com/dontsovcmc/ESPWebServerTest

What is you OS? Now I support MacOS Wi-fi adapter.

<!-- gh-comment-id:560192497 --> @dontsovcmc commented on GitHub (Dec 2, 2019): @tablatronix I made it =) Now we can check pages and refactor code safety: https://github.com/dontsovcmc/ESPWebServerTest What is you OS? Now I support MacOS Wi-fi adapter.
Author
Owner

@dontsovcmc commented on GitHub (Dec 5, 2019):

Look at examples/DEV/OnDemandConfigPortal test:
https://github.com/dontsovcmc/ESPWebServerTest#wifimanager-example-test

here is the Test:
https://github.com/dontsovcmc/ESPWebServerTest/blob/master/examples/WifiManagerTest/OnDemandConfigPortal/test_configportal.py

note: please, move handleRoute(), getTime() functions upper, cause compile error

<!-- gh-comment-id:561938454 --> @dontsovcmc commented on GitHub (Dec 5, 2019): Look at` examples/DEV/OnDemandConfigPortal` test: https://github.com/dontsovcmc/ESPWebServerTest#wifimanager-example-test here is the Test: https://github.com/dontsovcmc/ESPWebServerTest/blob/master/examples/WifiManagerTest/OnDemandConfigPortal/test_configportal.py note: please, move handleRoute(), getTime() functions upper, cause compile error
Author
Owner

@tablatronix commented on GitHub (Dec 5, 2019):

What compile error?

<!-- gh-comment-id:561957657 --> @tablatronix commented on GitHub (Dec 5, 2019): What compile error?
Author
Owner

@dontsovcmc commented on GitHub (Dec 5, 2019):

In C++ you should define function before use (PlatformIO works as C++).
Arduino IDE hacks this rule. So, add

void handleRoute();
void getTime(); 

before functions or mode them body upper.

<!-- gh-comment-id:562085856 --> @dontsovcmc commented on GitHub (Dec 5, 2019): In C++ you should define function before use (PlatformIO works as C++). Arduino IDE hacks this rule. So, add ``` void handleRoute(); void getTime(); ``` before functions or mode them body upper.
Author
Owner

@tablatronix commented on GitHub (Dec 5, 2019):

where?

<!-- gh-comment-id:562102860 --> @tablatronix commented on GitHub (Dec 5, 2019): where?
Author
Owner
<!-- gh-comment-id:562111497 --> @dontsovcmc commented on GitHub (Dec 5, 2019): https://github.com/tzapu/WiFiManager/blob/development/examples/DEV/OnDemandConfigPortal/OnDemandConfigPortal.ino
Author
Owner

@tablatronix commented on GitHub (Dec 5, 2019):

I use platformio, I get no compile errors.

<!-- gh-comment-id:562182714 --> @tablatronix commented on GitHub (Dec 5, 2019): I use platformio, I get no compile errors.
Author
Owner

@tablatronix commented on GitHub (Dec 5, 2019):

Are you compiling a copy or stream as cpp not ino ?

<!-- gh-comment-id:562188843 --> @tablatronix commented on GitHub (Dec 5, 2019): Are you compiling a copy or stream as cpp not ino ?
Author
Owner

@dontsovcmc commented on GitHub (Dec 5, 2019):

Rename ino to cpp and compile... Platformio can eat ino?!

<!-- gh-comment-id:562342338 --> @dontsovcmc commented on GitHub (Dec 5, 2019): Rename ino to cpp and compile... Platformio can eat ino?!
Author
Owner

@tablatronix commented on GitHub (Dec 5, 2019):

Yes

<!-- gh-comment-id:562354129 --> @tablatronix commented on GitHub (Dec 5, 2019): Yes
Author
Owner

@dontsovcmc commented on GitHub (Dec 5, 2019):

Nice, simplify script.

<!-- gh-comment-id:562358715 --> @dontsovcmc commented on GitHub (Dec 5, 2019): Nice, simplify script.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#823
No description provided.