Question

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 processValidationsPhase. 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 :(

Was it helpful?

Solution

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/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top