features/step_definitions/table_steps.rb in page-object-0.6.6 vs features/step_definitions/table_steps.rb in page-object-0.6.7
- old
+ new
@@ -1,7 +1,8 @@
Then /^the data for row "([^\"]*)" should be "([^\"]*)" and "([^\"]*)"$/ do |row, col1, col2|
- table_row = @element[row.to_i - 1]
+ row = (row.to_i - 1) if row.to_i > 0
+ table_row = @element[row]
table_row[0].text.should == col1
table_row[1].text.should == col2
end
@@ -35,6 +36,14 @@
@element.last_row[1].text.should == col2
end
Then /^I should see that the table exists$/ do
@page.table_id?.should == true
-end
\ No newline at end of file
+end
+
+Then /^the data for column "([^\"]*)" and row "([^\"]*)" should be "([^\"]*)"$/ do |column, row, value|
+ @element[row.to_i - 1][column].text.should == value
+end
+
+Then /^the data for row "([^\"]*)" and column "([^\"]*)" should be "([^\"]*)"$/ do |row, column, value|
+ @element[row][column].text.should == value
+end