Class: FillIN::ComplexInput

Inherits:
Object
  • Object
show all
Includes:
Pickles
Defined in:
lib/cucumber/pickles/steps/fill_in/complex_input.rb

Constant Summary

Constants included from Pickles

Pickles::VERSION

Instance Method Summary collapse

Methods included from Pickles

config, configure

Methods included from Helpers::Main

#attach_file, #blur, #parent_node, #select_input, #trigger

Methods included from Waiter

page, pending_ajax_requests_num, wait, wait_for_ajax

Methods included from NodeFinders

#_rescued_find, #detect_node, #find_input, #find_node

Constructor Details

#initialize(label, value, within) ⇒ ComplexInput

Returns a new instance of ComplexInput.



5
6
7
8
9
# File 'lib/cucumber/pickles/steps/fill_in/complex_input.rb', line 5

def initialize(label, value, within)
  @label = label
  @value = value
  @within = within || Capybara.current_session
end

Instance Method Details

#callObject



11
12
13
14
15
16
17
# File 'lib/cucumber/pickles/steps/fill_in/complex_input.rb', line 11

def call
  @value.split(/\s*:\s*/).each.with_index do |value, index|
    input_locator = "#{label}[#{index}]"

    FillIN::Input.new(input_locator, value, @within)
  end
end