I want to write integration tests for my application. I want to test, that the required=true
attribute on my text components are set on some JSF Pages.
When extending SeamTest
, I can simulate a FacesRequest
, and here I can overwrite the processValidations
Phase. There is a bultin method called validateValue
, but this is just for Hibernate Validator Validations. So how can I invoke JSF Validators manually? Has anyone done this successfully before?
Is searched the whole JBoss JIRA and the JBoss Forums for a solution, but did not find anything, besides that it was asked very often, but never answered :(
You can use Selenium (firefox add-on) for testing. Once you have recorded the tests, you can export to plain Java code, and use it in your extended SeamTest class, making sure that the values are required = true are in the request.
To learn more, see http://seleniumhq.org/projects/ide/