Automated regression testing catches bugs before they reach production. For CSMS development, this means running OCPP scenarios automatically — creating virtual charging stations, driving transactions, and verifying your CSMS responds correctly. This is straightforward with the right simulator, and it catches bugs that unit tests cannot reach.
Why OCPP regression tests matter
A CSMS is a stateful, protocol-heavy system. A change to authorization logic can silently break smart charging. A refactored meter value handler can corrupt billing records. A reconnect fix can introduce a race condition in session recovery. These bugs only surface when a charging station actually connects and exchanges messages — unit tests cannot catch them.
Running OCPP integration tests in CI gives you a fast feedback loop: every merge to main verifies that the core charging flows still work correctly.
What you need
To run OCPP tests in CI you need three things:
- A CSMS instance reachable from the CI runner — a staging environment or a locally-started server in the test job
- An OCPP simulator with a REST API your test script can call
- Test scripts that drive the simulator through specific scenarios and assert against CSMS state
The REST API is the key ingredient. Without it, you write a custom WebSocket client for each test — significant overhead that most teams cannot justify.
A typical CI test scenario
Here is what an automated OCPP test looks like with a REST-driven simulator:
- Create a virtual charging station pointed at your staging CSMS URL
- Wait for BootNotification to complete (poll station info until status is online)
- Connect a virtual EV to connector 1
- Send RemoteStartTransaction from your CSMS
- Let the session run, collecting MeterValues
- Send RemoteStopTransaction
- Assert your CSMS recorded the correct session energy
- Delete the station
Each step is a single REST call. The full scenario takes seconds. Run 10 stations in parallel and you have a meaningful load test in under a minute.
What to test beyond happy path
Happy-path transactions catch the obvious regressions. The more valuable tests cover edge cases: network disconnect mid-transaction and reconnect, authorization with an expired id_tag, RemoteStart before an EV is connected, fault injection during active charging. These are the scenarios that break CSMS systems in production and are nearly impossible to reproduce reliably with real hardware.
SimIt provides the REST API that makes all of this scriptable. Sign up, get your API key, and point your test script at the SimIt API. Your CSMS URL is the only other ingredient required.
Get your free API key and run your first OCPP CI test today.