Can I emulate user interaction that span multiple request (within single conversation)?
I know I could always do something like this.
new ComponentTest() { protected void testComponents() throws Exception { login(); fillForm1(); fillForm2(); validateResult(); } }.run();
But I think it would be great if i can do it like
new FacesRequest() { protected void invokeApplication() throws Exception { login(); } }.setConversationId("1").run(); new FacesRequest() { protected void invokeApplication() throws Exception { fillForm1(); } }.setConversationId("1").run(); new FacesRequest() { protected void invokeApplication() throws Exception { fillForm2(); } }.setConversationId("1").run(); new FacesRequest() { protected void invokeApplication() throws Exception { validateResult(); } }.setConversationId("1").run();
Is there currently any way to do something like that?
Never mind this.
I read through Gavin's code and found out that what I have to do is this:
String cid = new FacesRequest() { ... }.run(); // next request new FacesRequest("/pages/abc.xhtml",cid) { ... }.run();