Class: FillIN::Select
- Inherits:
-
Object
- Object
- FillIN::Select
- Defined in:
- lib/cucumber/pickles/steps/fill_in/select.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(label, value, within) ⇒ Select
constructor
A new instance of Select.
Constructor Details
#initialize(label, value, within) ⇒ Select
Returns a new instance of Select.
3 4 5 6 7 |
# File 'lib/cucumber/pickles/steps/fill_in/select.rb', line 3 def initialize(label, value, within) @label = label @value = value @within = within || .current_session end |
Instance Method Details
#call ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/cucumber/pickles/steps/fill_in/select.rb', line 9 def call input = FillIN::Input.new(@label, @value, @within).call text, selector = NodeTextLookup.lookup_values(value) item_xpath = selector.(text) Waiter.wait do input.find(:xpath, "./ancestor::*[#{item_xpath}][1]/#{item_xpath}").click end Pickles.blur(input) Waiter.wait_for_ajax input end |