Change test scripts from a menu to a state machine