高效的JavaScript代码单元测试方法(7)
发表于:2013-01-11来源:web开发社区作者:Hazem Saleh点击数:
标签:JavaScript
07 input type=password id=password//tdtdspan id=passwordMessage 08 /span/td/tr/table/FORM*/ 09 }; 10 11 ApplicationUtilTest.prototype.testValidateLoginFormBothEmpty = function () { 12 var applicationU
11 |
ApplicationUtilTest.prototype.testValidateLoginFormBothEmpty = function () { |
12 |
var applicationUtil = new appnamespace.ApplicationUtil(); |
15 |
document.getElementById ( "username" ).value = "" ; |
16 |
document.getElementById ( "password" ).value = "" ; |
18 |
applicationUtil.validateLoginForm(); |
20 |
assertEquals ( "Username is not validated correctly!" , "This field is required" , |
21 |
document.getElementById( "usernameMessage" ).innerHTML); |
原文转自:http://www.ltesting.net