If you’re anything like me, you’re not only strikingly handsome but also in a weird love affair with the idea of validating an arbritarily deep hierarchy of HTML tags from within cucumber. Like when oh I don’t know.. Say you have an ul like so:
Then you want to be able to write the following steps:
Then I should see "A.1.1" under "A.1", "A"
And I should see "B.1" under "B"
And I should see "A" besides "B"
Or maybe you don’t. But at least after drinking some Mac Queen’s Nessie Whisky Malt Red Beer, I for one certainly did.. Also: working with Nokogiri & XPath can be oddly ruminant!
And here it is, the (soon-to-be) patented prototype implementation of said (possibly stupid) awesomity:
This is either awesome or incredibly stupid.
If you’re anything like me, you’re not only strikingly handsome but also in a weird love affair with the idea of validating an arbritarily deep hierarchy of HTML tags from within cucumber. Like when oh I don’t know.. Say you have an ul like so:
<ul> <li><a href="/a">A</a> <ul> <li><a href="/a/1">A.1</a> <ul> <li><a href="/a/1/1">A.1.1</a></li> </ul> </li> </ul> </li> <li><a href="/b">B</a> <ul> <li><a href="/b/1">B.1</a></li> </ul> </li> </ul>Then you want to be able to write the following steps:
Or maybe you don’t. But at least after drinking some Mac Queen’s Nessie Whisky Malt Red Beer, I for one certainly did.. Also: working with Nokogiri & XPath can be oddly ruminant!
And here it is, the (soon-to-be) patented prototype implementation of said (possibly stupid) awesomity: