Sha256: 8ef32becc9543f60d1d6611c1204c11fdc9913a443043c182f886ab4265d3a98

Contents?: true

Size: 1.1 KB

Versions: 2

Compression:

Stored size: 1.1 KB

Contents

require 'gametel/accessors'
require 'gametel/navigation'
require 'gametel/version'
require 'gametel/platforms/brazenhead_platform'

module Gametel

  attr_reader :platform

  def self.included(cls)
    cls.extend Gametel::Accessors
  end

  def initialize(pform = :brazenhead)
    @platform = Gametel::Platforms::BrazenheadPlatform.new if pform == :brazenhead
  end

  #
  # Returns true if the provided text is found on the screen
  #
  def has_text?(text)
    platform.has_text?(text)
  end

  #
  # Returns true if the view is enabled
  #
  def enabled?(locator)
    platform.enabled?(locator)
  end

  #
  # Returns true if a view exists
  #
  def has_view?(locator)
    platform.has_view?(locator)
  end

  #
  # Press the back button
  #
  def back
    platform.back
  end

  #
  # Press the enter key
  #
  def enter
    platform.enter
  end

  #
  # scroll down
  #
  def scroll_down
    platform.scroll_down
  end

  #
  # scroll up
  #
  def scroll_up
    platform.scroll_up
  end

  #
  # Wait for the provided text to appear
  #
  def wait_for_text(text_to_find)
    platform.wait_for_text(text_to_find)
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gametel-0.5 lib/gametel.rb
gametel-0.4 lib/gametel.rb