[Checkins] SVN: Zelenium/trunk/ merge gotcha-selenium-0.8.1@71182
gotcha-selenium-0.8.3@HEAD
Godefroid Chapelle
gotcha at bubblenet.be
Sat Dec 8 09:29:35 EST 2007
Log message for revision 82198:
merge gotcha-selenium-0.8.1 at 71182 gotcha-selenium-0.8.3 at HEAD
Zelenium trunk now include Selenium-core 0.8.3
All tests pass under 2.9.8 and 2.10.5
Changed:
U Zelenium/trunk/configure.zcml
D Zelenium/trunk/selenium/
A Zelenium/trunk/selenium/
U Zelenium/trunk/www/suiteSplash.zpt
U Zelenium/trunk/www/suiteView.zpt
A Zelenium/trunk/www/testPrompt.zpt
U Zelenium/trunk/zuite.py
-=-
Modified: Zelenium/trunk/configure.zcml
===================================================================
--- Zelenium/trunk/configure.zcml 2007-12-08 13:40:46 UTC (rev 82197)
+++ Zelenium/trunk/configure.zcml 2007-12-08 14:29:34 UTC (rev 82198)
@@ -2,8 +2,15 @@
xmlns:browser="http://namespaces.zope.org/browser">
<browser:defaultView
- for="Products.Zelenium.interfaces.IZuite"
+ for=".interfaces.IZuite"
name="index_html"
/>
+ <browser:page
+ for=".interfaces.IZuite"
+ name="index_html"
+ template="www/suiteView.zpt"
+ permission="zope2.View"/>
+
</configure>
+
Copied: Zelenium/trunk/selenium (from rev 82197, Zelenium/branches/gotcha-selenium-0.8.3/selenium)
Modified: Zelenium/trunk/www/suiteSplash.zpt
===================================================================
--- Zelenium/trunk/www/suiteSplash.zpt 2007-12-08 13:40:46 UTC (rev 82197)
+++ Zelenium/trunk/www/suiteSplash.zpt 2007-12-08 14:29:34 UTC (rev 82198)
@@ -14,8 +14,8 @@
limitations under the License.
-->
-<html>
-<link rel="stylesheet" type="text/css" href="selenium.css" />
+<html tal:define="URL context/absolute_url;">
+<link rel="stylesheet" type="text/css" href="core_selenium.css" />
<body>
<table width="100%">
@@ -35,7 +35,7 @@
<td></td>
<td class="selenium splash">
-<img src="selenium-logo.png" align="right">
+<img src="selenium-logo.png" tal:attributes="src string:${URL}/core_selenium-logo.png" align="right">
<h1>Selenium</h1>
<h2>by <a href="http://www.thoughtworks.com">ThoughtWorks</a> and friends</h2>
@@ -44,7 +44,7 @@
For more information on Selenium, visit
<pre>
- <a href="http://selenium.thoughtworks.com" target="_blank">http://selenium.thoughtworks.com</a>
+ <a href="http://selenium.openqa.org" target="_blank">http://selenium.openqa.org</a>
</pre>
</td>
Modified: Zelenium/trunk/www/suiteView.zpt
===================================================================
--- Zelenium/trunk/www/suiteView.zpt 2007-12-08 13:40:46 UTC (rev 82197)
+++ Zelenium/trunk/www/suiteView.zpt 2007-12-08 14:29:34 UTC (rev 82198)
@@ -1,164 +1,176 @@
-<html tal:define="URL context/absolute_url;">
- <head>
- <meta content="text/html; charset=ISO-8859-1"
- http-equiv="content-type" />
- <title>Selenium Functional Test Runner</title>
+<html tal:define="URL string:${context/absolute_url}/core;">
- <link rel="stylesheet" type="text/css" href="selenium.css"
- tal:attributes="href string:${URL}/selenium.css"/>
- <script language="JavaScript" type="text/javascript"
- src="html-xpath/html-xpath-patched.js"
- tal:attributes="src string:${URL}/html-xpath/html-xpath-patched.js"
- ></script>
- <script language="JavaScript" type="text/javascript"
- src="selenium-browserbot.js"
- tal:attributes="src string:${URL}/selenium-browserbot.js"
- ></script>
- <script language="JavaScript" type="text/javascript"
- src="selenium-api.js"
- tal:attributes="src string:${URL}/selenium-api.js"
- ></script>
- <script language="JavaScript" type="text/javascript"
- src="selenium-commandhandlers.js"
- tal:attributes="src string:${URL}/selenium-commandhandlers.js"
- ></script>
- <script language="JavaScript" type="text/javascript"
- src="selenium-executionloop.js"
- tal:attributes="src string:${URL}/selenium-executionloop.js"
- ></script>
- <script language="JavaScript" type="text/javascript"
- src="selenium-fitrunner.js"
- tal:attributes="src string:${URL}/selenium-fitrunner.js"
- ></script>
- <script language="JavaScript" type="text/javascript"
- src="selenium-logging.js"
- tal:attributes="src string:${URL}/selenium-logging.js"
- ></script>
- <script language="JavaScript" type="text/javascript"
- src="htmlutils.js"
- tal:attributes="src string:${URL}/htmlutils.js"
- ></script>
- <script language="JavaScript" type="text/javascript"
- src="xpath.js"
- tal:attributes="src string:${URL}/xpath.js"
- ></script>
- <script language="JavaScript" type="text/javascript"
- src="user-extensions.js"
- tal:attributes="src string:${URL}/user-extensions.js"
- ></script>
- <script language="JavaScript" type="text/javascript">
- function openDomViewer() {
- var autFrame = document.getElementById('myiframe');
- var autFrameDocument = getIframeDocument(autFrame);
- this.rootDocument = autFrameDocument;
- var domViewer = window.open('domviewer.html');
- return false;
- }
- </script>
+<head>
+ <HTA:APPLICATION ID="SeleniumHTARunner" APPLICATIONNAME="Selenium">
+ <!-- the previous line is only relevant if you rename this
+ file to "TestRunner.hta" -->
- </head>
+ <!-- The copyright notice and other comments have been moved to after the HTA declaration,
+to work-around a bug in IE on Win2K whereby the HTA application doesn't function correctly -->
+ <!--
+ Copyright 2004 ThoughtWorks, Inc
- <body onload="start();">
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+ <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"/>
+
+ <title>Selenium Functional Test Runner</title>
+ <link rel="stylesheet" type="text/css" href="selenium.css" tal:attributes="href string:${URL}/selenium.css"/>
+ <script type="text/javascript" src="scripts/narcissus-defs.js" tal:attributes="src string:${URL}/scripts/narcissus-defs.js"></script>
+ <script type="text/javascript" src="scripts/narcissus-parse.js" tal:attributes="src string:${URL}/scripts/narcissus-parse.js"></script>
+ <script type="text/javascript" src="scripts/narcissus-exec.js" tal:attributes="src string:${URL}/scripts/narcissus-exec.js"></script>
+ <script language="JavaScript" type="text/javascript" src="lib/prototype.js" tal:attributes="src string:${URL}/lib/prototype.js"></script>
+ <script language="JavaScript" type="text/javascript" src="lib/scriptaculous/scriptaculous.js" tal:attributes="src string:${URL}/lib/scriptaculous/scriptaculous.js"></script>
+ <script language="JavaScript" type="text/javascript" src="lib/cssQuery/cssQuery-p.js" tal:attributes="src string:${URL}/lib/cssQuery/cssQuery-p.js"></script>
+ <script language="JavaScript" type="text/javascript" src="scripts/selenium-browserdetect.js" tal:attributes="src string:${URL}/scripts/selenium-browserdetect.js"></script>
+ <script language="JavaScript" type="text/javascript" src="scripts/selenium-browserbot.js" tal:attributes="src string:${URL}/scripts/selenium-browserbot.js"></script>
+ <script language="JavaScript" type="text/javascript" src="scripts/find_matching_child.js" tal:attributes="src string:${URL}/scripts/find_matching_child.js"></script>
+ <script language="JavaScript" type="text/javascript" src="scripts/htmlutils.js" tal:attributes="src string:${URL}/scripts/htmlutils.js"></script>
+ <script language="JavaScript" type="text/javascript" src="scripts/selenium-api.js" tal:attributes="src string:${URL}/scripts/selenium-api.js"></script>
+ <script language="JavaScript" type="text/javascript" src="scripts/selenium-commandhandlers.js" tal:attributes="src string:${URL}/scripts/selenium-commandhandlers.js"></script>
+ <script language="JavaScript" type="text/javascript" src="scripts/selenium-executionloop.js" tal:attributes="src string:${URL}/scripts/selenium-executionloop.js"></script>
+ <script language="JavaScript" type="text/javascript" src="scripts/selenium-testrunner.js" tal:attributes="src string:${URL}/scripts/selenium-testrunner.js"></script>
+ <script language="JavaScript" type="text/javascript" src="scripts/selenium-logging.js" tal:attributes="src string:${URL}/scripts/selenium-logging.js"></script>
+ <script language="JavaScript" type="text/javascript" src="scripts/selenium-version.js" tal:attributes="src string:${URL}/scripts/selenium-version.js"></script>
+ <script language="JavaScript" type="text/javascript" src="xpath/misc.js" tal:attributes="src string:${URL}/xpath/misc.js"></script>
+ <script language="JavaScript" type="text/javascript" src="xpath/dom.js" tal:attributes="src string:${URL}/xpath/dom.js"></script>
+ <script language="JavaScript" type="text/javascript" src="xpath/xpath.js" tal:attributes="src string:${URL}/xpath/xpath.js"></script>
+ <script language="JavaScript" type="text/javascript" src="scripts/user-extensions.js" tal:attributes="src string:${URL}/scripts/user-extensions.js"></script>
+ <script language="JavaScript" type="text/javascript">
+ function openDomViewer() {
+ var autFrame = document.getElementById('myiframe');
+ var autFrameDocument = new SeleniumFrame(autFrame).getDocument();
+ this.rootDocument = autFrameDocument;
+ var domViewer = window.open(getDocumentBase(document) + 'domviewer/domviewer.html');
+ return false;
+ }
+ </script>
+</head>
+
+<body onLoad="onSeleniumLoad();">
+<table class="layout">
+<form action="" name="controlPanel">
+
+<!-- Suite, Test, Control Panel -->
+
+<tr class="selenium">
+<td width="25%" height="30%">
+ <iframe name="testSuiteFrame" id="testSuiteFrame" src="./TestPrompt.html"
+ tal:attributes="src string:${URL}/test_prompt_html" application="yes"></iframe>
+</td>
+<td width="50%" height="30%">
+ <iframe name="testFrame" id="testFrame" application="yes"></iframe>
+</td>
+
+<td width="25%">
<table class="layout">
- <form action="" name="controlPanel">
+ <tr class="selenium">
+ <th width="25%" height="1" class="header">
+ <h1><a href="http://selenium.thoughtworks.com" title="The Selenium Project">Selenium</a> TestRunner
+ </h1>
+ </th>
+ </tr>
+ <tr>
+ <td width="25%" height="30%" id="controlPanel">
+ <fieldset>
+ <legend>Execute Tests</legend>
- <!-- Suite, Test, Control Panel -->
+ <div id="imageButtonPanel">
+ <button type="button" id="runSuite" onClick="htmlTestRunner.startTestSuite();"
+ title="Run All tests">
+ </button>
+ <button type="button" id="runSeleniumTest" onClick="htmlTestRunner.runSingleTest();"
+ title="Run the Selected test">
+ </button>
+ <button type="button" id="pauseTest" disabled="disabled"
+ title="Pause/Continue" class="cssPauseTest">
+ </button>
+ <button type="button" id="stepTest" disabled="disabled"
+ title="Step">
+ </button>
+ </div>
- <tr class="selenium">
- <td width="25%" height="30%" rowspan="2">
- <iframe name="testSuiteFrame" id="testSuiteFrame"
- src="./tests/TestSuite.html"
- tal:define="dynamic string:${URL}/test_suite_html;"
- tal:attributes="src options/suite_name | dynamic;"
- ></iframe></td>
- <td width="50%" height="30%" rowspan="2"><iframe name="testFrame" id="testFrame"></iframe></td>
- <th width="25%" height="1" class="header">
- <h1><a href="http://selenium.thoughtworks.com" title="The Selenium Project">Selenium</a> TestRunner</h1>
- </th>
- </tr>
+ <div style="float:left">Fast</div>
+ <div style="float:right">Slow</div>
+ <br/>
+ <div id="speedSlider">
+ <div id="speedTrack"> </div>
+ <div id="speedHandle"> </div>
+ </div>
- <tr class="selenium">
- <td width="25%" height="30%" id="controlPanel">
+ <div class="executionOptions">
+ <input id="highlightOption" type="checkbox" name="highlightOption" value="0"/>
+ <label for="highlightOption">Highlight elements</label>
+ </div>
- <fieldset>
- <legend>Execute Tests</legend>
-
- <div>
- <input id="modeRun" type="radio" name="runMode" value="0" checked="checked"/><label for="modeRun">Run</label>
- <input id="modeWalk" type="radio" name="runMode" value="500" /><label for="modeWalk">Walk</label>
- <input id="modeStep" type="radio" name="runMode" value="-1" /><label for="modeStep">Step</label>
- </div>
-
- <div>
- <button type="button" id="runSuite" onclick="startTestSuite();"
- title="Run the entire Test-Suite">
- <strong>All</strong>
- </button>
- <button type="button" id="runTest" onclick="runSingleTest();"
- title="Run the current Test">
- <em>Selected</em>
- </button>
- <button type="button" id="continueTest" disabled="disabled"
- title="Continue the Test">
- Continue
- </button>
- </div>
-
- </fieldset>
+ </fieldset>
- <table id="stats" align="center">
- <tr>
- <td colspan="2" align="right">Elapsed:</td>
- <td id="elapsedTime" colspan="2">00.00</td>
- </tr>
- <tr>
- <th colspan="2">Tests</th>
- <th colspan="2">Commands</th>
- </tr>
- <tr>
- <td class="count" id="testRuns">0</td>
- <td>run</td>
- <td class="count" id="commandPasses">0</td>
- <td>passed</td>
- </tr>
- <tr>
- <td class="count" id="testFailures">0</td>
- <td>failed</td>
- <td class="count" id="commandFailures">0</td>
- <td>failed</td>
- </tr>
- <tr>
- <td colspan="2"></td>
- <td class="count" id="commandErrors">0</td>
- <td>incomplete</td>
- </tr>
- </table>
+ <table id="stats" align="center">
+ <tr>
+ <td colspan="2" align="right">Elapsed:</td>
+ <td id="elapsedTime" colspan="2">00.00</td>
+ </tr>
+ <tr>
+ <th colspan="2">Tests</th>
+ <th colspan="2">Commands</th>
+ </tr>
+ <tr>
+ <td class="count" id="testRuns">0</td>
+ <td>run</td>
+ <td class="count" id="commandPasses">0</td>
+ <td>passed</td>
+ </tr>
+ <tr>
+ <td class="count" id="testFailures">0</td>
+ <td>failed</td>
+ <td class="count" id="commandFailures">0</td>
+ <td>failed</td>
+ </tr>
+ <tr>
+ <td colspan="2"></td>
+ <td class="count" id="commandErrors">0</td>
+ <td>incomplete</td>
+ </tr>
+ </table>
- <fieldset>
- <legend>Tools</legend>
+ <fieldset>
+ <legend>Tools</legend>
- <button type="button" id="domViewer1" onclick="openDomViewer();">
- View DOM
- </button>
- <button type="button" onclick="LOG.show();">
- Show Log
- </button>
+ <button type="button" id="domViewer1" onClick="openDomViewer();">
+ View DOM
+ </button>
+ <button type="button" onClick="LOG.show();">
+ Show Log
+ </button>
- </fieldset>
+ </fieldset>
- </td>
- </tr>
+ </td>
+ </tr>
+ </table>
+</td>
+</tr>
- <!-- AUT -->
+<!-- AUT -->
- <tr>
- <td colspan="3" height="70%">
- <iframe name="myiframe" id="myiframe" src="splash_html"></iframe>
- </td>
- </tr>
+<tr>
+ <td colspan="3" height="70%">
+ <iframe name="myiframe" id="myiframe" src="TestRunner-splash.html" tal:attributes="src string:${URL}/TestRunner-splash.html"></iframe>
+ </td>
+</tr>
+
</form>
</table>
- </body>
+</body>
</html>
Copied: Zelenium/trunk/www/testPrompt.zpt (from rev 82197, Zelenium/branches/gotcha-selenium-0.8.3/www/testPrompt.zpt)
===================================================================
--- Zelenium/trunk/www/testPrompt.zpt (rev 0)
+++ Zelenium/trunk/www/testPrompt.zpt 2007-12-08 14:29:34 UTC (rev 82198)
@@ -0,0 +1,123 @@
+<html tal:define="URL context/absolute_url;">
+<!--
+Copyright 2004 ThoughtWorks, Inc
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<head>
+ <meta content="text/html; charset=ISO-8859-1"
+ http-equiv="content-type">
+ <title>Select a Test Suite</title>
+ <script language="JavaScript" type="text/javascript" src="scripts/selenium-browserdetect.js" tal:attributes="src string:${URL}/scripts/selenium-browserdetect.js"></script>
+ <script>
+
+ function load() {
+ if (browserVersion.isHTA) {
+ document.getElementById("save-div").style.display = "inline";
+ }
+ }
+
+ function autoCheck() {
+ var auto = document.getElementById("auto");
+ var autoDiv = document.getElementById("auto-div");
+ if (auto.checked) {
+ autoDiv.style.display = "inline";
+ } else {
+ autoDiv.style.display = "none";
+ }
+ }
+
+ function saveCheck() {
+ var results = document.getElementById("results");
+ var check = document.getElementById("save").checked;
+ if (check) {
+ results.firstChild.nodeValue = "Results file ";
+ document.getElementById("resultsUrl").value = "results.html";
+ } else {
+ results.firstChild.nodeValue = "Results URL ";
+ document.getElementById("resultsUrl").value = "../postResults";
+ }
+ }
+
+ function go() {
+ if (!browserVersion.isHTA) return true;
+ var inputs = document.getElementsByTagName("input");
+ var queryString = "";
+ for (var i = 0; i < inputs.length; i++) {
+ var elem = inputs[i];
+ var name = elem.name;
+ var value = elem.value;
+ if (elem.type == "checkbox") {
+ value = elem.checked;
+ }
+ queryString += escape(name) + "=" + escape(value);
+ if (i < (inputs.length - 1)) {
+ queryString += "&";
+ }
+ }
+
+ window.parent.selenium = null;
+ window.parent.htmlTestRunner.controlPanel.queryString = queryString;
+ window.parent.htmlTestRunner.loadSuiteFrame();
+ return false;
+ }
+ </script>
+</head>
+
+<body onload="load()" style="font-size: x-small">
+<form id="prompt" target="_top" method="GET" onsubmit="return go();" action="TestRunner.html">
+
+ <p>
+ Test Suite:
+ <input id="test" name="test" size="30" value="../test_suite_html"/>
+ </p>
+
+ <p align="center"><input type="submit" value="Go"/></p>
+
+ <fieldset>
+ <legend>Options</legend>
+
+ <p>
+ <input id="multiWindow" type="checkbox" name="multiWindow" onclick="autoCheck();"/> <label
+ for="multiWindow">AUT in separate window</label>
+
+ <p>
+
+ <p>
+ <input id="auto" type="checkbox" name="auto" onclick="autoCheck();"/> <label for="auto">Run
+ automatically</label>
+ </p>
+
+ <div id="auto-div" style="display: none">
+ <p>
+ <input id="close" type="checkbox" name="close"/> <label for="close">Close afterwards </label>
+ </p>
+
+ <div id="save-div" style="display: none">
+ <br/><label for="save">Save to file </label><input id="save" type="checkbox" name="save"
+ onclick="saveCheck();"/>
+ </div>
+
+ <p id="results">
+ Results URL:
+ <input id="resultsUrl" name="resultsUrl" value="../postResults"/>
+ </p>
+
+ </div>
+ </fieldset>
+
+
+</form>
+</body>
+</html>
Modified: Zelenium/trunk/zuite.py
===================================================================
--- Zelenium/trunk/zuite.py 2007-12-08 13:40:46 UTC (rev 82197)
+++ Zelenium/trunk/zuite.py 2007-12-08 14:29:34 UTC (rev 82198)
@@ -69,12 +69,13 @@
return File( id=id, title='', file=open(path).read() )
-for filename in os.listdir(_SUPPORT_DIR):
- ignored, extension = os.path.splitext(filename)
- if extension.lower() in ('.js', '.html', '.css', '.png'):
- _SUPPORT_FILES[filename] = _makeFile( filename, prefix=_SUPPORT_DIR )
+def registerFiles(directory, prefix):
+ for filename in os.listdir(directory):
+ ignored, extension = os.path.splitext(filename)
+ if extension.lower() in ('.js', '.html', '.css', '.png'):
+ _SUPPORT_FILES['%s_%s' % (prefix, filename)] = _makeFile( filename, prefix=directory)
_MARKER = object()
@@ -130,6 +131,7 @@
filename_glob = ''
testsuite_name = ''
_v_filesystem_objects = None
+ _v_selenium_objects = None
_properties = ( { 'id' : 'test_case_metatypes'
, 'type' : 'lines'
@@ -164,6 +166,9 @@
security.declareProtected( View, 'splash_html' )
splash_html = PageTemplateFile( 'suiteSplash', _WWW_DIR )
+ security.declareProtected( View, 'test_prompt_html' )
+ test_prompt_html = PageTemplateFile( 'testPrompt', _WWW_DIR )
+
security.declareProtected(ManageSeleniumTestCases, 'manage_zipfile')
manage_zipfile = PageTemplateFile( 'suiteZipFile', _WWW_DIR )
@@ -180,6 +185,17 @@
, self._listFilesystemObjects()
).__of__( self )
+ localdefault = object()
+
+ value = proxy.get( key, localdefault )
+
+ if value is not localdefault:
+ return value
+
+ proxy = _FilesystemProxy( key
+ , self._listSeleniumObjects()
+ ).__of__( self )
+
value = proxy.get( key, default )
if value is not _MARKER:
@@ -400,13 +416,24 @@
return self._v_filesystem_objects
if not self.filesystem_path:
- return {}
+ return { 'testcases' : (), 'subdirs' : {} }
path = os.path.abspath( self.filesystem_path )
self._v_filesystem_objects = self._grubFilesystem( path )
return self._v_filesystem_objects
+ security.declarePrivate('_listSeleniumObjects')
+ def _listSeleniumObjects( self ):
+ """ Return a mapping of any filesystem objects we "hold".
+ """
+ if ( self._v_selenium_objects is not None and
+ not getConfiguration().debug_mode ):
+ return self._v_selenium_objects
+
+ self._v_selenium_objects = self._grubFilesystem(_SUPPORT_DIR)
+ return self._v_selenium_objects
+
security.declarePrivate('_grubFilesystem')
def _grubFilesystem( self, path ):
More information about the Checkins
mailing list