webtester2-core icon indicating copy to clipboard operation
webtester2-core copied to clipboard

Automatic validation of Pages in PostConstruct by Context Path

Open slu-it opened this issue 9 years ago • 1 comments

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/index and an instance of LandingPage is created there would be no problem since the context path matches the expectation.
  • If the currently displayed page had the URL http://localhost/html/main an exception would be thrown as soon as a LandingPage instance is being created.
  • For page definitions without @ContextPath every URL is valid

slu-it avatar Jul 08 '16 14:07 slu-it

This should be discussed before somebody starts implementing it...

slu-it avatar Aug 10 '16 08:08 slu-it