features/step_definitions/accessor_steps.rb in page-object-0.2.2 vs features/step_definitions/accessor_steps.rb in page-object-0.2.3
- old
+ new
@@ -179,15 +179,15 @@
When /^I retrieve a table cell element by "([^"]*)" and "([^"]*)"$/ do |param1, param2|
@cell_data = @page.send "cell_#{param1}_#{param2}"
end
When /^I retrieve a table element by "([^\"]*)"$/ do |how|
- @element = @page.send "table_#{how}_table"
+ @element = @page.send "table_#{how}_element"
end
When /^I retrieve a table element by "([^"]*)" and "([^"]*)"$/ do |param1, param2|
- @element = @page.send "table_#{param1}_#{param2}_table"
+ @element = @page.send "table_#{param1}_#{param2}_element"
end
When /^I get the image element$/ do
@element = @page.image_id_image
end
@@ -199,47 +199,47 @@
Then /^the image should be "([^\"]*)" pixels tall$/ do |height|
@element.height.should == height.to_i
end
When /^I get the image element by "([^\"]*)"$/ do |how|
- @element = @page.send "image_#{how}_image"
+ @element = @page.send "image_#{how}_element"
end
When /^I get the image element by "([^"]*)" and "([^"]*)"$/ do |param1, param2|
- @element = @page.send "image_#{param1}_#{param2}_image"
+ @element = @page.send "image_#{param1}_#{param2}_element"
end
When /^I retrieve the hidden field element$/ do
- @element = @page.hidden_field_id_hidden_field
+ @element = @page.hidden_field_id_element
end
Then /^I should see the hidden field contains "([^\"]*)"$/ do |text|
@page.hidden_field_id.should == text
end
When /^I search for the hidden field by "([^\"]*)"$/ do |how|
- @element = @page.send "hidden_field_#{how}_hidden_field"
+ @element = @page.send "hidden_field_#{how}_element"
end
Then /^hidden field element should contains "([^\"]*)"$/ do |text|
@element.value.should == text
end
When /^I search for the hidden field by "([^"]*)" and "([^"]*)"$/ do |param1, param2|
- @element = @page.send "hidden_field_#{param1}_#{param2}_hidden_field"
+ @element = @page.send "hidden_field_#{param1}_#{param2}_element"
end
Then /^I should be able to submit the form$/ do
@element.submit
end
When /^I locate the form by "([^\"]*)"$/ do |how|
- @element = @page.send "form_#{how}_form"
+ @element = @page.send "form_#{how}_element"
end
When /^I locate the form using "([^"]*)" and "([^"]*)"$/ do |param1, param2|
- @element = @page.send "form_#{param1}_#{param2}_form"
+ @element = @page.send "form_#{param1}_#{param2}_element"
end
When /^I get the text from the list item$/ do
@text = @page.li_id
end
@@ -251,40 +251,40 @@
When /^I search for the list item by "([^"]*)" and "([^"]*)"$/ do |param1, param2|
@text = @page.send "li_#{param1}_#{param2}"
end
When /^I get the first item from the unordered list$/ do
- @element = @page.ul_id_unordered_list[0]
+ @element = @page.ul_id_element[0]
end
Then /^the list items text should be "([^\"]*)"$/ do |expected_text|
@element.text.should == expected_text
end
When /^I search for the unordered list by "([^\"]*)"$/ do |how|
- @list = @page.send "ul_#{how}_unordered_list"
+ @list = @page.send "ul_#{how}_element"
end
When /^I search for the unordered list by "([^"]*)" and "([^"]*)"$/ do |param1, param2|
- @list = @page.send "ul_#{param1}_#{param2}_unordered_list"
+ @list = @page.send "ul_#{param1}_#{param2}_element"
end
When /^I get the first item from the list$/ do
@element = @list[0]
end
When /^I get the first item from the ordered list$/ do
- @element = @page.ol_id_ordered_list[0]
+ @element = @page.ol_id_element[0]
end
When /^I search for the ordered list by "([^\"]*)"$/ do |how|
- @list = @page.send "ol_#{how}_ordered_list"
+ @list = @page.send "ol_#{how}_element"
end
When /^I search for the ordered list by "([^"]*)" and "([^"]*)"$/ do |param1, param2|
- @list = @page.send "ol_#{param1}_#{param2}_ordered_list"
+ @list = @page.send "ol_#{param1}_#{param2}_element"
end
Then /^the table should have "([^\"]*)" rows$/ do |rows|
@element.rows.should == rows.to_i
end
@@ -313,10 +313,10 @@
Then /^each item should contain "([^\"]*)"$/ do |text|
@list.each { |item| item.text.should include text }
end
Then /^option "([^\"]*)" should contain "([^\"]*)"$/ do |opt_num, text|
- @element = @page.send "sel_list_#{@how}_select_list".to_sym
+ @element = @page.send "sel_list_#{@how}_element".to_sym
@element[opt_num.to_i - 1].text.should == text
end
Then /^each option should contain "([^\"]*)"$/ do |text|
@element.options.each do |option|