features/step_definitions/accessor_steps.rb in page-object-0.0.2 vs features/step_definitions/accessor_steps.rb in page-object-0.0.3

- old
+ new

@@ -86,21 +86,30 @@ When /^I select the radio button$/ do @page.send "select_milk_#{@how}".to_sym end When /^I get the text from the div$/ do - @div_text = @page.div_id + @text = @page.div_id end Then /^the text should be "([^"]*)"$/ do |expected_text| - @div_text.should == expected_text + @text.should == expected_text end When /^I search for the div by "([^"]*)"$/ do |how| - @div_text = @page.send "div_#{how}".to_sym + @text = @page.send "div_#{how}".to_sym end +When /^I get the text from the span$/ do + @text = @page.span_id +end + +When /^I search for the span by "([^"]*)"$/ do |how| + @text = @page.send "span_#{how}".to_sym +end + + When /^I click the button$/ do @page.button_id end Then /^I should be on the success page$/ do @@ -121,5 +130,22 @@ end When /^I retrieve a table element by "([^"]*)"$/ do |how| @element = @page.send "table_#{how}_table" end + +When /^I get the image element$/ do + @element = @page.image_id_image +end + +Then /^the image should be "([^"]*)" pixels wide$/ do |width| + @element.width.should == width.to_i +end + +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" +end +