diff options
author | xue <> | 2005-12-05 01:00:16 +0000 |
---|---|---|
committer | xue <> | 2005-12-05 01:00:16 +0000 |
commit | ccf76e430b7703db028966a845a966f50956f490 (patch) | |
tree | 9762b746f8b7d432dbe5e5cb8f38f90007e0e1b5 /framework/Web/Javascripts/tests | |
parent | 418baf36d477bcbdd6fb4eaf4037ea6a2d93f21c (diff) |
Diffstat (limited to 'framework/Web/Javascripts/tests')
22 files changed, 1443 insertions, 0 deletions
diff --git a/framework/Web/Javascripts/tests/CompareValidator.html b/framework/Web/Javascripts/tests/CompareValidator.html new file mode 100644 index 00000000..1a41fd11 --- /dev/null +++ b/framework/Web/Javascripts/tests/CompareValidator.html @@ -0,0 +1,95 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
+ <meta http-equiv="Content-Style-Type" content="text/css" />
+ <title>Prado Client-Side CompareValidator Tests</title>
+<!-- base files -->
+<script type="text/javascript" src="../../base.js"></script>
+<script type="text/javascript" src="../../dom.js"></script>
+<script type="text/javascript" src="../prado/validation.js"></script>
+<script type="text/javascript" src="../prado/validators.js"></script>
+<style type="text/css">
+/*<![CDATA[*/
+
+ .message
+ {
+ color: red;
+ }
+ .required, .required1, .required2
+ {
+ border: 1px solid red;
+ }
+/*]]>*/
+</style>
+ </head>
+
+ <body>
+ <h1>Prado Client-Side CompareValidator Tests</h1>
+
+<form id="form1" action="#">
+
+<!-- group 1 -->
+<div>
+ <div>
+ <input type="text" id="text1" name="text1" />
+ <input type="text" id="text2" name="text2" />
+ <span id="validator1" class="message" style="display:none">Must match</span>
+ </div>
+
+ <div>
+ <input type="text" id="text3" name="text3" />
+ <span id="validator2" class="message" style="display:none">Must equal "me!"</span>
+ </div>
+
+ <div>
+ <input type="text" id="text4" name="text4" />
+ <span id="validator3" class="message" style="display:none">Must be a date (d/m/Y)</span>
+ </div>
+ <input type="submit" value="Test" id="submit1" />
+</div>
+ <script type="text/javascript">
+ <!--
+ /*]]>*/
+ if(typeof(Prado) != "undefined" && typeof(Prado.Validation) != "undefined")
+ {
+ Prado.Validation.AddForm("form1");
+
+ var val1 = {id : "validator1",
+ controltovalidate : "text1",
+ errormessage : "*",
+ display : "Dynamic",
+ controlcssclass : "required",
+ controlhookup : "text2"};
+ new Prado.Validation(Prado.Validation.TCompareValidator, val1);
+
+ var val1 = {id : "validator2",
+ controltovalidate : "text3",
+ errormessage : "*",
+ display : "Dynamic",
+ controlcssclass : "required",
+ valuetocompare : "me!"};
+ new Prado.Validation(Prado.Validation.TCompareValidator, val1);
+
+ var val1 = {id : "validator3",
+ controltovalidate : "text4",
+ errormessage : "*",
+ display : "Dynamic",
+ controlcssclass : "required",
+ operator : "DataTypeCheck",
+ type : "Date",
+ dateformat : "%d/%m/%Y"};
+ new Prado.Validation(Prado.Validation.TCompareValidator, val1);
+
+ Prado.Validation.AddTarget("submit1");
+ }
+
+ /*]]>*/
+ //-->
+ </script>
+</form>
+
+ </body>
+</html>
+
diff --git a/framework/Web/Javascripts/tests/CustomValidator.html b/framework/Web/Javascripts/tests/CustomValidator.html new file mode 100644 index 00000000..34303781 --- /dev/null +++ b/framework/Web/Javascripts/tests/CustomValidator.html @@ -0,0 +1,74 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
+ <meta http-equiv="Content-Style-Type" content="text/css" />
+ <title>Prado Client-Side CustomValidator Tests</title>
+<!-- base files -->
+<script type="text/javascript" src="../../base.js"></script>
+<script type="text/javascript" src="../../dom.js"></script>
+<script type="text/javascript" src="../prado/validation.js"></script>
+<script type="text/javascript" src="../prado/validators.js"></script>
+<style type="text/css">
+/*<![CDATA[*/
+
+ .message
+ {
+ color: red;
+ }
+ .required, .required1, .required2
+ {
+ border: 1px solid red;
+ }
+/*]]>*/
+</style>
+ </head>
+
+ <body>
+ <h1>Prado Client-Side CustomValidator Tests</h1>
+
+<form id="form1" action="#">
+
+<!-- group 1 -->
+<div>
+ <input type="text" id="text1" name="text1" />
+ <span id="validator1" class="message" style="display:none">*</span>
+ <input type="submit" value="Test" id="submit1" />
+</div>
+ <script type="text/javascript">
+ <!--
+ /*]]>*/
+ if(typeof(Prado) != "undefined" && typeof(Prado.Validation) != "undefined")
+ {
+ Prado.Validation.AddForm("form1");
+
+ var val1 = {id : "validator1",
+ controltovalidate : "text1",
+ errormessage : "*",
+ display : "Dynamic",
+ controlcssclass : "required2",
+ clientvalidationfunction : "CustomValidation"};
+ new Prado.Validation(Prado.Validation.TCustomValidator, val1);
+ Prado.Validation.AddTarget("submit1");
+ }
+
+ function CustomValidation(validator, value)
+ {
+ //call a custom callback function
+ setTimeout(callback.bind(validator), 500);
+ return false;
+ }
+
+ function callback()
+ {
+ this.setValid(true);
+ }
+ /*]]>*/
+ //-->
+ </script>
+</form>
+
+ </body>
+</html>
+
diff --git a/framework/Web/Javascripts/tests/DatePicker.html b/framework/Web/Javascripts/tests/DatePicker.html new file mode 100644 index 00000000..d173006d --- /dev/null +++ b/framework/Web/Javascripts/tests/DatePicker.html @@ -0,0 +1,99 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>Prado Date Picker</title>
+ <script type="text/javascript" src="../../base.js"></script>
+ <script type="text/javascript" src="../../dom.js"></script>
+ <script type="text/javascript" src="../../datepicker.js"></script>
+<script type="text/javascript">
+
+ function init() {
+ var options = { "trigger" : "button1", "format" : "dd-MM-yyyy" };
+ var datepicker1 = new Prado.Calendar("textfield1", options);
+ //datepicker1.format = "yyyy-MM-d";
+ //datepicker1.create();
+ //datepicker1.show("button1");
+ //var button = $("button1");
+ //Event.observe(button, "click", function(){datepicker1.show(button);});
+ //var d = new Date();
+ //alert(Prado.Calendar.Util.ISODate(d));
+ var datepicker2 = new Prado.Calendar("textfield2");
+ }
+
+ /*var cal;
+
+ function init() {
+ cal = new Calendar();
+ cal.setIncludeWeek(true);
+ cal.setFormat("yyyy-MM-dd");
+ //cal.setMonthNames(.....);
+ //cal.setShortMonthNames(....);
+ cal.create();
+
+ var button = $("button1");
+ button.onclick = function() {
+ cal.toggle(button);
+ }
+ cal.onchange = function() {
+ $("textfield1").value = cal.formatDate();
+ }
+ }*/
+
+ window.onload = init;
+ </script>
+</script>
+</head>
+
+<body>
+<form ID=Form1>
+ <input type="text" name="textfield1" id="textfield1" />
+ <input type="button" name="button1" id="button1" value="..." />
+</form>
+
+
+as<br/>
+dv<br/>
+as<br/>
+d<br/>
+as<br/>
+d<br/>
+asd<br/>
+a<br/>
+sd<br/>
+dv<br/>
+as<br/>
+d<br/>
+as<br/>
+d<br/>
+asd<br/>
+a<br/>
+sd<br/>
+dv<br/>
+as<br/>
+d<br/>
+as<br/>
+d<br/>
+asd<br/>
+a<br/>
+sd<br/>
+<form>
+ <input type="text" name="textfield2" id="text1" />
+ <input type="button" name="button2" id="button2" value="..." />
+</form>
+d<br/>
+as<br/>
+d<br/>
+asd<br/>
+a<br/>
+sd<br/>
+dv<br/>
+as<br/>
+d<br/>
+as<br/>
+d<br/>
+asd<br/>
+a<br/>
+sd<br/>
+</body>
+</html>
diff --git a/framework/Web/Javascripts/tests/Effects.html b/framework/Web/Javascripts/tests/Effects.html new file mode 100644 index 00000000..6ee5324b --- /dev/null +++ b/framework/Web/Javascripts/tests/Effects.html @@ -0,0 +1,124 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<head>
+ <title>Effects demo page</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <script type="text/javascript" src="../../base.js"></script>
+ <script type="text/javascript" src="../../dom.js"></script>
+ <script type="text/javascript" src="../../effects.js"></script>
+</head>
+
+<body style="font: 0.9em Arial;background: #f5f5f5;">
+<h1>Effect.Fade()</h1>
+
+<p>Call with <code>new Effect.Fade(element)</code></p>
+<p>Example: <code>onclick="new Effect.Fade(this)"</code></p>
+
+<div id="fade" onclick="new Effect.Fade(this)" style="border:1px solid red; padding:1em;">
+ Click here or the image to start effect
+</div>
+
+
+<h1>Effect.Highlight()</h1>
+
+<p>Call with <code>new Effect.Highlight(element)</code></p>
+<p>Example: <code>onclick="new Effect.Highlight(this)"</code></p>
+
+<div id="fade" onclick="new Effect.Highlight(this)" style="border:1px solid red; padding:1em;">
+ Click here or the image to start effect
+</div>
+
+<h1>Effect.Appear()</h1>
+
+<p>Call with <code>new Effect.Appear(element)</code></p>
+<p>Example: <code>onclick="new Effect.Appear('appear')"</code></p>
+
+<a href="#" onclick="new Effect.Appear('appear')">Start effect</a>
+
+<div id="appear" style="border:1px solid red; padding:1em;display:none;background:#fff;">
+ This is just some text
+</div>
+
+<h1>Effect.Scale()</h1>
+
+<p>Call with <code>new Effect.Scale(element, percent)</code></p>
+<p>Note: if you scale a div, all contained elements must have width or height set with <tt>em</tt>. If you
+scale an image, width and height are not required to be set. Also, Effect.Scale is aware of other scaling effects done on
+the target element, and will act accordingly. The <tt>percent</tt> parameter is always relative of the original size of the element.</p>
+<p>Example: <code>onmouseover="new Effect.Scale('scale',150)" onmouseout="new Effect.Scale('scale',100)"</code></p>
+
+<div style="height:100px">
+<img src="fungii_logo.gif" style="width:130px;" onmouseover="new Effect.Scale(this,150)" onmouseout="new Effect.Scale(this,100)"/>
+<img src="fungii_logo.gif" style="width:130px;" onmouseover="new Effect.Scale(this,150)" onmouseout="new Effect.Scale(this,100)"/>
+<img src="fungii_logo.gif" style="width:130px;" onmouseover="new Effect.Scale(this,150)" onmouseout="new Effect.Scale(this,100)"/>
+<img src="fungii_logo.gif" style="width:130px;" onmouseover="new Effect.Scale(this,150)" onmouseout="new Effect.Scale(this,100)"/>
+</div>
+
+<h1>Effect.Squish()</h1>
+<p>Call with <code>new Effect.Squish(element)</code></p>
+<div id="squish" style="border:1px solid red; width:250px; height:150px;background:#fff;" onclick="new Effect.Squish(this)">
+ Click me to squish.<br/>
+ <img src="fungii_logo.gif" style="width:100%;" />
+
+</div>
+
+<h1>Effect.Puff()</h1>
+<p>Call with <code>new Effect.Puff(element)</code></p>
+<p>Works with absolute and relative positioned elements. In this example, divs with <tt>float:left</tt> are used.</p>
+<div id="puff1" style="float:left;margin-right:1em;border:1px solid red; padding:1em;width:10em;height:5em;background:#fff;" onclick="new Effect.Puff(this)">
+ (floating) Click me to puff.<br/>
+ <img src="fungii_logo.gif" style="width:8em" />
+
+</div>
+<div id="puff2" style="float:left;margin-right:1em;border:1px solid red; padding:1em;width:10em;height:5em;background:#f8f;" onclick="new Effect.Puff(this)">
+ (floating) Click me to puff.<br/>
+ <img src="fungii_logo.gif" style="width:8em" />
+</div>
+<div id="puff3" style="float:left;margin-right:1em;border:1px solid red; padding:1em;width:10em;height:5em;background:#ff8;" onclick="new Effect.Puff(this)">
+ (floating) Click me to puff.<br/>
+ <img src="fungii_logo.gif" style="width:8em" />
+</div>
+<div id="puff4" style="float:left;margin-right:1em;border:1px solid red; padding:1em;width:10em;height:5em;background:#fff;" onclick="new Effect.Puff(this)">
+ (floating) Click me to puff.<br/>
+
+ <img src="fungii_logo.gif" style="width:8em" />
+</div>
+<div id="puff5" style="float:left;margin-right:1em;border:1px solid red; padding:1em;width:10em;height:5em;background:#f8f;" onclick="new Effect.Puff(this)">
+ (floating) Click me to puff.<br/>
+ <img src="fungii_logo.gif" style="width:8em" />
+</div>
+<div id="puff6" style="float:left;margin-right:1em;border:1px solid red; padding:1em;width:10em;height:5em;background:#ff8;" onclick="new Effect.Puff(this)">
+ (floating) Click me to puff.<br/>
+ <img src="fungii_logo.gif" style="width:8em" />
+</div>
+
+<div id="puff11" style="float:left;margin-right:1em;border:1px solid red; padding:1em;width:10em;height:5em;background:#fff;" onclick="new Effect.Puff(this)">
+ (floating) Click me to puff.<br/>
+ <img src="fungii_logo.gif" style="width:8em" />
+</div>
+<div id="puff12" style="float:left;margin-right:1em;border:1px solid red; padding:1em;width:10em;height:5em;background:#f8f;" onclick="new Effect.Puff(this)">
+ (floating) Click me to puff.<br/>
+ <img src="fungii_logo.gif" style="width:8em" />
+</div>
+<div id="puff13" style="float:left;margin-right:1em;border:1px solid red; padding:1em;width:10em;height:5em;background:#ff8;" onclick="new Effect.Puff(this)">
+ (floating) Click me to puff.<br/>
+
+ <img src="fungii_logo.gif" style="width:8em" />
+</div>
+<div id="puff14" style="float:left;margin-right:1em;border:1px solid red; padding:1em;width:10em;height:5em;background:#fff;" onclick="new Effect.Puff(this)">
+ (floating) Click me to puff.<br/>
+ <img src="fungii_logo.gif" style="width:8em" />
+</div>
+<div id="puff15" style="float:left;margin-right:1em;border:1px solid red; padding:1em;width:10em;height:5em;background:#f8f;" onclick="new Effect.Puff(this)">
+ (floating) Click me to puff.<br/>
+ <img src="fungii_logo.gif" style="width:8em" />
+</div>
+
+<div id="puff16" style="float:left;margin-right:1em;border:1px solid red; padding:1em;width:10em;height:5em;background:#ff8;" onclick="new Effect.Puff(this)">
+ (floating) Click me to puff.<br/>
+ <img src="fungii_logo.gif" style="width:8em" />
+</div>
+
+</body>
+</html>
\ No newline at end of file diff --git a/framework/Web/Javascripts/tests/Form.disable.html b/framework/Web/Javascripts/tests/Form.disable.html new file mode 100644 index 00000000..5ff5f7d6 --- /dev/null +++ b/framework/Web/Javascripts/tests/Form.disable.html @@ -0,0 +1,37 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<head>
+ <title>Form disable test</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <script src="../dist/prototype.js"></script>
+</head>
+
+<body style="font: 0.9em Arial;background: #f5f5f5;">
+
+<form id="test" method="post">
+Number
+ <select name="guest[size]">
+ <option value="0"
+ > 0
+ </option>
+ <option value="1"
+ selected > 1
+ </option>
+ <option value="2"
+ > 2
+ </option>
+ </select>
+
+<label for="text">Text</label></td>
+<input id="form_text" name="form[text]" size="30" type="text" value="" /><br/>
+<label for="form_radio">Radio</label></td>
+<td>
+ <input id="form_radio_yes" name="form[radio]" size="30" type="radio" value="1" />yes
+ <input id="form_radio_no" name="form[radio]" size="30" type="radio" value="0" />no
+
+</td>
+</form>
+<p>
+<a href="#" onClick="Form.disable(document.forms['test']);">disable</a>
+<a href="#" onClick="Form.enable(document.forms['test']);">enable</a>
diff --git a/framework/Web/Javascripts/tests/Insertion.html b/framework/Web/Javascripts/tests/Insertion.html new file mode 100644 index 00000000..1aefd3aa --- /dev/null +++ b/framework/Web/Javascripts/tests/Insertion.html @@ -0,0 +1,47 @@ +<html>
+<head>
+ <script type="text/javascript" src="../../base.js"></script>
+ <script type="text/javascript" src="../../dom.js"></script>
+ <script type="text/javascript" src="../../form.js"></script>
+ <script type="text/javascript">
+ function test() {
+ var type = Form.Element.getValue('type');
+ var html = '<div>' + Form.Element.getValue('content') + '</div>';
+ new Insertion[type]($('a'), html);
+ return false;
+ }
+ </script>
+
+ <style type="text/css">
+ div#a {
+ border: 2px solid blue;
+ padding: 10px;
+ margin-bottom: 10px;
+ }
+
+ div#a div {
+ border: 1px solid red;
+ padding: 5px;
+ }
+
+ textarea {
+ display: block;
+ }
+ </style>
+</head>
+<body>
+ <div id="a">
+ content
+ </div>
+ <fieldset>
+ <textarea id="content" rows="10" cols="60"></textarea>
+ <select id="type">
+ <option value="Before">Before</option>
+ <option value="Top">Top</option>
+ <option value="Bottom">Bottom</option>
+ <option value="After">After</option>
+ </select>
+ <button onclick="return test()">Create Insertion</button>
+ </fieldset>
+</body>
+</html>
\ No newline at end of file diff --git a/framework/Web/Javascripts/tests/PradoTestSuite.html b/framework/Web/Javascripts/tests/PradoTestSuite.html new file mode 100644 index 00000000..8b3c8ccf --- /dev/null +++ b/framework/Web/Javascripts/tests/PradoTestSuite.html @@ -0,0 +1,37 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <title>Prado Javascript Test Suite</title>
+ <link rel="stylesheet" type="text/css" href="jsunit/css/jsUnitStyle.css">
+<script language="JavaScript" type="text/javascript" src="jsunit/app/jsUnitCore.js"></script>
+<script language="JavaScript" type="text/javascript">
+function coreTestSuite() {
+ var newsuite = new top.jsUnitTestSuite();
+ return newsuite;
+}
+
+function validationTestSuite() {
+ var newsuite = new top.jsUnitTestSuite();
+ return newsuite;
+}
+
+function suite() {
+ var newsuite = new top.jsUnitTestSuite();
+ newsuite.addTestSuite(coreTestSuite());
+ newsuite.addTestSuite(validationTestSuite());
+ return newsuite;
+}
+</script>
+ </head>
+
+ <body>
+ <h1>Prado Javascript Test Suite</h1>
+
+ <p>This page contains a suite of tests for testing
+ Prado javascripts.</p>
+ </body>
+</html>
+
diff --git a/framework/Web/Javascripts/tests/RangeValidator.html b/framework/Web/Javascripts/tests/RangeValidator.html new file mode 100644 index 00000000..0dd3c283 --- /dev/null +++ b/framework/Web/Javascripts/tests/RangeValidator.html @@ -0,0 +1,65 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
+ <meta http-equiv="Content-Style-Type" content="text/css" />
+ <title>Prado Client-Side RangeValidator Tests</title>
+<!-- base files -->
+<script type="text/javascript" src="../../base.js"></script>
+<script type="text/javascript" src="../../dom.js"></script>
+<script type="text/javascript" src="../prado/validation.js"></script>
+<script type="text/javascript" src="../prado/validators.js"></script>
+<style type="text/css">
+/*<![CDATA[*/
+
+ .message
+ {
+ color: red;
+ }
+ .required, .required1, .required2
+ {
+ border: 1px solid red;
+ }
+/*]]>*/
+</style>
+ </head>
+
+ <body>
+ <h1>Prado Client-Side RangeValidator Tests</h1>
+
+<form id="form1" action="#">
+
+<!-- group 1 -->
+<div>
+ <input type="text" id="text1" name="text1" />
+ <span id="validator1" class="message" style="display:none">Numbers between 1 and 4</span>
+ <input type="submit" value="Test" id="submit1" />
+</div>
+ <script type="text/javascript">
+ <!--
+ /*]]>*/
+ if(typeof(Prado) != "undefined" && typeof(Prado.Validation) != "undefined")
+ {
+ Prado.Validation.AddForm("form1");
+
+ var val1 = {id : "validator1",
+ controltovalidate : "text1",
+ errormessage : "*",
+ display : "Dynamic",
+ controlcssclass : "required2",
+ minimumvalue : "1",
+ maximumvalue : "4",
+ type : "Integer"};
+ new Prado.Validation(Prado.Validation.TRangeValidator, val1);
+ Prado.Validation.AddTarget("submit1");
+ }
+
+ /*]]>*/
+ //-->
+ </script>
+</form>
+
+ </body>
+</html>
+
diff --git a/framework/Web/Javascripts/tests/RegularExpressionValidator.html b/framework/Web/Javascripts/tests/RegularExpressionValidator.html new file mode 100644 index 00000000..619ec6f5 --- /dev/null +++ b/framework/Web/Javascripts/tests/RegularExpressionValidator.html @@ -0,0 +1,72 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
+ <meta http-equiv="Content-Style-Type" content="text/css" />
+ <title>Prado Client-Side RegularExpressionValidator Tests</title>
+<!-- base files -->
+<script type="text/javascript" src="../../base.js"></script>
+<script type="text/javascript" src="../../dom.js"></script>
+<script type="text/javascript" src="../prado/validation.js"></script>
+<script type="text/javascript" src="../prado/validators.js"></script>
+<style type="text/css">
+/*<![CDATA[*/
+
+ .message
+ {
+ color: red;
+ }
+ .required, .required1, .required2
+ {
+ border: 1px solid red;
+ }
+/*]]>*/
+</style>
+ </head>
+
+ <body>
+ <h1>Prado Client-Side RegularExpressionValidator Tests</h1>
+
+<form id="form1" action="#">
+
+<!-- group 1 -->
+<div>
+ <input type="text" id="text1" name="text1" />
+ <span id="validator1" class="message" style="display:none">5 digits</span>
+ <span id="validator2" class="message" style="display:none">*</span>
+ <input type="submit" value="Test 1" id="submit1" />
+ <input type="submit" value="Test 2" id="submit2" />
+ <input type="submit" value="Test 3" id="submit3" />
+</div>
+ <script type="text/javascript">
+ <!--
+ /*]]>*/
+ if(typeof(Prado) != "undefined" && typeof(Prado.Validation) != "undefined")
+ {
+ Prado.Validation.AddForm("form1");
+ var val1 = {id : "validator1",
+ controltovalidate : "text1",
+ errormessage : "5 digits",
+ display : "Dynamic",
+ controlcssclass : "required1",
+ validationexpression : "^\\d{5}$"};
+ var val2 = {id : "validator2",
+ controltovalidate : "text1",
+ errormessage : "*",
+ display : "Dynamic",
+ controlcssclass : "required2",
+ initialvalue : ""};
+ new Prado.Validation(Prado.Validation.TRegularExpressionValidator, val1);
+ //new Prado.Validation(Prado.Validation.TRequiredFieldValidator, val2);
+ Prado.Validation.AddTarget("submit1");
+ Prado.Validation.AddTarget("submit2");
+ }
+ /*]]>*/
+ //-->
+ </script>
+</form>
+
+ </body>
+</html>
+
diff --git a/framework/Web/Javascripts/tests/RequiredFieldValidator.html b/framework/Web/Javascripts/tests/RequiredFieldValidator.html new file mode 100644 index 00000000..ae99d355 --- /dev/null +++ b/framework/Web/Javascripts/tests/RequiredFieldValidator.html @@ -0,0 +1,95 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
+ <meta http-equiv="Content-Style-Type" content="text/css" />
+ <title>Prado Client-Side RequiredFieldValidator Tests</title>
+<style type="text/css">
+/*<![CDATA[*/
+
+ .message
+ {
+ color: red;
+ }
+ .required
+ {
+ border: 1px solid red;
+ }
+/*]]>*/
+</style>
+
+ </head>
+
+ <body>
+ <h1>Prado Client-Side RequiredFieldValidator Tests</h1>
+
+<form action="" method="post" enctype="multipart/form-data" id="form1">
+<script type="text/javascript" src="../../js/base.js"></script>
+<script type="text/javascript" src="../../js/dom.js"></script>
+<script type="text/javascript" src="../prado/validation.js"></script>
+<script type="text/javascript" src="../prado/validators.js"></script>
+
+
+<!-- group 1 -->
+<div id="summary1"></div>
+<div>
+ <input id="text1" name="text1" type="text" value=""/>
+ <span id="validator1" class="message" style="display:none;"><a href="#text1" onclick="javascript:Prado.Validation.Util.focus('text1'); return false;" >text1!</a></span>
+
+ <span><input id="check1" type="checkbox" name="check1"/></span>
+ <span id="validator2" class="message" style="display:none;">check 1!</span>
+
+ <input id="submit1" type="submit" name="submit1" value="Group1"></input>
+
+</div>
+<!-- group 2 -->
+<div id="summary2"></div>
+<div>
+ <input id="text2" name="text2" type="text" value=""/>
+ <span id="validator3" class="message" style="visibility:hidden;">text2!</span>
+
+ <span><input id="check2" type="checkbox" name="check2"/></span>
+ <span id="validator4" class="message" style="visibility:hidden;">check 2!</span>
+
+ <input id="submit2" type="submit" name="submit2" value="Group2"></input>
+
+</div>
+
+<div id="summary3"></div>
+
+
+<input id="submit3" type="submit" name="submit3" value="Submit All"></input>
+<input id="submit4" type="submit" name="submit4" value="Submit By Pass"></input>
+
+
+
+<script type="text/javascript">
+//<![CDATA[
+
+ if(typeof(Prado) == 'undefined')
+ alert("Unable to find Prado javascript library '../../base.js'.");
+ else if(Prado.Version != 2.0)
+ alert("Prado javascript library version 2.0 required.");
+ else if(typeof(Prado.Validation) == 'undefined')
+ alert("Unable to find validation javascript library '../../validator.js'.");
+ else
+ Prado.Validation.AddForm('form1');
+
+new Prado.Validation.Summary({id:"summary1", form:"form1", displaymode:"BulletList", group:"group1"});
+new Prado.Validation(Prado.Validation.TRequiredFieldValidator, {id:"validator1", controltovalidate:"text1", errormessage:"<a href=\"#text1\" onclick=\"javascript:Prado.Validation.Util.focus(\'text1\'); return false;\" >text1!</a>", display:"Dynamic", controlcssclass:"required", initialvalue:""});
+new Prado.Validation(Prado.Validation.TRequiredFieldValidator, {id:"validator2", controltovalidate:"check1", errormessage:"check 1!", display:"Dynamic", controlcssclass:"required", initialvalue:""});
+Prado.Validation.AddGroup({id:"group1", target:"submit1"}, ["validator1", "validator2"]);
+Prado.Validation.AddTarget('submit1');
+
+new Prado.Validation.Summary({id:"summary2", form:"form1", displaymode:"BulletList", group:"group2"});
+new Prado.Validation(Prado.Validation.TRequiredFieldValidator, {id:"validator3", controltovalidate:"text2", errormessage:"text2!", controlcssclass:"required", initialvalue:""});
+new Prado.Validation(Prado.Validation.TRequiredFieldValidator, {id:"validator4", controltovalidate:"check2", errormessage:"check 2!", controlcssclass:"required", initialvalue:""});
+Prado.Validation.AddGroup({id:"group2", target:"submit2"}, ["validator3", "validator4"]);
+Prado.Validation.AddTarget('submit2');
+
+new Prado.Validation.Summary({id:"summary3", form:"form1", displaymode:"BulletList"});
+Prado.Validation.AddTarget('submit3');
+//]]>
+</script>
+</form>
\ No newline at end of file diff --git a/framework/Web/Javascripts/tests/RequiredListValidator.html b/framework/Web/Javascripts/tests/RequiredListValidator.html new file mode 100644 index 00000000..7e79e4af --- /dev/null +++ b/framework/Web/Javascripts/tests/RequiredListValidator.html @@ -0,0 +1,110 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
+ <meta http-equiv="Content-Style-Type" content="text/css" />
+ <title>Prado Client-Side RequiredListValidator Tests</title>
+<!-- base files -->
+<script type="text/javascript" src="../../base.js"></script>
+<script type="text/javascript" src="../prototype/dom.js"></script>
+<script type="text/javascript" src="../extended/dom.js"></script>
+<script type="text/javascript" src="../prototype/event.js"></script>
+<script type="text/javascript" src="../extended/event.js"></script>
+<script type="text/javascript" src="../prototype/form.js"></script>
+<script type="text/javascript" src="../prototype/position.js"></script>
+<script type="text/javascript" src="../prototype/string.js"></script>
+<script type="text/javascript" src="../extra/getElementsBySelector.js"></script>
+<script type="text/javascript" src="../extra/behaviour.js"></script>
+<script type="text/javascript" src="../prado/validation.js"></script>
+<script type="text/javascript" src="../prado/validators.js"></script>
+<style type="text/css">
+/*<![CDATA[*/
+
+ .message
+ {
+ color: red;
+ }
+ .required, .required1, .required2
+ {
+ border: 1px solid red;
+ }
+ .requirede
+ {
+ background-color: red;
+ }
+/*]]>*/
+</style>
+ </head>
+
+ <body>
+ <h1>Prado Client-Side RequiredListValidator Tests</h1>
+
+<form id="form1" action="#">
+
+<!-- group 1 -->
+<div>
+ <div id="checks">
+ <input type="checkbox" id="check1" name="check1[]" value="1" />1
+ <input type="checkbox" id="check2" name="check1[]" value="2" />2
+ <input type="checkbox" id="check3" name="check1[]" value="3" />3
+ <input type="checkbox" id="check4" name="check1[]" value="4" />4
+ <span id="validator1" class="message" style="display:none">Must select at least 1 and no more than 3</span>
+ </div>
+
+ <div>
+ <select id="select1" name="select1[]" multiple="multiple" size="5" style="width:10em">
+ <option value="one">one</option>
+ <option value="two">two</option>
+ <option value="three">three</option>
+ <option value="four">four</option>
+ <option value="five">five</option>
+ </select>
+ <span id="validator2" class="message" style="display:none">Must select at least 2 and no more than 3 and value "two"</span>
+ </div>
+
+ <input type="submit" value="Test" id="submit1" />
+</div>
+ <script type="text/javascript">
+ <!--
+ /*]]>*/
+ if(typeof(Prado) != "undefined" && typeof(Prado.Validation) != "undefined")
+ {
+ Prado.Validation.AddForm("form1");
+
+ var val1 = {id : "validator1",
+ controltovalidate : "checks",
+ selector : "check1[]",
+ errormessage : "*",
+ display : "Dynamic",
+ controlcssclass : "required",
+ //elementcssclass : "requirede",
+ min : "1",
+ max : "3"
+ };
+ new Prado.Validation(Prado.Validation.TRequiredListValidator, val1);
+
+ var val1 = {id : "validator2",
+ controltovalidate : "select1",
+ selector : "select1[]",
+ errormessage : "*",
+ display : "Dynamic",
+ controlcssclass : "required",
+ //elementcssclass : "requirede",
+ min : "2",
+ max : "3",
+ required : "two"
+ };
+ new Prado.Validation(Prado.Validation.TRequiredListValidator, val1);
+ Prado.Validation.AddTarget("submit1");
+
+ }
+
+ /*]]>*/
+ //-->
+ </script>
+</form>
+
+ </body>
+</html>
+
diff --git a/framework/Web/Javascripts/tests/ValidationTests.html b/framework/Web/Javascripts/tests/ValidationTests.html new file mode 100644 index 00000000..67c9aecb --- /dev/null +++ b/framework/Web/Javascripts/tests/ValidationTests.html @@ -0,0 +1,79 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <title>Prado Client-Side Validation Tests</title>
+ <link rel="stylesheet" type="text/css" href="jsunit/css/jsUnitStyle.css">
+ <script language="JavaScript" type="text/javascript" src="jsunit/app/jsUnitCore.js"></script>
+<!-- unit tests -->
+<!-- base files -->
+<script language="JavaScript" Type="text/javascript" src="../../base.js"></script>
+<script language="JavaScript" Type="text/javascript" src="../../dom.js"></script>
+<!-- library file -->
+<script language="JavaScript" Type="text/javascript" src="../library/validation/validator.js"></script>
+<script language="JavaScript" type="text/javascript">
+
+ function testConvertInteger()
+ {
+ var convert = Prado.Validation.Util;
+
+ //test integers
+ assertEquals("Integer 10", 10, convert.toInteger("10"));
+ assertNull("Not an integer", convert.toInteger("10.0"));
+ assertEquals("+ integer", 10, convert.toInteger(" +10 "));
+ }
+
+ function testConvertDouble()
+ {
+ var convert = Prado.Validation.Util;
+
+ //test doubles
+ assertEquals("Double 10.0", 10.0, convert.toDouble("10.0","."));
+ assertNull("Not a double", convert.toDouble("10.0s"));
+ assertEquals("+ double", 10.2, convert.toDouble(" +10.2 "));
+ }
+
+ function testConvertAsCurrency()
+ {
+ var convert = Prado.Validation.Util;
+
+ //test currency convert
+ assertEquals("10 Dollars", 10, convert.toCurrency("10.00"));
+ assertEquals("10,000 Dollars", 10000.10, convert.toCurrency("10,000.10"));
+
+ //using space as grouping
+ assertEquals("10 000 Dollars", 10000.10, convert.toCurrency("10 000.10", " "));
+
+ assertEquals("1 0000 Yen", 10000, convert.toCurrency("1 0000", " ",0));
+
+ assertNull("Not 10 Dollars", convert.toCurrency("$10.0"));
+ }
+
+ function testConvertToDate()
+ {
+ var convert = Prado.Validation.Util;
+
+ //test dates !! Months are zero based for javascript Date objects !!
+ var testDate = (new Date(2005, 05, 20)).valueOf();
+ assertEquals("Matching date 2005 May 20", testDate, convert.toDate("2005-06-20", "%Y-%m-%d"));
+ }
+
+ function testValidatorConversion()
+ {
+ var validator = new Prado.Validation(null, {id : "", controltovalidate : "", groupchar: " ", digits : 0});
+ assertEquals("Integer 10", 10, validator.convert("Integer", "10"));
+ assertEquals("10 000 Yen", 10000, validator.convert("Currency", "10 000"));
+ }
+</script>
+ </head>
+
+ <body>
+ <h1>Prado Client-Side Validation Tests</h1>
+
+ <p>This page contains tests for the utility functions
+ that JsUnit uses. To see them, take a look at the source.</p>
+ </body>
+</html>
+
diff --git a/framework/Web/Javascripts/tests/calendar_system.css b/framework/Web/Javascripts/tests/calendar_system.css new file mode 100644 index 00000000..a797372e --- /dev/null +++ b/framework/Web/Javascripts/tests/calendar_system.css @@ -0,0 +1,70 @@ +div.Prado_Calendar
+{
+ border: 1px solid WindowText;
+ position: absolute;
+ text-align: center;
+ background-color: Window;
+ z-index: 1000;
+ font: small-caption;
+ font-weight: normal;
+ width: 20em;
+}
+
+div.Prado_Calendar .calendarHeader
+{
+ background-color: ActiveCaption;
+ padding: 1px;
+ border-bottom: 1px solid WindowText;
+}
+
+div.Prado_Calendar table
+{
+ width: 100%;
+}
+
+div.Prado_Calendar .date
+{
+ font-weight: normal;
+ cursor: pointer;
+}
+
+div.Prado_Calendar .selected
+{
+ border: 1px solid WindowText;
+}
+
+div.Prado_Calendar .today
+{
+ font-weight: bold;
+}
+
+div.Prado_Calendar .current
+{
+ border: 1px dotted WindowText;
+}
+
+div.Prado_Calendar .calendarBody td
+{
+ padding: 2px 0;
+}
+
+div.Prado_Calendar .hover
+{
+ background-color: Highlight;
+ color: HighlightText;
+}
+
+div.Prado_Calendar td.empty
+{
+ background-color: Window;
+}
+
+div.Prado_Calendar .grid td
+{
+ width: 14%;
+}
+
+div.Prado_Calendar .grid
+{
+ border-spacing: 0;
+}
\ No newline at end of file diff --git a/framework/Web/Javascripts/tests/compression.html b/framework/Web/Javascripts/tests/compression.html new file mode 100644 index 00000000..66e10a97 --- /dev/null +++ b/framework/Web/Javascripts/tests/compression.html @@ -0,0 +1,18 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>Test all compressed JS</title>
+<script type="text/javascript" src="../../base.js"></script>
+<script type="text/javascript" src="../../dom.js"></script>
+<script type="text/javascript" src="../../effects.js"></script>
+<script type="text/javascript" src="../../rico.js"></script>
+<script type="text/javascript" src="../../template.js"></script>
+<script type="text/javascript" src="../../validator.js"></script>
+
+</head>
+<body>
+OK
+</body>
+</html>
diff --git a/framework/Web/Javascripts/tests/console.html b/framework/Web/Javascripts/tests/console.html new file mode 100644 index 00000000..e6aed30f --- /dev/null +++ b/framework/Web/Javascripts/tests/console.html @@ -0,0 +1,30 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+ <head>
+ <title>Prototype Console</title>
+ <script src="../dist/prototype.js" type="text/javascript"></script>
+ <script type="text/javascript">
+ function test() {
+ var out = $('out');
+ try {
+ input = $F('input');
+ out.innerHTML += input.escapeHTML() + '<br />';
+ value = eval(input);
+ out.innerHTML += '=> ' + value.toString().escapeHTML() + '<br />';
+ } catch (e) {
+ out.innerHTML += 'Error: ' + e.toString().escapeHTML() + '<br />';
+ }
+ $('input').value = '';
+ }
+ </script>
+ </head>
+ <body>
+ <form onsubmit="test(); return false">
+ <input type="text" size="60" id="input" />
+ <input type="submit" value="Execute" />
+ </form>
+ <div id="test"></div>
+ <div id="out"></div>
+ </body>
+</html>
diff --git a/framework/Web/Javascripts/tests/fungii_logo.gif b/framework/Web/Javascripts/tests/fungii_logo.gif Binary files differnew file mode 100644 index 00000000..b667c73e --- /dev/null +++ b/framework/Web/Javascripts/tests/fungii_logo.gif diff --git a/framework/Web/Javascripts/tests/getElementsByClassName.html b/framework/Web/Javascripts/tests/getElementsByClassName.html new file mode 100644 index 00000000..b764aac4 --- /dev/null +++ b/framework/Web/Javascripts/tests/getElementsByClassName.html @@ -0,0 +1,28 @@ +<html>
+<head>
+ <script type="text/javascript" src="../../base.js"></script>
+ <script type="text/javascript" src="../../dom.js"></script>
+ <script type="text/javascript">
+ function test() {
+ var elements = document.getElementsByClassName($('class-name').value);
+ for (var i = 0; i < elements.length; i++) elements[i] = elements[i].id;
+ alert(elements.join(', '));
+ return false;
+ }
+ </script>
+</head>
+<body>
+ <div id="a" class="foo">a: foo</div>
+ <div id="b" class="foo bar">b: foo, bar</div>
+ <div id="c" class="bar">c: bar</div>
+ <div id="d" class="bar baz">d: bar, baz</div>
+ <div id="e" class="baz">e: baz</div>
+ <div id="f" class="foo baz">f: foo, baz</div>
+
+ <fieldset>
+ <label for="class-name">Class name:</label>
+ <input id="class-name" type="text" value="foo" />
+ <button onclick="return test()">Find</button>
+ </fieldset>
+</body>
+</html>
diff --git a/framework/Web/Javascripts/tests/getElementsBySelector.html b/framework/Web/Javascripts/tests/getElementsBySelector.html new file mode 100644 index 00000000..e8f716fc --- /dev/null +++ b/framework/Web/Javascripts/tests/getElementsBySelector.html @@ -0,0 +1,55 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>document.getElementsBySelector Demo</title>
+<style type="text/css">
+body {
+ margin: 1em 3em;
+ font-family: georgia;
+}
+div#foo {
+ border: 2px solid red;
+}
+</style>
+<script type="text/javascript" src="../../base.js"></script>
+<script type="text/javascript" src="../../dom.js"></script>
+<script type="text/javascript">
+function show(a) {
+ str = '';
+ for (i = 0; i != a.length; i++) {
+ str = str + a[i].toString() + '\n';
+ }
+ alert(str);
+}
+</script>
+</head>
+<body>
+<h1>document.getElementsBySelector Demo</h1>
+<p>See <a href="http://simon.incutio.com/archive/2003/03/25/#getElementsBySelector" rel="bookmark">this blog entry</a> for more information.</p>
+<p>Here are some links in a normal paragraph: <a href="http://www.google.com/" title="Google!">Google</a>, <a href="http://groups.google.com/">Google Groups</a>. This link has <code>class="blog"</code>: <a href="http://diveintomark.org/" class="blog">diveintomark</a></p>
+<div id="foo">
+<p>Everything inside the red border is inside a div with <code>id="foo"</code>.</p>
+<p>This is a normal link: <a href="http://www.yahoo.com/">Yahoo</a></p>
+
+<p>This link has <code>class="blog"</code>: <a href="http://simon.incutio.com/" class="blog">Simon Willison's Weblog</a></p>
+</div>
+
+<form action="" method="get" onsubmit="return false;">
+<p>Try them out: </p>
+<ul>
+<li><input type="submit" value="document.getElementsBySelector('a')" onclick="show(document.getElementsBySelector('a'))" /></li>
+<li><input type="submit" value="document.getElementsBySelector('p a.blog')" onclick="show(document.getElementsBySelector('p a.blog'))" /></li>
+<li><input type="submit" value="document.getElementsBySelector('div#foo a')" onclick="show(document.getElementsBySelector('div#foo a'))" /></li>
+<li><input type="submit" value="document.getElementsBySelector('#foo a.blog')" onclick="show(document.getElementsBySelector('#foo a.blog'))" /></li>
+<li><input type="submit" value="document.getElementsBySelector('.blog')" onclick="show(document.getElementsBySelector('.blog'))" /></li>
+<li><input type="submit" value="document.getElementsBySelector('a[href^="http://www"]')" onclick="show(document.getElementsBySelector('a[href*="http://www"]'))" /></li>
+<li><input type="submit" value="document.getElementsBySelector('a[href$="org/"]')" onclick="show(document.getElementsBySelector('a[href$="org/"]'))" /> (fails in Opera 7)</li>
+<li><input type="submit" value="document.getElementsBySelector('a[href*="google"]')" onclick="show(document.getElementsBySelector('a[href*="google"]'))" /></li>
+<li><input type="submit" value="document.getElementsBySelector('a[rel="bookmark"]')" onclick="show(document.getElementsBySelector('a[rel="bookmark"]'))" /></li>
+<li><input type="submit" value="document.getElementsBySelector('a[title]')" onclick="show(document.getElementsBySelector('a[title]'))" /></li>
+</ul>
+</form>
+</body>
+</html>
diff --git a/framework/Web/Javascripts/tests/index.html b/framework/Web/Javascripts/tests/index.html new file mode 100644 index 00000000..2ca89cc6 --- /dev/null +++ b/framework/Web/Javascripts/tests/index.html @@ -0,0 +1,138 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+<HTA:APPLICATION ID="SeleniumTestRunner" APPLICATIONNAME="Selenium" >
+<!-- the previous line is only relevant if you rename this
+ file to "TestRunner.hta" -->
+
+<!-- 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
+
+ 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>
+<script language="JavaScript" type="text/javascript" src="../../../tests/selenium/html-xpath/html-xpath-patched.js"></script>
+<script language="JavaScript" type="text/javascript" src="../../../tests/selenium/selenium-browserbot.js"></script>
+<script language="JavaScript" type="text/javascript" src="../../../tests/selenium/selenium-api.js"></script>
+<script language="JavaScript" type="text/javascript" src="../../../tests/selenium/selenium-commandhandlers.js"></script>
+<script language="JavaScript" type="text/javascript" src="../../../tests/selenium/selenium-executionloop.js"></script>
+<script language="JavaScript" type="text/javascript" src="../../../tests/selenium/selenium-fitrunner.js"></script>
+<script language="JavaScript" type="text/javascript" src="../../../tests/selenium/selenium-logging.js"></script>
+<script language="JavaScript" type="text/javascript" src="../../../tests/selenium/htmlutils.js"></script>
+<script language="JavaScript" type="text/javascript" src="../../../tests/selenium/xpath.js"></script>
+<script language="JavaScript" type="text/javascript">
+ function openDomViewer() {
+ var autFrame = document.getElementById('myiframe');
+ var autFrameDocument = getIframeDocument(autFrame);
+ var domViewer = window.open('../../../tests/selenium/domviewer.html');
+ domViewer.rootDocument = autFrameDocument;
+ return false;
+ }
+</script>
+<link rel="stylesheet" type="text/css" href="../../../tests/selenium/selenium.css" />
+</head>
+
+<body onload="start();">
+
+ <table class="layout">
+ <form action="" name="controlPanel">
+
+ <!-- Suite, Test, Control Panel -->
+
+ <tr class="selenium">
+ <td width="25%" height="30%" rowspan="2"><iframe name="testSuiteFrame" id="testSuiteFrame" src="test_scripts/TestSuite.html"></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">
+
+ <table id="controls">
+ <tr>
+ <td>
+ <b>Run:</b>
+ <button type="button" id="runTest" onclick="runSingleTest();"><em>Selected</em> Test</button>
+ <button type="button" id="runSuite" onclick="startTestSuite();"><strong>All</strong> Tests</button>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b>Mode:</b>
+ <label><input id="modeRun" type="radio" name="runMode" value="0" checked="checked"/>Run</label>
+ <label><input id="modeWalk" type="radio" name="runMode" value="500" />Walk</label>
+ <label><input id="modeStep" type="radio" name="runMode" value="-1" />Step</label>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <button type="button" id="domViewer1" onclick="openDomViewer();">View DOM</button>
+ <button type="button" id="continueTest" disabled="disabled">Next/Continue</button>
+ </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>
+ </td>
+ </tr>
+
+ <!-- AUT -->
+
+ <tr>
+ <td colspan="3" height="70%"><iframe name="myiframe" id="myiframe" src="../../../tests/selenium/TestRunner-splash.html"></iframe></td>
+ </tr>
+ </form>
+ </table>
+
+ <div id="logging-console">
+ <h1>Javascript Log Console (<a id="closeLog" href="javascript:LOG.hide()">Close</a> <a href="javascript:LOG.clear();LOG.hide();">Clear</a>)</h1>
+ <ul id="log-list"/>
+ </div>
+ <script language="javascript">
+ LOG = new Logger(LEVEL_WARN);
+ LOG.hide();
+ </script>
+</body>
+</html>
diff --git a/framework/Web/Javascripts/tests/librarytest.html b/framework/Web/Javascripts/tests/librarytest.html new file mode 100644 index 00000000..14a024a2 --- /dev/null +++ b/framework/Web/Javascripts/tests/librarytest.html @@ -0,0 +1,49 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>Test all compressed JS</title>
+<script type="text/javascript" src="../prototype/prototype.js"></script>
+<script type="text/javascript" src="../prototype/compat.js"></script>
+<script type="text/javascript" src="../prototype/base.js"></script>
+<script type="text/javascript" src="../extended/base.js"></script>
+<script type="text/javascript" src="../extended/string.js"></script>
+<script type="text/javascript" src="../extended/util.js"></script>
+<script type="text/javascript" src="../extended/array.js"></script>
+<script type="text/javascript" src="../extended/functional.js"></script>
+<script type="text/javascript" src="../prado/prado.js"></script>
+
+<script type="text/javascript" src="../prototype/dom.js"></script>
+<script type="text/javascript" src="../extended/dom.js"></script>
+<script type="text/javascript" src="../prototype/event.js"></script>
+<script type="text/javascript" src="../extended/event.js"></script>
+<script type="text/javascript" src="../prototype/form.js"></script>
+<script type="text/javascript" src="../prototype/position.js"></script>
+<script type="text/javascript" src="../prototype/string.js"></script>
+<script type="text/javascript" src="../extra/getElementsBySelector.js"></script>
+<script type="text/javascript" src="../extra/behaviour.js"></script>
+
+
+<script type="text/javascript" src="../../effects.js"></script>
+<!--<script type="text/javascript" src="../../rico.js"></script>-->
+<script type="text/javascript" src="../../template.js"></script>
+
+<script type="text/javascript" src="../prado/validation.js"></script>
+<script type="text/javascript" src="../prado/validators.js"></script>
+
+
+<script type="text/javascript">
+
+ var a = [ "one", "two"];
+ for(var i in a)
+ alert(i+":"+a[i]);
+
+ alert(a.contains("two"));
+</script>
+
+</head>
+<body>
+OK
+</body>
+</html>
diff --git a/framework/Web/Javascripts/tests/test_scripts/TestRequiredFieldValidator.html b/framework/Web/Javascripts/tests/test_scripts/TestRequiredFieldValidator.html new file mode 100644 index 00000000..f9895a23 --- /dev/null +++ b/framework/Web/Javascripts/tests/test_scripts/TestRequiredFieldValidator.html @@ -0,0 +1,85 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><!--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.-->
+<html>
+<head>
+<title>Test Open</title>
+ <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1" id=TABLE1>
+ <tbody>
+ <tr>
+ <td rowspan="1" colspan="3">Test Open<br>
+ </td>
+ </tr>
+ <tr>
+ <td>open</td>
+ <td>../tests/RequiredFieldValidator.html</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>assertLocation</td>
+ <td>RequiredFieldValidator.html</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>assertTextPresent</td>
+ <td> RequiredFieldValidator Tests
+ </td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>assertNotVisible</td>
+ <td>validator1</td>
+ <td></td></tr>
+ <tr>
+ <td>assertNotVisible</td>
+ <td>validator2</td>
+ <td></td></tr>
+ <tr>
+ <td>click</td>
+ <td>submit1</td>
+ <td></td></tr>
+ <tr>
+ <td>assertVisible</td>
+ <td>validator1</td>
+ <td></td></tr>
+ <tr>
+ <td>assertVisible</td>
+ <td>validator2</td>
+ <td></td></tr>
+ <tr>
+ <td>type</td>
+ <td>text1</td>
+ <td>testing</td></tr>
+ <tr>
+ <td>click</td>
+ <td>submit1</td>
+ <td></td></tr>
+ <tr>
+ <td>assertNotVisible</td>
+ <td>validator1</td>
+ <td></td></tr>
+ <tr>
+ <td>click</td>
+ <td>submit2</td>
+ <td></td></tr>
+ <tr>
+ <td>assertNotVisible</td>
+ <td>validator1</td>
+ <td></td></tr>
+ <tr>
+ <td>assertNotVisible</td>
+ <td>validator2</td>
+ <td></td></tr>
+ <tr>
+ <td>assertVisible</td>
+ <td>validator3</td>
+ <td></td></tr>
+ <tr>
+ <td>assertVisible</td>
+ <td>validator4</td>
+ <td></td></tr>
+ </tbody>
+</table>
+</body>
+</html>
\ No newline at end of file diff --git a/framework/Web/Javascripts/tests/test_scripts/TestSuite.html b/framework/Web/Javascripts/tests/test_scripts/TestSuite.html new file mode 100644 index 00000000..9b8b8918 --- /dev/null +++ b/framework/Web/Javascripts/tests/test_scripts/TestSuite.html @@ -0,0 +1,36 @@ +<!--
+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.
+-->
+<html>
+<head>
+<meta content="text/html; charset=ISO-8859-1"
+http-equiv="content-type">
+<title>Test Suite</title>
+
+</head>
+
+<body>
+
+<table cellpadding="1"
+ cellspacing="1"
+ border="1">
+ <tbody>
+ <tr><td><b>Test Suite</b></td></tr>
+ <tr><td><a href="./TestRequiredFieldValidator.html">TestTRequiredFieldValidator</a></td></tr>
+ </tbody>
+ </table>
+
+</body>
+</html>
|