webtester2-core
webtester2-core copied to clipboard
Automatic validation of Pages in PostConstruct by Context Path
In a similar fashion as with @Mapping for PageFragement subclasses we could validate if a Page was initialized for a valid context path / url.
Examples
@ContextPath("/html/index")
public interface LandingPage extends Page {
// implementation
}
- If the currently displayed page had the URL
http://localhost/html/indexand an instance ofLandingPageis created there would be no problem since the context path matches the expectation. - If the currently displayed page had the URL
http://localhost/html/mainan exception would be thrown as soon as aLandingPageinstance is being created. - For page definitions without
@ContextPathevery URL is valid
This should be discussed before somebody starts implementing it...