I can't get Lettuce / Splinter or JsTestDriver to run tests of user interaction with Backbone-generated DOM objects. For example, at the hello backbone tutorial, I want to simulate the user's click on the button labeled "Add list item", then verify that a <li>
element of text "hello world1" has appeared.
JsTestDriver: I can get a reference to the button element and call click()
on it, but then document.getElementsByTagName("li")
fail (or return null?).
Johansen's excellent book says that testing event handlers isn't properly a unit testing task. So I tried my BDD (?) tools for Django:
Lettuce / Splinter / Django: The Splinter Browswer object can't see the text in the button, never mind get a reference to it or click it. (It does handle these operations for elements created via HTML.) Neither world.browser.is_text_present() nor find_by_id() work; passing a wait time to the former didn't help.
I would really prefer to avoid going straight to Selenium, and thought that these tools made that unnecessary. So now what?