Sha256: 86d68144a2114bef7cb084cd68ddabbf3d2e36eecb622dda5c880a25b82a87cb

Contents?: true

Size: 922 Bytes

Versions: 8

Compression:

Stored size: 922 Bytes

Contents

When /^I select "([^\"]*)" as the (first|second) type$/ do |type, which|
  name = case which
         when "first" then "lhs"
         when "second" then "rhs"
         else raise "bad which"
         end
  browser.select_list(:id => "#{name}_type").select(type)
end

When /^I select "([^\"]*)" for "([^\"]*)" as the (first|second) value$/ do |field, resource, which|
  name = case which
         when "first" then "lhs"
         when "second" then "rhs"
         else raise "bad which"
         end
  s = browser.select_list(:id => "#{name}_value_select")
  optgroup = s.object.child_nodes.detect do |node|
    Java::ComGargoylesoftwareHtmlunitHtml::HtmlOptionGroup === node &&
      node.label_attribute == resource
  end
  option = optgroup.child_nodes.detect do |node|
    Java::ComGargoylesoftwareHtmlunitHtml::HtmlOption === node &&
      node.text == field
  end
  s.object.set_selected_attribute(option, true)
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
coupler-0.0.9-java features/step_definitions/matchers_steps.rb
coupler-0.0.8-java features/step_definitions/matchers_steps.rb
coupler-0.0.7-java features/step_definitions/matchers_steps.rb
coupler-0.0.6-java features/step_definitions/matchers_steps.rb
coupler-0.0.4-java features/step_definitions/matchers_steps.rb
coupler-0.0.3-java features/step_definitions/matchers_steps.rb
coupler-0.0.2-java features/step_definitions/matchers_steps.rb
coupler-0.0.1-java features/step_definitions/matchers_steps.rb