features/step_definations/table_steps.rb in druid-ts-0.0.1 vs features/step_definations/table_steps.rb in druid-ts-1.1.0
- old
+ new
@@ -1,11 +1,11 @@
When(/^I retrieve a table element$/) do
- @element = @page.table_id_table
+ @element = @page.table_id_element
end
When(/^I retrieve a table element by "(.*?)"$/) do |how|
- @element = @page.send "table_#{how}_table".to_sym
+ @element = @page.send "table_#{how}_element".to_sym
end
Then(/^the data for row "(.*?)" should be "(.*?)" and "(.*?)"$/) do |row, col1, col2|
row = @element[row.to_i - 1]
expect(row[0].text).to eql col1
@@ -32,7 +32,21 @@
expect(column.text).to include text
end
end
When(/^I retrieve a table element bys "(.*?)" and "(.*?)"$/) do |param1, param2|
- @element = @page.send "table_#{param1}_#{param2}_table".to_sym
+ @element = @page.send "table_#{param1}_#{param2}_element".to_sym
+end
+
+When(/^I retrieve a table element while the script is executing$/) do
+ @element = @page.table_element(:id => 'table_id')
+end
+
+Then(/^the data for the first row should be "([^"]*)" and "([^"]*)"$/) do |col1, col2|
+ expect(@element.first_row[0].text).to eql col1
+ expect(@element.first_row[1].text).to eql col2
+end
+
+Then(/^the data for the last row should be "([^"]*)" and "([^"]*)"$/) do |col1, col2|
+ expect(@element.last_row[0].text).to eql col1
+ expect(@element.last_row[1].text).to eql col2
end