To fix an issue of creating two instances of new Page when calling Browser.to(Class) method.

Given we have some page classes:

    abstract class BasePage extends Page {
        def context = [:]

        @Override
        void onUnload(Page newPage) {
            newPage.context << context
        }
    }

    class FirstPage extends BasePage {}

    class SecondPage extends BasePage {
        static at = {
            context.prop1 == label1.text()
            context.prop2 == label2.text()
        }
        static content = {
            label1 {...}
            label2 {...}
        }
    }

And this is test case as below:

    When:
        to FirstPage

    And:
        context << [prop1: "abc", prop2: "123"]
        // do something

    And:
        to SecondPage

The last step will fail in the "At Checker" of SecondPage.

The root cause is that the Browser.to(Class) will create two different instances of new Page class.