Skip to content

Instantly share code, notes, and snippets.

@tpope
Created February 9, 2010 14:34
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save tpope/299241 to your computer and use it in GitHub Desktop.
Save tpope/299241 to your computer and use it in GitHub Desktop.
When /^(.*) in the "([^\"]*)" section$/ do |action, title|
within "//*[(h1|h2|h3|h4|h5|h6|legend|caption)/descendant-or-self::*[contains(text(), '#{title}')]]" do
When action
end
end
When /^(.*) in the "([^\"]*)" row$/ do |action, title|
within "//*[(th|td)/descendant-or-self::*[contains(text(), '#{title}')]]" do
When action
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment