diff options
Diffstat (limited to 'tests/FunctionalTests/selenium/php')
-rw-r--r-- | tests/FunctionalTests/selenium/php/TestRunner.php | 214 | ||||
-rw-r--r-- | tests/FunctionalTests/selenium/php/selenium.php | 8 |
2 files changed, 119 insertions, 103 deletions
diff --git a/tests/FunctionalTests/selenium/php/TestRunner.php b/tests/FunctionalTests/selenium/php/TestRunner.php index fb3cefb3..9bb5ada3 100644 --- a/tests/FunctionalTests/selenium/php/TestRunner.php +++ b/tests/FunctionalTests/selenium/php/TestRunner.php @@ -1,7 +1,8 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> + <html> + <head> -<HTA:APPLICATION ID="SeleniumTestRunner" APPLICATIONNAME="Selenium" > +<HTA:APPLICATION ID="SeleniumHTARunner" APPLICATIONNAME="Selenium" > <!-- the previous line is only relevant if you rename this file to "TestRunner.hta" --> @@ -24,40 +25,47 @@ Copyright 2004 ThoughtWorks, Inc --> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" /> -<title>Prado Functional Test Runner</title> -<link rel="stylesheet" type="text/css" href="<?php echo $base_dir; ?>selenium.css" /> -<script language="JavaScript" type="text/javascript" src="<?php echo $base_dir; ?>html-xpath/html-xpath-patched.js"></script> -<script language="JavaScript" type="text/javascript" src="<?php echo $base_dir; ?>selenium-browserbot.js"></script> -<script language="JavaScript" type="text/javascript" src="<?php echo $base_dir; ?>selenium-api.js"></script> -<script language="JavaScript" type="text/javascript" src="<?php echo $base_dir; ?>selenium-commandhandlers.js"></script> -<script language="JavaScript" type="text/javascript" src="<?php echo $base_dir; ?>selenium-executionloop.js"></script> -<script language="JavaScript" type="text/javascript" src="<?php echo $base_dir; ?>selenium-testrunner.js"></script> -<script language="JavaScript" type="text/javascript" src="<?php echo $base_dir; ?>selenium-logging.js"></script> -<script language="JavaScript" type="text/javascript" src="<?php echo $base_dir; ?>htmlutils.js"></script> -<script language="JavaScript" type="text/javascript" src="<?php echo $base_dir; ?>xpath.js"></script> +<title>Selenium Functional Test Runner</title> +<link rel="stylesheet" type="text/css" href="<?php echo $base_dir; ?>core/selenium.css" /> +<script language="JavaScript" type="text/javascript" src="<?php echo $base_dir; ?>core/scripts/selenium-browserdetect.js"></script> +<script language="JavaScript" type="text/javascript" src="<?php echo $base_dir; ?>core/scripts/selenium-browserbot.js"></script> +<script language="JavaScript" type="text/javascript" src="<?php echo $base_dir; ?>core/scripts/prototype-1.4.0.js"></script> +<script language="JavaScript" type="text/javascript" src="<?php echo $base_dir; ?>core/scripts/find_matching_child.js"></script> +<script language="JavaScript" type="text/javascript" src="<?php echo $base_dir; ?>core/scripts/selenium-api.js"></script> +<script language="JavaScript" type="text/javascript" src="<?php echo $base_dir; ?>core/scripts/selenium-commandhandlers.js"></script> +<script language="JavaScript" type="text/javascript" src="<?php echo $base_dir; ?>core/scripts/selenium-executionloop.js"></script> +<script language="JavaScript" type="text/javascript" src="<?php echo $base_dir; ?>core/scripts/selenium-testrunner.js"></script> +<script language="JavaScript" type="text/javascript" src="<?php echo $base_dir; ?>core/scripts/selenium-logging.js"></script> +<script language="JavaScript" type="text/javascript" src="<?php echo $base_dir; ?>core/scripts/selenium-version.js"></script> +<script language="JavaScript" type="text/javascript" src="<?php echo $base_dir; ?>core/scripts/htmlutils.js"></script> +<script language="JavaScript" type="text/javascript" src="<?php echo $base_dir; ?>core/xpath/misc.js"></script> +<script language="JavaScript" type="text/javascript" src="<?php echo $base_dir; ?>core/xpath/dom.js"></script> +<script language="JavaScript" type="text/javascript" src="<?php echo $base_dir; ?>core/xpath/xpath.js"></script> <script language="JavaScript" type="text/javascript" src="<?php echo $base_dir; ?>prado-functional-test.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('<?php echo $base_dir; ?>domviewer.html'); + var domViewer = window.open('<?php echo $base_dir; ?>core/domviewer/domviewer.html'); return false; } - - Logger.prototype.openLogWindow = function() { + + Logger.prototype.openLogWindow = function() + { this.logWindow = window.open( - "<?php echo $base_dir; ?>SeleniumLog.html", "SeleniumLog", + "<?php echo $base_dir; ?>core/SeleniumLog.html", "SeleniumLog", "width=600,height=250,bottom=0,right=0,status,scrollbars,resizable" ); return this.logWindow; - }; + } - var post_results_to = "<?php echo $driver; ?>"; + var post_results_to = "<?php echo $driver; ?>"; + </script> </head> -<body onload="start();"> +<body onLoad="start();"> <table class="layout"> <form action="" name="controlPanel"> @@ -65,92 +73,98 @@ Copyright 2004 ThoughtWorks, Inc <!-- Suite, Test, Control Panel --> <tr class="selenium"> - <td width="25%" height="30%" rowspan="2"><iframe name="testSuiteFrame" id="testSuiteFrame" src="<?php echo $driver; ?>?testSuites"></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> - - <tr class="selenium"> - <td width="25%" height="30%" id="controlPanel"> - - <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> - - <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> - - <button type="button" id="domViewer1" onclick="openDomViewer();"> - View DOM - </button> - <button type="button" onclick="LOG.show();"> - Show Log - </button> - - </fieldset> - - </td> - </tr> + <td width="25%" height="30%" ><iframe name="testSuiteFrame" id="testSuiteFrame" src="<?php echo $driver; ?>?testSuites" application="yes"></iframe></td> + <td width="50%" height="30%" ><iframe name="testFrame" id="testFrame" application="yes"></iframe></td> + + <td width="25%"> + <table class="layout"> + <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> + + <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> + + <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> + + <button type="button" id="domViewer1" onClick="openDomViewer();"> + View DOM + </button> + <button type="button" onClick="LOG.show();"> + Show Log + </button> + + </fieldset> + + </td> + </tr> + </table> + </td> + </tr> <!-- AUT --> <tr> - <td colspan="3" height="70%"><iframe name="myiframe" id="myiframe" src="<?php echo $base_dir; ?>TestRunner-splash.html"></iframe></td> + <td colspan="3" height="70%"><iframe name="myiframe" id="myiframe" src="<?php echo $base_dir; ?>core/TestRunner-splash.html"></iframe></td> </tr> </form> </table> </body> -</html> +</html>
\ No newline at end of file diff --git a/tests/FunctionalTests/selenium/php/selenium.php b/tests/FunctionalTests/selenium/php/selenium.php index 4a4c6e19..960791b8 100644 --- a/tests/FunctionalTests/selenium/php/selenium.php +++ b/tests/FunctionalTests/selenium/php/selenium.php @@ -112,15 +112,17 @@ class SeleneseInterpreter public function __call($func, $args) { if($func{0} == '_') return; + $ID = isset($args[0]) ? $args[0] : ""; - //if($ID instanceof TControl) - // $ID = $ID->ClientID; $value = isset($args[1]) ? $args[1] : ""; if(strpos(strtolower($func),'htmlpresent') || strpos(strtolower($func),'htmlnotpresent')) $ID = htmlspecialchars($ID); - //$command = "|{$func}|{$ID}|{$value}|"; $command = array($func, $ID, $value); $trace = debug_backtrace(); + + if(is_int(strpos(strtolower($func), 'visible'))) + $this->addCommand(array('pause','500',''),$trace); + return $this->addCommand($command, $trace); } |