RichFaces/Ajax4jsf is the first Ajax component library to be supported by JSFUnit. Our plan is to make sure that all of the popular JSF libraries work well with JSFUnit.
Since JSFUnit now uses HtmlUnit, the javascript executed natively when you tell JSFUnit to "click" something. So for most things, you can use the JSFClientSession as usual.
But for some complex components, you will need to make calls using the HtmlUnit API. To help with that you can use the RichFacesClient that already knows how the RichFaces components are rendered, and thus knows how to call HtmlUnit to do what you need.
The best way to learn how to use the RichFacesClient is to look at the live demo. This demo includes source code for both the JSF Facelets pages and the JSFUnit code used to test various RichFaces and Ajax4jsf components. Click here to see this and other JSFUnit live demos. If you see JSFUnit Beta 2 code instead of JSFUnit Beta 3 code in the demo, just be patient. We will update the demo soon.
As of the JSFUnit Beta 3 release, most RichFaces components are supported by the RichFacesClient. Each one that is supported contains a test and sample code in the live demo.
The notable exception is the RichFaces tree component. Support for the rest of the RichFaces library is planned for GA.