def on(definition, visit = false, &block)
      unless @context.is_a?(definition)
        @context = definition.new(@browser) if @browser
        @context = definition.new unless @browser
        @context.visit if visit
      end

      verify_page(@context)

      yield @context if block
      @context
    end
def on(definition, visit = false, &block)
      unless @context.is_a?(definition)
        @context = definition.new(@browser) if @browser
        @context = definition.new unless @browser
        @context.visit if visit
      end

      verify_page(@context)

      yield @context if block
      @context
    end
Creates a definition context for actions. If an existing context
 exists, that context will be re-used. You can use this simply to keep
 the context for a script clear. For example, say you have the following
 interface definitions for pages:

    class Home
      include Tapestry
      url_is "http://localhost:9292"
    end

    class Navigation
      include Tapestry
    end

 You could then do this:

    on_view(Home)
    on(Navigation)

 The Home definition needs the url_is attribute in order for the on_view
 factory to work. But Navigation does not because the `on` method is not
 attempting to visit, simply to reference. Note that you can use `on`
 to visit, just by doing this:

    on(Home, true)