Module: Briar::Picker

Defined in:
lib/briar/picker/picker.rb,
lib/briar/picker/date_picker.rb,
lib/briar/picker/date_picker_core.rb,
lib/briar/picker/date_picker_manipulation.rb

Defined Under Namespace

Modules: DateCore, DateManipulation, DateSteps

Instance Method Summary collapse

Instance Method Details

#scroll_picker(dir, picker_id) ⇒ Object



32
33
34
35
36
37
38
39
40
# File 'lib/briar/picker/picker.rb', line 32

def scroll_picker(dir, picker_id)
  should_see_picker picker_id
  if dir.eql? 'down'
    picker_scroll_down_on_column 0
  else
    picker_scroll_up_on_column 0
  end
  step_pause
end

#selected_title_for_column(column) ⇒ Object

may only work on circular pickers - does not work on non-circular pickers because the visible titles do not follow the selected index



26
27
28
29
30
# File 'lib/briar/picker/picker.rb', line 26

def selected_title_for_column (column)
  selected_idx = picker_current_index_for_column column
  titles = visible_titles column
  titles[selected_idx]
end

#should_not_see_picker(picker_name) ⇒ Object



13
14
15
16
17
18
# File 'lib/briar/picker/picker.rb', line 13

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

#should_see_picker(picker_name) ⇒ Object



6
7
8
9
10
11
# File 'lib/briar/picker/picker.rb', line 6

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

#visible_titles(column) ⇒ Object



20
21
22
# File 'lib/briar/picker/picker.rb', line 20

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