Sha256: d38102a2e6bc609adf450c2472633b8f79791ae28d4981cc03f7a58e29a1d338

Contents?: true

Size: 820 Bytes

Versions: 2

Compression:

Stored size: 820 Bytes

Contents

require 'calabash-cucumber'

module Briar
  module Bars
    def tabbar_visible?
      element_exists("tabBar")
    end

    def should_see_tabbar
      unless tabbar_visible?
        screenshot_and_raise "i do not see the tabbar"
      end
    end

    def index_of_tabbar_item(name)
      if tabbar_visible?
        tabs = query('tabBarButton', :accessibilityLabel)
        tabs.index(name)
      end
    end

    def touch_tabbar_item(name)
      idx = index_of_tabbar_item name
      if idx
        touch "tabBarButton index:#{idx}"
        step_pause
      else
        screenshot_and_raise "tabbar button with name #{name} does not exist"
      end
    end

    def tabbar_item_is_at_index(name, index)
      tabs = query('tabBarButton', :accessibilityLabel)
      tabs.index(name) == index.to_i
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
briar-0.0.5 lib/briar/bars/tabbar.rb
briar-0.0.4 lib/briar/bars/tabbar.rb