jnicklas/capybara — Issue #558: Avoid double dispatch with RSpec style DSL
Author: nyarly
Created: 2011-12-05 23:44:06+00:00
State: open

As I'm monkeypatching in some extensions to Capybara, I find myself wishing that there was a DSL of the form:

click.on link("Click here")
or
type.at field("Labelled like this")

So expanding that actions you can take was one touch point, and finding targets was another. I'm finding that locating anything even slightly complex means I have to revert to using XPath::HTML directly, and doing much more than clicking requires patching 4 classes to drill down to the driver.

(Yes, it would be best if I could locate elements by id all the time, but sadly, that would mean rewriting a lot of jquery plugins...)