At King we use Cucumber to do something similar to integration testing. There’s a cucumber-lua wire protocol implementation on GitHub from which we have based our code. To this we have added non-blocking sockets that fit nicely with the Defold life-cycle of events. And on top of that we have added code to simulate user input and screen inspection to verify output. Our modifications are currently in a private repo, but perhaps it could be shared.