Sha256: f7991a09b31ff7760598f07987818a079b3ed6f9817f6aa302ae5713f874276c

Contents?: true

Size: 1.41 KB

Versions: 5

Compression:

Stored size: 1.41 KB

Contents

When /^I select "([^\"]*)" from the select list$/ do |text|
  @page.sel_list_id = text
end

When /^I search for the select list by "([^\"]*)"$/ do |how|
  @how = how
end

When /^I search for the select list by "([^"]*)" and "([^"]*)"$/ do |param1, param2|
  @how = "#{param1}_#{param2}"
end

Then /^I should be able to select "([^\"]*)"$/ do |value|
  @page.send "sel_list_#{@how}=".to_sym, value
end

Then /^the value for the selected item should be "([^\"]*)"$/ do |value|
  result = @page.send "sel_list_#{@how}".to_sym
  result.should == value
end

When /^I find a select list while the script is executing$/ do
  @select_list = @page.select_list_element(:id => 'sel_list_id')
end

Then /^I should be able to select "([^\"]*)" from the list$/ do |value|
  @select_list.select(value)
end

Then /^I should see that the select list exists$/ do
  @page.sel_list_id?.should == true
end

Then /^the selected option should be "([^\"]*)"$/ do |text|
  @page.select_list_element(:id => 'sel_list_id').selected_options[0].should == text
end

Then /^the select list should include "([^\"]*)"$/ do |text|
  @page.sel_list_id_element.should include text
end

Then /^the select list should know that "([^\"]*)" is selected$/ do |text|
  @page.sel_list_id_element.selected?(text).should be_true
end

Then /^the value for the option should be "([^\"]*)"$/ do |value|
  element = @page.send "sel_list_#{@how}_element".to_sym
  element.value.should == value
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
page-object-0.6.7 features/step_definitions/select_list_steps.rb
page-object-0.6.6 features/step_definitions/select_list_steps.rb
page-object-0.6.5 features/step_definitions/select_list_steps.rb
page-object-0.6.4 features/step_definitions/select_list_steps.rb
page-object-0.6.3 features/step_definitions/select_list_steps.rb