Sha256: c929a13f91d807e84106bbb916ee4886e0c6d95ce98eed1b546ca48e06ed46ed

Contents?: true

Size: 577 Bytes

Versions: 10

Compression:

Stored size: 577 Bytes

Contents

require 'page_navigation'
require 'gametel/waiter'

module Gametel
  #
  # Module to facilitate create new gametel screen objects in
  # definitions.
  #
  module Navigation
    include PageNavigation, Gametel::Waiter

    #
    # create a new screen given a class name
    #
    def on(cls, &block)
      @current_screen = @current_page = cls.new
      waiting_for  = "#{cls} to be active"
      wait_until(10, waiting_for) { @current_screen.active? } if @current_screen.respond_to?(:active?)
      block.call @current_screen if block
      @current_screen
    end

  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
gametel-0.8 lib/gametel/navigation.rb
gametel-0.7 lib/gametel/navigation.rb
gametel-0.6 lib/gametel/navigation.rb
gametel-0.5.9.3 lib/gametel/navigation.rb
gametel-0.5.9.2 lib/gametel/navigation.rb
gametel-0.5.9.1 lib/gametel/navigation.rb
gametel-0.5.9 lib/gametel/navigation.rb
gametel-0.5.8.1 lib/gametel/navigation.rb
gametel-0.5.8 lib/gametel/navigation.rb
gametel-0.5.7 lib/gametel/navigation.rb