API
Function: (director-run &REST CONFIG)
Simulate a user session as defined by CONFIG.
CONFIG is a property list containing the following properties and their values:
:version: required number indicating the config format version; must be1:steps: required list of steps (see below for the step format):before-start: optional function to run before the first step:after-endoptional function to run after the last step:after-stepoptional function to run after every step:on-failure: optional function to run when an:assertstep fails:on-error: optional function to run when a step triggers an error; receives the error as argument:log-target: optional cons cell of the format(file . "filename")specifying a file to save the log to:typing-style: optional symbol changing the way that:typesteps type characters; set tohumanto simulate a human typing:delay-between-steps: optional number specifying how many seconds to wait after a step; defaults to1; set lower for automated tests
A step can be one of:
:type: simulate typing text; can be a string or a vector of key events; if a string, it will be converted to key events usinglistify-key-sequenceand can contain special characters, e.g.(:type "\M-xsetenv\r"):call: shortcut to invoke an interactive command, e.g.(:call setenv):eval: Lisp form; it will be evaluated:log: Lisp form; it will be evaluated and its result will be written to log; e.g.(:log (buffer-file-name (current-buffer))):wait: number; seconds to wait before next step; overrides config-wide:delay-between-steps:assert: Lisp form; if it evaluates to nil, execution is interrupted and function configured through:on-failureis called:suspend: suspend execution; useful for debugging; resume using thedirector-resumecommand
Function: (director-resume)
Resume from a (:suspend) step.