I'm interested in applying another layer of abstraction on my cucumber webrat BDD suite that knows about the DOM I am working with.
Currently I am writing step definitions something like this example:
response_body.should have_selector("div", :id => 'left-side-bar') do |div|
div.should have_selector("h1", :content => 'Hello')
... other stuff
end
I know I can do this with xpath and various other ways but I want to use my own DSL like this:
left_sidebar.should have_heading("Hello")
Basically, I want to represent the project specific entities my client requires such menu items, blocks or widgety things, columns, header footer and such in the DSL.
How would I do this? Is this practical? My application isn't a rail application (if that matters)