rm /tmp/.X10-lock
fuser -k 6010/tcp
fuser -k 4444/tcp
Xvfb :10 -ac &
export DISPLAY=:10
java -jar /usr/bin/selenium-server.jar -multiwindow -htmlSuite "*firefox" "{{pillar['directorzone']['selenium-test-url']}}" "{{pillar['directorzone']['selenium-test-root']}}/suite.html" "report.html"
#cp report.html {{pillar['directorzone']['selenium-test-root']}}/../../public/report.html

DATE=`date`
if grep '<td>passed</td>' report.html
then
    RESULT="Passed @ $DATE"
else
    RESULT="Failed @ $DATE"
fi

PAYLOAD="'{ \"auth_token\": \"YOUR_AUTH_TOKEN\", \"text\": \"$RESULT\" }'"

eval curl -d $PAYLOAD http://directorzone:city-zone99@dashboard.netsensia.com/widgets/welcome
rm /tmp/.X10-lock
fuser -k 6010/tcp
fuser -k 4444/tcp
Xvfb :10 -ac &
export DISPLAY=:10
java -jar /usr/bin/selenium-server.jar -multiwindow -htmlSuite "*firefox" "{{pillar['directorzone']['selenium-test-url']}}" "suite.html" "report.html"

DATE=`date`
if grep '<td>passed</td>' report.html
then
    RESULT="Passed @ $DATE"
else
    RESULT="Failed @ $DATE"
fi

PAYLOAD="'{ \"auth_token\": \"YOUR_AUTH_TOKEN\", \"text\": \"$RESULT\" }'"

eval curl -d $PAYLOAD http://directorzone:city-zone99@dashboard.netsensia.com/widgets/welcome
Remove Selenium test root var
Remove Selenium test root var
