Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Narvaez <dwnarvaez@gmail.com>2012-06-29 09:43:58 (GMT)
committer Daniel Narvaez <dwnarvaez@gmail.com>2012-06-29 09:43:58 (GMT)
commitffc4ce1a80f1fb5ce6be1844c90d7009075469df (patch)
tree473035caff67f7ef50a197da1b32c5adaaf3cabc
parente47b3760dc0bd235b537c2ba447453b35032f272 (diff)
Add a simple dogtail test
-rw-r--r--Makefile3
-rwxr-xr-xscripts/check-system4
-rwxr-xr-xscripts/run-dogtail-tests36
-rw-r--r--tests/shell.py11
4 files changed, 54 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 33f650b..1a285ff 100644
--- a/Makefile
+++ b/Makefile
@@ -45,6 +45,9 @@ build-%:
run:
xinit $(SCRIPTS)/xinitrc -- :99
+test:
+ $(LOG) "$(SCRIPTS)/run-dogtail-tests" $(LOGFILE)
+
shell:
@cd source; \
PS1="[sugar-build \W]$$ " \
diff --git a/scripts/check-system b/scripts/check-system
index 28ac8b5..7e67cd3 100755
--- a/scripts/check-system
+++ b/scripts/check-system
@@ -216,6 +216,10 @@ checks = \
"checker": "pkgconfig",
"packages": { "fedora": "libX11-devel",
"ubuntu": "libx11-dev" } },
+ { "check": "import dogtail",
+ "checker": "python",
+ "packages": { "fedora": "dogtail",
+ "ubuntu": "python-dogtail" } },
# Workarounds for distro bugs
diff --git a/scripts/run-dogtail-tests b/scripts/run-dogtail-tests
new file mode 100755
index 0000000..26d94e4
--- /dev/null
+++ b/scripts/run-dogtail-tests
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+scriptsdir=`dirname "$0"`
+rootdir=`dirname "$scriptsdir"`
+testsdir=$rootdir/tests
+display=:99
+
+minver="0.8.0"
+version=`python -c "import dogtail; print dogtail.__version__"`
+if [ "$minver" != "`echo -e "$minver\n$version" | sort -V | head -n1`" ]; then
+ echo "Dogtail >= 0.8.0 is required."
+ exit 0
+fi
+
+xserver=`which Xvfb`
+if [ -z "$HEADLESS" ]; then
+ xserver=
+fi
+
+export GTK_MODULES=gail:atk-bridge
+export SUGAR_PROFILE=dogtail
+
+rm -rf ~/.sugar/dogtail
+
+xinit $scriptsdir/xinitrc -- $xserver $display &
+xinitpid=$!
+
+# FIXME starting the tests immediately puts dogtail in a broken state
+sleep 1
+
+DISPLAY=$display python $testsdir/shell.py
+result=$?
+
+kill $xinitpid
+
+exit $result
diff --git a/tests/shell.py b/tests/shell.py
new file mode 100644
index 0000000..e6091e8
--- /dev/null
+++ b/tests/shell.py
@@ -0,0 +1,11 @@
+from dogtail import tree
+
+shell = tree.root.child(name="sugar-session", roleName="application")
+
+# Complete the intro screen
+done_button = shell.child(name="Done", roleName="push button")
+done_button.click()
+
+# Switch to the home list view
+radio_button = shell.child(name="List view", roleName="radio button")
+radio_button.click()