Use the power of jQuery to bend web tests to your will.

jTest is a simple web test toolkit which combines internet explorer and jQuery to test web pages. Test your page after javasript has fired for the most accurrate reuslts.

Testing javascript has always been HARD.

jQuery selectors are used to parse the html, and you can finsh testing with a few basic commands. You can quickly test webpages for static or dynamic content. Although mstest is used it would not be hard to allow for other testing platforms to be supported.

   1:  /// <summary>
   2:  /// Perform a series of tests on a rendered page using jQuery
   3:  /// </summary>
   4:  [AspNetDevelopmentServer("StubWebsite", 
   5:                              jTest_Test.WebsiteLocation)]
   6:  public void jTest_Combination_Test()
   7:  {
   8:      // Download a page.
   9:      jTestDocument target = 
  10:          jTestDocument.Test("SampleWebForm.aspx", 
  11:                              this.TestContext);
  12:   
  13:      // Always have a negitive test first
  14:      target.NoTag("p1", "Invalid selector allowed");
  15:   
  16:      // Find check how many divs we have
  17:      target.HasTag("div", 3, "Invaid div count"); 
  18:              
  19:      // Test the value of the page headline
  20:      target.NoVal("h1", 
  21:                      "Bad value", 
  22:                      "Bad value is not a valid value.");
  23:   
  24:      // Lets try a really complex selector
  25:      target.HasAttr("#form1 div.nestedContainer", 
  26:                      "class", 
  27:                      "nestedContainer", 
  28:                      "Has class nestedContainer.");
  29:  }
<!-- code formatted by http://manoli.net/csharpformat/ -->


You

Last edited Oct 23, 2010 at 10:02 PM by justengland, version 11