Sha256: 05322109c169357be8e6cd095e3f2f0e65fba897aa71c5f79ab7b09af7839270

Contents?: true

Size: 1.14 KB

Versions: 2

Compression:

Stored size: 1.14 KB

Contents

require 'frank-cucumber'
require 'furter/navigation'
require 'furter/accessors'
require 'furter/accessors/view'
require 'furter/accessors/alert_button'
require 'furter/accessors/button'
require 'furter/accessors/map_pin'
require 'furter/accessors/switch'
require 'furter/accessors/table'
require 'furter/accessors/table_item'
require 'furter/accessors/text'
require 'furter/accessors/label'
require 'furter/accessors/slider'

module Furter
  include Frank::Cucumber::FrankHelper

  TIMEOUT = 30

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

  def has_text?(text)
    Furter::Accessors::Text.new.has_text? text
  end

  def wait_for_text(text)
    wait_until(:message => "Timed out waiting for text \"#{text}\"", :timeout => Furter::TIMEOUT) do
      has_text? text
    end
  end

  def exists?(locator)
    element_exists locator
  end

  def wait_for(locator, &block)
    wait_until(:message => "Timed out waiting for \"#{locator}\"", :timeout => Furter::TIMEOUT) do
      exists? locator
    end
    block.call locator if block
  end

  def wait_for_and_touch(locator)
    wait_for(locator) do |locator|
      touch locator
    end
  end
end



Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
furter-0.0.3.2 lib/furter.rb
furter-0.0.3.1 lib/furter.rb