/testing/selenium-core/TestPrompt.html

http://datanucleus-appengine.googlecode.com/ · HTML · 145 lines · 109 code · 21 blank · 15 comment · 0 complexity · bf8b4bd8d8946b5182c8ed4017bbb116 MD5 · raw file

  1. <html>
  2. <!--
  3. Copyright 2004 ThoughtWorks, Inc
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.apache.org/licenses/LICENSE-2.0
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. -->
  14. <head>
  15. <meta content="text/html; charset=ISO-8859-1"
  16. http-equiv="content-type">
  17. <title>Select a Test Suite</title>
  18. <script language="JavaScript" type="text/javascript" src="scripts/selenium-browserdetect.js"></script>
  19. <script language="JavaScript" type="text/javascript" src="scripts/xmlextras.js"></script>
  20. <script>
  21. function load() {
  22. if (browserVersion.isHTA) {
  23. document.getElementById("save-div").style.display = "inline";
  24. }
  25. if (/thisIsSeleniumServer/.test(window.location.search)) {
  26. document.getElementById("slowResources-div").style.display = "inline";
  27. if (browserVersion.isHTA || browserVersion.isChrome) {
  28. document.getElementById("test").value = "http://localhost:4444/selenium-server/tests/TestSuite.html";
  29. }
  30. }
  31. }
  32. function autoCheck() {
  33. var auto = document.getElementById("auto");
  34. var autoDiv = document.getElementById("auto-div");
  35. if (auto.checked) {
  36. autoDiv.style.display = "inline";
  37. } else {
  38. autoDiv.style.display = "none";
  39. }
  40. }
  41. function slowCheck() {
  42. var slowResourcesCheckbox = document.getElementById("slowResources");
  43. var slowResources = slowResourcesCheckbox.checked ? true : false;
  44. var xhr = XmlHttp.create();
  45. var driverUrl = "http://localhost:4444/selenium-server/driver/?cmd=slowResources&1=" + slowResources;
  46. xhr.open("GET", driverUrl, true);
  47. xhr.send(null);
  48. }
  49. function saveCheck() {
  50. var results = document.getElementById("results");
  51. var check = document.getElementById("save").checked;
  52. if (check) {
  53. results.firstChild.nodeValue = "Results file ";
  54. document.getElementById("resultsUrl").value = "results.html";
  55. } else {
  56. results.firstChild.nodeValue = "Results URL ";
  57. document.getElementById("resultsUrl").value = "../postResults";
  58. }
  59. }
  60. function go() {
  61. if (!browserVersion.isHTA) return true;
  62. var inputs = document.getElementsByTagName("input");
  63. var queryString = "";
  64. for (var i = 0; i < inputs.length; i++) {
  65. var elem = inputs[i];
  66. var name = elem.name;
  67. var value = elem.value;
  68. if (elem.type == "checkbox") {
  69. value = elem.checked;
  70. }
  71. queryString += escape(name) + "=" + escape(value);
  72. if (i < (inputs.length - 1)) {
  73. queryString += "&";
  74. }
  75. }
  76. window.parent.selenium = null;
  77. window.parent.htmlTestRunner.controlPanel.queryString = queryString;
  78. window.parent.htmlTestRunner.loadSuiteFrame();
  79. return false;
  80. }
  81. </script>
  82. </head>
  83. <body onload="load()" style="font-size: x-small">
  84. <form id="prompt" target="_top" method="GET" onsubmit="return go();" action="TestRunner.html">
  85. <p>
  86. Test Suite:
  87. <input id="test" name="test" size="30" value="../tests/TestSuite.html"/>
  88. </p>
  89. <p align="center"><input type="submit" value="Go"/></p>
  90. <fieldset>
  91. <legend>Options</legend>
  92. <p>
  93. <input id="multiWindow" type="checkbox" name="multiWindow" onclick="autoCheck();"/> <label
  94. for="multiWindow">AUT in separate window</label>
  95. <p>
  96. <div id="slowResources-div" style="display: none">
  97. <p>
  98. <input id="slowResources" type="checkbox" name="slowResources" onclick="slowCheck();" /> <label for="slowResources">Slow down web server</label>
  99. </p>
  100. </div>
  101. <p>
  102. <input id="auto" type="checkbox" name="auto" onclick="autoCheck();"/> <label for="auto">Run
  103. automatically</label>
  104. </p>
  105. <div id="auto-div" style="display: none">
  106. <p>
  107. <input id="close" type="checkbox" name="close"/> <label for="close">Close afterwards </label>
  108. </p>
  109. <div id="save-div" style="display: none">
  110. <br/><label for="save">Save to file </label><input id="save" type="checkbox" name="save"
  111. onclick="saveCheck();"/>
  112. </div>
  113. <p id="results">
  114. Results URL:
  115. <input id="resultsUrl" name="resultsUrl" value="../postResults"/>
  116. </p>
  117. </div>
  118. </fieldset>
  119. </form>
  120. </body>
  121. </html>