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 Attribute Summary collapse

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, #guess_node

Constructor Details

#initialize(label, value, within) ⇒ ComplexInput

Returns a new instance of ComplexInput.



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

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

Instance Attribute Details

#labelObject (readonly)

Returns the value of attribute label.



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

def label
  @label
end

#valueObject (readonly)

Returns the value of attribute value.



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

def value
  @value
end

Instance Method Details

#callObject



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

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