// NOTE that new @Test means new WebClient means new WindowContext
@Test
public void testConversationDialog() throws Exception
{
SimplePageInteraction pageInteraction = new SimplePageInteraction(getTestConfiguration())
.with(Pages.Conversation.Conversation1.class)
.with(Pages.Conversation.Conversation2.class)
.with(Pages.Conversation.Conversation3.class)
.with(Pages.Conversation.Result.class)
.start(Pages.Conversation.Conversation1.class)
.useForm("conversation1");
pageInteraction.setValue("conversation1:value1", "1");
pageInteraction
.click("conversation1:nextPage")
.checkState(Pages.Conversation.Conversation2.class)
.useForm("conversation2");
pageInteraction.setValue("conversation2:value2", "2")
.click("conversation2:nextPage")
.checkState(Pages.Conversation.Conversation3.class)
.useForm("conversation3");
pageInteraction.setValue("conversation3:value3", "3")
.click("conversation3:submit")
.checkState(Pages.Conversation.Result.class);
pageInteraction.checkTextValue("value1", "1");
pageInteraction.checkTextValue("value2", "2");
pageInteraction.checkTextValue("value3", "3");
pageInteraction.click("refresh")
.checkState(Pages.Conversation.Result.class);
pageInteraction.checkTextValue("value1", "1");
pageInteraction.checkTextValue("value2", "2");
pageInteraction.checkTextValue("value3", "3");
pageInteraction.click("back")
.checkState(Pages.Conversation.Conversation3.class)
.useForm("conversation3");
pageInteraction.click("conversation3:back")
.checkState(Pages.Conversation.Conversation2.class)
.useForm("conversation2");
pageInteraction.setValue("conversation2:value2", "new2")
.click("conversation2:nextPage")
.checkState(Pages.Conversation.Conversation3.class)
.useForm("conversation3");
pageInteraction.setValue("conversation3:value3", "new3")
.click("conversation3:submit")
.checkState(Pages.Conversation.Result.class);
pageInteraction.checkTextValue("value1", "1");
pageInteraction.checkTextValue("value2", "new2");
pageInteraction.checkTextValue("value3", "new3");
// close conversation
pageInteraction.useForm("form").click("form:closeConversation");
pageInteraction.checkTextValue("value1", "");
pageInteraction.checkTextValue("value2", "");
pageInteraction.checkTextValue("value3", "");
}