Sha256: 5583921b78c7e7a9748ca5db3714d04ef0ae83e91d0a3761bba61b23c2b3a78c

Contents?: true

Size: 1.64 KB

Versions: 2

Compression:

Stored size: 1.64 KB

Contents

When /^I select index(es)? "(.*?)" from the "(.*?)" combo box$/ do |_, indexes, name|
  on(MainScreen) do |screen|
    indexes.split(', ').map(&:to_i).each do |index|
      screen.send "select_#{name.to_field}", index
    end
  end
end

When /^I select the value "(.*?)" from the "(.*?)" combo box$/ do |index, name|
  on(MainScreen).send "#{name.to_field}=", index
end

When(/^I select the regex value "([^"]*)" from the "([^"]*)" combo box$/) do |regex, name|
  on(MainScreen).send "#{name.to_field}=", /#{regex}/
end

When(/^I clear the item at index "([^"]*)" from the "([^"]*)" combo box$/) do |which, name|
  on(MainScreen).send("clear_#{name.to_field}", which.to_i)
end

When(/^I clear item "([^"]*)" from the "([^"]*)" combo box$/) do |which, name|
  on(MainScreen).send("clear_#{name.to_field}", which)
end

Then /^the "(.*?)" option(s)? should be selected in the "(.*?)" combo box$/ do |value, has_multiple, name|
  if has_multiple
    on(MainScreen).send("#{name.to_field}_selections").should eq(value.split(', '))
  else
    on(MainScreen).send("#{name.to_field}").should eq(value)
  end
end

When /^I look at the options for the "(.*?)" combo box"$/ do |name|
  @options = on(MainScreen).send("#{name.to_field}_options")
end

Then /^I should see the following options:$/ do |table|
  expected_options = table.hashes.map {|row| row["Option"] }
  @options.should eq(expected_options)
end

Given(/^we toggle the multi-select button$/) do
  on(MainScreen).toggle_multi
end

Then(/^the application should know that "([^"]*)" was selected$/) do |expected_value|
  on(MainScreen).fruits_label.should eq(expected_value)
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mohawk-0.2.1 features/step_definitions/combo_box_steps.rb
mohawk-0.2 features/step_definitions/combo_box_steps.rb