Automatic smoke testing of software, supporting:
- Key events
- Listening to log files, waiting for regexp
- Screen shots
$ java -jar defold-robot.jar -s [script] -o [output-dir]
A simple script in EDN:
{:logs {:editor {:pattern "editor2.*.log"
:dir "."}
:engine {:pattern "log.txt"
:dir "."}}
:steps [[:await-log :editor 60000 "project loaded"]
[:wait 2000]
[:screen-capture "project_loaded"]
[:press :command :shift :r]
[:type ".coll"]
[:press :down]
[:press :enter]
[:wait 2500]
[:screen-capture "collection"]
[:press :command :shift :r]
[:type "player.script"]
[:press :down]
[:press :enter]
[:wait 2000]
[:screen-capture "script"]
[:press :command :b]
[:await-log :engine 10000 "intro started"]
[:await-log :engine 60000 " seconds"]
[:screen-capture "game_intro"]
[:await-log :engine 60000 "level started"]
[:await-log :engine 60000 " seconds"]
[:screen-capture "game_running"]
[:switch-focus]
[:press :enter]
[:press :command :r]
[:press :command :z]
[:await-log :engine 3000 "successfully reloaded"]
[:screen-capture "test_end"]
[:switch-focus]
[:press :command :q]
[:press :command :q]]}
In brief, this script:
- Waits for the editor to say "Project loaded"
- Open a collection
- Open a script
- Run the game
- Hot-reload the opened script
- Wait for the engine to confirm it
Basically, the only complex part is listening for logging. There are a few rudimentary tests for this.
lein test
- Edit the source
- [optional] Change the version in project.clj
- Release:
$ lein release