Sha256: 0bc931c728ada123a8ae30e8fedebede27fde9feaa13eb19456616f97321c5b2

Contents?: true

Size: 1023 Bytes

Versions: 4

Compression:

Stored size: 1023 Bytes

Contents

require 'calabash-cucumber'

module Briar
  module Picker
    include Briar::Picker_Shared
    def should_see_picker (picker_name)
      picker_exists = !query("pickerView marked:'#{picker_name}").empty?
      unless picker_exists
        screenshot_and_raise "could not find picker named #{picker_name}"
      end
    end

    def should_not_see_picker (picker_name)
      picker_exists = !query("pickerView marked:'#{picker_name}").empty?
      if picker_exists
        screenshot_and_raise "expected to _not_ see #{picker}"
      end
    end

    def visible_titles (column)
      query("pickerTableView index:#{column} child pickerTableViewWrapperCell", :wrappedView, :text).reverse
    end

# may only work on circular pickers - does _not_ work on non-circular pickers
# because the visible titles do _not_ follow the selected index
    def selected_title_for_column (column)
      selected_idx = picker_current_index_for_column column
      titles = visible_titles column
      titles[selected_idx]
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
briar-0.0.7 lib/briar/picker/picker.rb
briar-0.0.6 lib/briar/picker/picker.rb
briar-0.0.5 lib/briar/picker/picker.rb
briar-0.0.4 lib/briar/picker/picker.rb