Created
October 9, 2012 21:35
-
-
Save heddn/3861610 to your computer and use it in GitHub Desktop.
selenium ant build
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project name="Example Test Suite" default="build"> | |
<property environment="env"/> | |
<target name="build" depends="prepare,phpunit,stop-selenium" /> | |
<target name="clean" description="Cleanup build artifacts"> | |
<delete dir="${basedir}/build/logs" /> | |
</target> | |
<target name="prepare" depends="clean" description="Prepare for build"> | |
<mkdir dir="${basedir}/build/logs" /> | |
</target> | |
<target name="phpunit" description="Run unit tests with PHPUnit" depends="start-selenium"> | |
<exec executable="phpunit" failonerror="true" /> | |
</target> | |
<target name="start-selenium"> | |
<exec executable="Xvfb" spawn="true"> | |
<arg line=" :99 -ac -noreset -screen 0 1024x768x24" /> | |
</exec> | |
<exec executable="java" spawn="true"> | |
<env key="DISPLAY" value=":99" /> | |
<arg line="-jar ${env.SELENIUM} -log ${basedir}/build/logs/selenium.log -browserSessionReuse" /> | |
</exec> | |
<sleep seconds="3"/> | |
</target> | |
<target name="stop-selenium"> | |
<get taskname="selenium-shutdown" src="http://localhost:4444/selenium-server/driver/?cmd=shutDownSeleniumServer" dest="${basedir}/build/logs/seleniumResult.txt" ignoreerrors="true" /> | |
<echo taskname="selenium-shutdown" message="DGF Errors during shutdown are expected" /> | |
</target> | |
</project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment