Unit Testing batman.js Apps - batman.js

Do you have any tips on how to unit test batman.js applications? I could not find any hints in the documentation. Which testing tools do you use? Any sample would be highly appreciated.

Batman's new website has a page for Batman.TestCase, which is a Ruby Test::Unit-like wrapper for QUnit and Sinon.js.
However, for my own use, I use Jasmine & Karma, set up after this blog post

Related

Code coverage for coded UI automation test suite

I am working on a ASP.NET web app and I want to get the code coverage on the same application by the Coded UI automation test suite we currently have. Is it possible to get the code the code coverage with the DLLs that I have or do we necessarily need to use the instrumented build for it? And if instrumented build is a must how do we instrument the build in order to get the code coverage on it? Any pointer will be helpful.
Okay, So I guess there is not much info out there on the internet related to this (Actually there is a lot but non-compiled and un useful info). Here are the few links which we found out after searching :
Using Dynamic code coverage tool :- This tool works fine with newer versions This should help while using this tool.
Using VSInstr :- This guy has put a lot of efforts to document it completely. This works for older versions of .NET applications.
Hope this helps.

Integration Testing in CakePHP 2.0

I'm a rails developer, and I want to do some capybara+(rspec or cucumber) style of integration testing with cakephp 2.0. I was using PHPUnit (the default test framework for cake 2.0) but I don't know how to integrate it with Selenium and Cake at the same time to get the full stack effect that you have on rails
So, for the experience php devs that have used cake 2.0... how do you guys do a proper integration testing?
I'm not surprised there's been no answer on this - the community of testers within CakePHP seems to be extremely small. I've worked on large projects with huge numbers of functional and unit tests (currently a suite of around 1500 tests), but to do that I needed to extend the CakePHP test suite functionality (you can take a look at my now slightly outdated TDD plugin).
When we started we didn't know a whole lot about integration testing, and setting up a decent unit testing environment was enough of a challenge. We now use Rails :)
Basically, this is not a well-worn path. To get something working will require an extension to the framework - it will also require a new test case class, which extends PHPUnit_Extensions_Selenium2TestCase, and integrates any necessary functionality from CakeTestCase and ControllerTestCase.
I hope you get somewhere! If you do, it would be great if you could share the code with the rest of the community.

How to use the built-in unit testing module?

There seems to be a built-in unit test module in Kohana 3.x.
How can I use this? I can't find any official documentation regarding this module and even Google doesn't provide good articles.
I would appreciate good links or any kind Hello, World! unit test example!
Enable the module in your bootstrap.php by uncommenting it and go to /unittest/ in your browser. There are several example tests included.

ASP.Net Testing Suite?

I'm in the process of researching testing options for .Net development particularly ASP.Net.
What testing tools do you swear by? NUnit, Selenium, RhinoMocks are my current apps in my toolbox but what do others have to offer for a more complete testing coverage?
No budget
I swear by NUnit, Selenium and then a number of other little tools like YSlow, Firebug
I did a talk at Google Test Automation Conference http://www.youtube.com/watch?v=qQgDDAan4rM where I show how you can mix Selenium, NUnit and Yslow to get an idea of how the user is experiencing the system.
I have started using JsTestDriver as well and think that is really good for unit testing JavaScript The video from the same conference is here http://www.youtube.com/watch?v=aDKGGZv-T4M
All of those are free and most are open source
Kzu and friends have a new pet project called Moq, which may be the coolest derivative open source project name ever. -Scott Hanselman
http://www.hanselman.com/blog/MoqLinqLambdasAndPredicatesAppliedToMockObjects.aspx
Haven't gotten around to trying Moq out yet but I've seen Hanselman talk about it in a couple of his blog posts, probably worth checking it out.
See the answers to ASP.NET Free testing tools

What is the best way to test webforms apps ( ASP.NET )

What is the best way to test my webforms applications?
Looks like people are loving Watin, and selenium.
Just wondering, why would you call WatiN a unit testing tool? Last time I checked, it ran integration tests.
The best way would be to move all code that doesn't depend on HttpContext to a separate assembly and run unit tests as usual. The rest can be tested with Ivonna. She doesn't test the client behavior, that's where WatiN can be helpful; however, if you want to test your pages or controls in isolation, she's your only choice.
UPDATE: Given WatiN has been stagnant for over a year now, I would direct anyone that needs web ui tests towards selenium, it is in continuous use & development by many contributors, and is actively used by Google.
WatiN is the best that I've found. It integrates into Visual Studio unit testing or nunit & you can do pretty much anything you need in the browser (click links, submit forms, look for text/images, etc.)
See the following questions for similar answers:
What is the best way to do unit testing for ASP web pages (C#)?
Web Application Testing for .Net (watin Test Recorder)
How do you programmatically fill in a form and ‘POST’ a web page?
That's the biggest shortcoming of Webforms -- it's, for all practical reasons, untestable in terms of unit testing of testing controllers, etc.
That is one of the major advantages of the MVC framework.
I tend to favor the approach of separating the buisness logic out of the UI code.
Here's an article that describes a unit test friendly pattern (Model-View-Presenter)
http://www.unit-testing.net/CurrentArticle/How-To-Use-Model-View-Presenter-With-AspNet-WebForms.html
I would use a tool like WaitIn:
" WatiN is Web Application Testing in .NET, and this Test Recorder will generate chunks of source for you by recording your clicks in an embedded IE browser" (from Scott Hanselman's blog - which I found thanks to another post on StackOverflow
WaitIn website
I'd go with WATIR (Web Application Testing in Ruby) - http://wtr.rubyforge.org/. We (Acsys Interactive) have been using for about a year and the tool is great.
I developed a simple wrapper in .NET so that I can execute my WATIR scripts from Unit tests. The framework is incredible and you have entire Ruby power behind you. There's support for Firefox & Safari (FireWatir project).
It's very similar to WATIN (in fact I think WATIN was inspired by WATIR) but I find that WATIR community is much larger than WATIN one.
There're test recorders out there that you can use and tons of tutorials.
It's really your choice. If you feel like the tests need to be in .NET and you don't want to support any other language then your choice is WATIN. On the other hand, if you want to try a fun and quite powerful scripting language (that's what Ruby is) then go for WATIR.
Question to WATIN guys, does it support FireFox/Safari?
Here is a review of Watin,Watir and Selenium
http://adamesterline.com/2007/04/23/watin-watir-and-selenium-reviewed/
Apparently Selenium worked quite slow for the tester but if you'll notice, as one of the comments points out, that this is only the case due to its support of multiple browsers.
However there is a CTP (Community Technology Preview) release of WatiN which offers support for both Internet Explorer and FireFox automation.
I have had a great experience using Selenium. Web tests can be very fragile, but here is an article from my blog where I talk about how to make the tests less fragile.
http://www.unit-testing.net/CurrentArticle/How-To-Make-Web-Tests-Less-Fragile.html

Resources