First step towards automating running of tests via selenium-RC. (Still need

to set up some selenium-RC servers before this is a 'real' thing.)  


git-svn-id: http://svn.openlayers.org/trunk/openlayers@8563 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2008-12-26 17:41:17 +00:00
parent 70f04dcf62
commit 40e5c856b6
3 changed files with 1899 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
from selenium import selenium
import time
while True:
browsers = ['firefox']
for b in browsers:
s = selenium("localhost", 4444, "*%s" % b, "http://openlayers.org/")
s.start()
try:
s.open("/dev/tests/run-tests.html?run=all")
count = 0
while count == 0:
count = int(s.get_eval("window.document.getElementById('testtable').getElementsByTagName('tr').length"))
time.sleep(5)
ok = 0
fail = 0
while True:
ok = int(s.get_eval('window.Test.AnotherWay._g_ok_pages'))
fail = int(s.get_eval('window.Test.AnotherWay._g_fail_pages'))
if (ok + fail) >= count:
break
time.sleep(10)
if fail:
print "Failed: %s" % fail
html = s.get_eval("window.document.getElementById('results').innerHTML")
all_html = """<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="content-type" />
</head>
<body>%s</body></html>""" % html
f = open("fail.%s.%s.html" % (time.time(), b), "w")
f.write(all_html)
f.close()
except Exception, E:
print "Error: ", E
s.stop()
print "sleeping for one hour"
time.sleep(3600)