📄 ajax_autocompleter_test.html
字号:
<!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>script.aculo.us Unit test file</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <script src="../../lib/prototype.js" type="text/javascript"></script> <script src="../../src/scriptaculous.js" type="text/javascript"></script> <script src="../../src/unittest.js" type="text/javascript"></script> <link rel="stylesheet" href="../test.css" type="text/css" /> <style> .selected { background-color: #888; } </style></head><body><h1>script.aculo.us Unit test file</h1><p> Tests for the Ajax.Autocompleter.</p><!-- Log output --><div id="testlog"> </div><input id="ac_input" type="text" autocomplete="off" /><div id="ac_update" style="display:none;border:1px solid black;background-color:white;position:relative;"></div><input id="ac_input_br" type="text" autocomplete="off" /><div id="ac_update_br" style="display:none;border:1px solid black;background-color:white;position:relative;"></div><input id="ac2_input" type="text" autocomplete="off" /><div id="ac2_update" style="display:none;border:1px solid black;background-color:white;position:relative;"></div><input id="actoken_input" type="text" autocomplete="off" /><div id="actoken_update" style="display:none;border:1px solid black;background-color:white;position:relative;"></div><input id="dummy_element" type="text" autocomplete="off" /><!-- Tests follow --><script type="text/javascript" language="javascript" charset="utf-8">// <![CDATA[ new Test.Unit.Runner({ // Integration test, tests the entire cycle testAjaxAutocompleter: function() { with(this) { var ac = new Ajax.Autocompleter('ac_input','ac_update','_autocomplete_result.html', { method: 'get' }); //override so we can use a static for the result assertInstanceOf(Ajax.Autocompleter, ac); // box not visible assertNotVisible('ac_update'); // focus, but box not visible Event.simulateMouse('ac_input', 'click'); assertNotVisible('ac_update'); Event.simulateKeys('ac_input','abcdefg'); assertEqual('abcdefg', $('ac_input').value); // check box popping up on input wait(1000, function() { with(this) { assertVisible('ac_update'); assertEqual('test1', $('ac_update').firstChild.firstChild.innerHTML); assertEqual('test2', $('ac_update').firstChild.firstChild.nextSibling.innerHTML); // intl. characters return (UTF-8) assertEqual('Here we have some international 漏鈭徝伮
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -