I'd like to unit test (jUnit 4) the behavior of my pages when the browser's back button (or forward or refresh) is clicked.
Can I somehow simulate the browser's back/forward/refresh buttons in a unit test? Is there a utility class that provides such functionality?
2nd Edit:
I understand that the Wicket test facilities don't simulate a browser with a full history. From my understanding I would need the following two things to simulate a browser's behavior from a unit test:
(1) Wicket has to tell me what exact request (e.g. URL) is made when I call WicketTester.startPage()
or WicketTester.clickLink()
.
(2) Wicket has to process the same request again, e.g. by accepting the URL previously recorded by (1).
I want to do this in a way that is compatible with WicketTester
, FormTester
and so on as I'm using the component finders, asserts, and more nice functionality in these classes. That means that I have to issue the requests from Wicket facilities and not from external clients like HttpUnit / HtmlUnit / Selenium.