| java.lang.Object org.apache.tapestry.test.PageTester
PageTester | public class PageTester implements ComponentInvoker(Code) | | This class is used to run a Tapestry app in an in-process testing environment. You can ask it to
render a certain page and check the DOM object created. You can also ask it to click on a link
element in the DOM object to get the next page. Because no servlet container is required, it is
very fast and you can directly debug into your code in your IDE.
|
Constructor Summary | |
public | PageTester(String appPackage, String appName) Initializes a PageTester without overriding any services and assuming that the context root
is in src/main/webapp. | public | PageTester(String appPackage, String appName, String contextPath) Initializes a PageTester that acts as a browser and a servlet container to test drive your
Tapestry pages.
Parameters: appPackage - The same value you would specify using the tapestry.app-package context parameter.As this testing environment is not run in a servlet container, you need to specifyit. Parameters: appName - The same value you would specify as the filter name. |
DEFAULT_CONTEXT_PATH | final public static String DEFAULT_CONTEXT_PATH(Code) | | |
PageTester | public PageTester(String appPackage, String appName, String contextPath)(Code) | | Initializes a PageTester that acts as a browser and a servlet container to test drive your
Tapestry pages.
Parameters: appPackage - The same value you would specify using the tapestry.app-package context parameter.As this testing environment is not run in a servlet container, you need to specifyit. Parameters: appName - The same value you would specify as the filter name. It is used to form the nameof the module builder for your app. If you don't have one, pass an empty string. Parameters: contextPath - The path to the context root so that Tapestry can find the templates (if they'reput there). |
clickLink | public Document clickLink(Element link)(Code) | | Simulates a click on a link.
Parameters: link - The Link object to be "clicked" on. The DOM created. Typically you will assert against it. |
clickSubmit | public Document clickSubmit(Element submitButton, Map<String, String> fieldValues)(Code) | | Simulates a submission of the form by clicking the specified submit button. The caller can
specify values for the form fields.
Parameters: submitButton - the submit button to be clicked. Parameters: fieldValues - the field values keyed on field names. The DOM created. Typically you will assert against it. |
renderPage | public Document renderPage(String pageName)(Code) | | Renders a page specified by its name.
Parameters: pageName - The name of the page to be rendered. The DOM created. Typically you will assert against it. |
setPreferedLanguage | public void setPreferedLanguage(Locale preferedLanguage)(Code) | | |
shutdown | public void shutdown()(Code) | | You should call it after use
|
submitForm | public Document submitForm(Element form, Map<String, String> parameters)(Code) | | Simulates a submission of the form specified. The caller can specify values for the form
fields.
Parameters: form - the form to be submitted. Parameters: parameters - the query parameter name/value pairs The DOM created. Typically you will assert against it. |
|
|