Sha256: 3e510313b59b660d17f1b7a64eee9e3a3e647082a7ddb1d82d605929fb165e69

Contents?: true

Size: 1.24 KB

Versions: 2

Compression:

Stored size: 1.24 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 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|
  on(MainScreen).send("#{name.to_field}_selections").should eq(value.split(', '))
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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mohawk-0.1.4 features/step_definitions/combo_box_steps.rb
mohawk-0.1.0 features/step_definitions/combo_box_steps.rb