@Test public void submit_form() { String appPackage = "org.apache.tapestry5.integration.app2"; String appName = ""; tester = new PageTester(appPackage, appName); Document doc = tester.renderPage("TestPageForForm"); Element form = doc.getElementById("form1"); Map<String, String> fieldValues = CollectionFactory.newMap(); fieldValues.put("t1", "hello"); doc = tester.submitForm(form, fieldValues); assertTrue(doc.toString().contains("You entered: hello")); }
@BeforeClass public void setup() { pageTester = new PageTester( "com.tap5.hotelbooking", "hotel-booking", "src/main/webapp", HotelBookingModule.class); registry = pageTester.getRegistry(); }
@AfterMethod public void after() { if (tester != null) { tester.shutdown(); } }