This is primarily for getting better IDE autocomplete. The following could be added to Browser…
<T extends Page, R> R at(T pageType, @DelegatesTo("T") Closure<R> assertions) {}
The implicit assertion transform would be applied to the closure body.
Usage would look like:
then:
at(SomePage) {
somePageProperty == "foo"
}
In IDEA at least, you should get completion for the page properties in the closure body due to the use of DelegatesTo.