class Cucumber::Salad::Widgets::AutoTable
Public Instance Methods
Protected Instance Methods
ensure_table_loaded()
click to toggle source
# File lib/cucumber/salad/widgets/auto_table.rb, line 14 def ensure_table_loaded root.find(data_row_selector) rescue Capybara::Ambiguous end
Private Instance Methods
data_cell_selector()
click to toggle source
# File lib/cucumber/salad/widgets/auto_table.rb, line 21 def data_cell_selector 'td' end
data_row(node)
click to toggle source
# File lib/cucumber/salad/widgets/auto_table.rb, line 25 def data_row(node) Row.new(root: node, cell_selector: data_cell_selector) end
data_row_selector()
click to toggle source
# File lib/cucumber/salad/widgets/auto_table.rb, line 29 def data_row_selector 'tbody tr' end
data_rows()
click to toggle source
# File lib/cucumber/salad/widgets/auto_table.rb, line 33 def data_rows @data_rows ||= root.all(data_row_selector).map { |n| data_row(n) } end
header_selector()
click to toggle source
# File lib/cucumber/salad/widgets/auto_table.rb, line 37 def header_selector 'thead th' end
headers()
click to toggle source
# File lib/cucumber/salad/widgets/auto_table.rb, line 41 def headers @headers ||= root.all(header_selector).map { |n| node_text(n).downcase } end
values()
click to toggle source
# File lib/cucumber/salad/widgets/auto_table.rb, line 49 def values @values ||= data_rows.map(&:values) end