Testify supports two types of testing (well, maybe more :-) ):
If you have not done too much testing before then start with unit testing only and test components only. It's much easier. Integration/acceptance testing has some important benefits but is typically harder to do; so learn your craft on the simpler stuff first.
With Testify you can do test-driven development (TDD) to create Tapestry components and, to some extent, pages. You need to use some particular techniques to test components.
The major Testify feature you need is the ability to Inject objects from the test into components.
The Tapestry IOC container is very clever at instantiating only the services you need. However, I would recommend breaking your application into a variety of Modules and building an IOC for the unit tests that includes only the minimal services you need. For example, do include modules with global customizations of Tapestry (for example, contributions to core services such as TypeCoercer or ValueEncoder) and exclude modules that have services that depend on external systems such as databases. If you do this it will stop your unit tests accidentally connecting to databases because you forgot to provide a mock for that service in your unit test.
The unit testing approach can't always be used for pages. A page typically integrates a lot of components - each needing particular services to be injected - and as soon as it includes something like a site navigation that depends on other pages, managing the injections required becomes impossible at a unit level.
I recommend that your pages are little more than aggregations of components and have very little logic in them because then you can unit test the components. This might mean that you introduce slightly more components than you usually would.
To test pages that are complex aggregations of components with dependencies on other pages, you need to build an almost-complete IOC registry. The key here is to break your application into modules like this:
And here are the configurations that you would use in your tests:
Unit | Core |
Integration | Core + Domain + Fake External |
Real system | Core + Domain + External |