update; now supports configuration
git-svn-id: http://svn.openlayers.org/trunk/openlayers@8564 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
34
tests/selenium/remotecontrol/config.cfg
Normal file
34
tests/selenium/remotecontrol/config.cfg
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
[ie6-winxp]
|
||||||
|
host=208.80.142.184
|
||||||
|
browserCmd=iexploreproxy C:\Program Files\MultipleIEs\IE6\iexplore.exe
|
||||||
|
comment=IE6 on WinXP
|
||||||
|
|
||||||
|
[ie7-winxp]
|
||||||
|
host=208.80.142.184
|
||||||
|
browserCmd=iexploreproxy
|
||||||
|
comment=IE7 on WinXP
|
||||||
|
|
||||||
|
# Running on alta: debian etch
|
||||||
|
[opera-winxp]
|
||||||
|
host=208.80.142.184
|
||||||
|
browserCmd=opera C:\Program Files\Opera 9\Opera.exe
|
||||||
|
comment=Opera on WinXP
|
||||||
|
|
||||||
|
# Running on alta: debian etch
|
||||||
|
[opera]
|
||||||
|
host=208.80.142.140
|
||||||
|
browserCmd=opera
|
||||||
|
comment=Opera on Debian Etch
|
||||||
|
|
||||||
|
# Running on alta: Debian Etch
|
||||||
|
[firefox2]
|
||||||
|
host=208.80.142.140
|
||||||
|
browserCmd=firefox /usr/lib/iceweasel/firefox-bin
|
||||||
|
comment=Iceweasel 2 on Debian Etch
|
||||||
|
|
||||||
|
# Running on alta: Debian Etch
|
||||||
|
[firefox3]
|
||||||
|
host=208.80.142.105
|
||||||
|
browserCmd=firefox /usr/lib/firefox-3.0.1/firefox-bin
|
||||||
|
comment=FF3 on Ubuntu
|
||||||
|
|
||||||
@@ -1,11 +1,36 @@
|
|||||||
from selenium import selenium
|
from selenium import selenium
|
||||||
import time
|
import time
|
||||||
|
import sys
|
||||||
|
from ConfigParser import ConfigParser
|
||||||
|
|
||||||
while True:
|
if len(sys.argv) > 2:
|
||||||
|
filename = sys.argv[2]
|
||||||
|
else:
|
||||||
|
filename = "config.cfg"
|
||||||
|
|
||||||
browsers = ['firefox']
|
c = ConfigParser()
|
||||||
|
c.read(filename)
|
||||||
|
|
||||||
|
targets = {}
|
||||||
|
|
||||||
|
sections = c.sections()
|
||||||
|
for s in sections:
|
||||||
|
targets[s] = dict(c.items(s))
|
||||||
|
targets[s]['name'] = s
|
||||||
|
|
||||||
|
if sys.argv[1] == "all":
|
||||||
|
browsers = list(targets.values())
|
||||||
|
elif sys.argv[1] not in targets:
|
||||||
|
print "Invalid target"
|
||||||
|
sys.exit()
|
||||||
|
else:
|
||||||
|
browsers = [targets[sys.argv[1]]]
|
||||||
|
|
||||||
|
|
||||||
|
if 1:
|
||||||
for b in browsers:
|
for b in browsers:
|
||||||
s = selenium("localhost", 4444, "*%s" % b, "http://openlayers.org/")
|
print "Running %s on %s" % (b['name'], b['host'])
|
||||||
|
s = selenium(b['host'], 4444, "*%s" % b['browsercmd'], "http://openlayers.org/")
|
||||||
s.start()
|
s.start()
|
||||||
try:
|
try:
|
||||||
s.open("/dev/tests/run-tests.html?run=all")
|
s.open("/dev/tests/run-tests.html?run=all")
|
||||||
@@ -27,19 +52,17 @@ while True:
|
|||||||
|
|
||||||
if fail:
|
if fail:
|
||||||
print "Failed: %s" % fail
|
print "Failed: %s" % fail
|
||||||
html = s.get_eval("window.document.getElementById('results').innerHTML")
|
html = s.get_eval("window.document.getElementById('results').innerHTML").decode("utf-8")
|
||||||
all_html = """<html>
|
all_html = """<html>
|
||||||
<head>
|
<head>
|
||||||
<meta content="text/html; charset=utf-8" http-equiv="content-type" />
|
<meta content="text/html; charset=utf-8" http-equiv="content-type" />
|
||||||
</head>
|
</head>
|
||||||
<body>%s</body></html>""" % html
|
<body>%s</body></html>""" % html
|
||||||
|
|
||||||
f = open("fail.%s.%s.html" % (time.time(), b), "w")
|
f = open("fail.%s.%s.html" % (time.time(), b['name']), "w")
|
||||||
f.write(all_html)
|
f.write(all_html.encode)
|
||||||
f.close()
|
f.close()
|
||||||
except Exception, E:
|
except Exception, E:
|
||||||
print "Error: ", E
|
print "Error: ", E
|
||||||
s.stop()
|
s.stop()
|
||||||
|
|
||||||
print "sleeping for one hour"
|
|
||||||
time.sleep(3600)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user