<div> <form action="/" id="Form1" method="post"> <div> <input data-val="true" data-val-fileextensions="The DocumentFileName field only accepts files with the following extensions: doc,docx,txt,rtf,pdf" data- val-fileextensions-fileextensions="doc,docx,txt,rtf,pdf" id="Text1" name="FileExtensiondTest.fileExtensionInValid.DocumentFileName" type="text" value="test.ppt" /> </div> </form> </div>
I would to add above DOM object to qunit-fixture and access DOM object attributes in Test cases such as below:
ok($("#FileExtensiondTest_fileExtensionInValid_DocumentFileName").hasClass("input- validation-error"), "True, Valid Test");
I tried adding DOM to qunit-fixture by below line of code:
$("#qunit-fixture").append('<div><form action="/" id="Form1" method="post"><div> <input data-val="true" data-val-fileextensions="The DocumentFileName field only accepts files with the following extensions: doc,docx,txt,rtf,pdf" data- val-fileextensions-fileextensions="doc,docx,txt,rtf,pdf" id="Text1" name="FileExtensiondTest.fileExtensionInValid.DocumentFileName" type="text" value="test.ppt" /></div></form></div>');
Am I doing in the right way..Need your suggestions