The online community for software testing & quality assurance professionals
Calendar   Today's Topics

Lost Password?


Software Testing >> Unit Testing

Pages: 1
Junior Member

Reged: 05/02/06
Posts: 1041
Loc: CA, USA
Unit testing JS/HTML webapp
      #707468 - 05/18/12 03:45 PM


I was wondering what you guys do for unit testing HTML/JS web apps. At my previous company we just did system level tests using HTML unit. Current company we don't have any practices for this.

I found a few JavaScript testing frameworks for JavaScript that can run via TestSwarm/BrowserStack. But I'm looking for something a bit different. Instead of testing the JS in isolation, I want to test it within the context of the webapp (HTML host page). I'm thinking of taking a MVC webapp, mocking out the Model and Controller, then testing the view with the JavaScript code.

I was wondering if there is a good framework for this. I was thinking this unit test would just load the page (with the model and controller stubbed or mocked out), then inject javascript code to run on the page and make it's various assertions.

The reason I'm thinking of unit testing at this level is often times JS will refer to element properties in the HTML nodes, and some of the time, they might be a property provided by different browsers and not part of a standard. This needs to be unit tested on several real browsers rendering the elements vs. a fake browser or entirely within a javascript engine.

David Lai
Sr. QA / Test Lead
LinkedIn profile

Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1

Extra information
0 registered and 3 anonymous users are browsing this forum.

Moderator:  AJ, Jeanj 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Topic views: 1613

Rate this topic

Jump to

Contact Us | Privacy statement SQAForums

Powered by UBB.threads™ 6.5.5