How to organise Webdriver tests
I want to create some Webdriver tests to test my Java web application but I'm not sure whether they should live inside another project or if they should live inside my web application project.
I also want to run these Webdriver tests from my Hudson CI server upon every commit to my SVN repository - would this be a 开发者_开发问答standard practice?
I don't think it matters too much but I would like to know what other people do?
It is a good practice to separate your project and Selenuim tests, especially if you are planning to run them in Hudson. This is because such tests will run for a long time and you would like to keep your build running fast.
So you should create separate project with tests and run it after your main project completed - it all can be set up in Hudson. An you can setup your project to be build after each commit, however you should read related Hudson documentation
We have a big enterprise application written in Java and Gwt, so lots of JS on the client.
We tried in the past to use selenium to test it, but we never did more than some smoke tests because of the complexity and fragility of it.
Now we started a completed UseCases Scenario testing with cucumber+watir+webdriver. Tests are written in Ruby and Gherkin (cucumber DSL) and run against our application. We integrated that with Hudson and we have nice screenshots for any errors (and soon also .avi)
So far QA and BA people are enthusiast, and the developing effort already repaid itself considering the saving on retesting features manually compared to run the suite and going for a coffee. ;)
If you are making tests for an ASP.NET application with controls that are re-used for different pages, it might make sense to make a class for each control, rather than page. But normally you would want to make each class specific to a page. And keep your page to it's services/features, not what's happening in the code.
This is a good overview. http://code.google.com/p/selenium/wiki/DesignPatterns
精彩评论