defold-robot/README.md
Automatic smoke testing of software, supporting:
$ 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:
Basically, the only complex part is listening for logging. There are a few rudimentary tests for this.
lein test
$ lein release