From 11abbd27472d032f0f272cd45206f5af855aafea Mon Sep 17 00:00:00 2001 From: Phillip Lord Date: Wed, 12 Jun 2019 22:28:38 +0100 Subject: Add robotized test --- robot/robot-test.sh | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100755 robot/robot-test.sh (limited to 'robot/robot-test.sh') diff --git a/robot/robot-test.sh b/robot/robot-test.sh new file mode 100755 index 0000000..31a6f09 --- /dev/null +++ b/robot/robot-test.sh @@ -0,0 +1,49 @@ +#!/bin/sh + +set -e + +$EMACS -Q -l ./robot/org-drill-launch.el & + +sleep 1 + +window_id=`xdotool search --name "emacs-bot"` +if [ -z "$window_id" ] +then + echo "Could not find window ID for Emacs-bot" + exit 1 +fi + +## Org-drill should be running at this point, so give three answers +## with a score of file +echo answer one +xdotool key --window $window_id KP_Enter +sleep 0.25 +xdotool key --window $window_id 5 +sleep 0.25 + + +echo answer two +xdotool key --window $window_id KP_Enter +sleep 0.25 +xdotool key --window $window_id 5 +sleep 0.25 + +echo answer three +xdotool key --window $window_id KP_Enter +sleep 0.25 +xdotool key --window $window_id 5 +sleep 0.25 + +# ## Press any key to continue +echo press any key to continue +xdotool key --window $window_id KP_Enter +sleep 0.25 + +echo Save file +xdotool key --window $window_id y +sleep 0.25 + +echo Goodnight Emacs +xdotool key --window $window_id alt+x +xdotool type --window $window_id kill-emacs +xdotool key --window $window_id KP_Enter -- cgit v1.2.3