bbangert / lettuce_webdriver

Selenium webdriver for lettuce
MIT License
81 stars 32 forks source link

CSS Selector Steps (WIP) #32

Closed npilon closed 11 years ago

npilon commented 11 years ago

Add some steps to lettuce_webdriver that use CSS selectors to pick elements, rather than XPath expressions, for more expressive test cases.

npilon commented 11 years ago

@danni This is something I'm working on for webdriver at the request of our QA guy. The idea is to use a JQuery-like "dressing" to avoid any chance of ambiguity with "normal" steps, and make these available alongside the others.

danni commented 11 years ago

@npilon: did you see my blog post about integrating actual jQuery selectors into Selenium? http://blogs.gnome.org/danni/2012/11/19/extending-selenium-with-jquery/

Did you want this work reviewed?

npilon commented 11 years ago

Oh, that's quite clever - how good is its cross-browser support? I may use that instead of the css_selector method I'm using now; things like :visible and :input are too useful to spare!

I'd like your opinions on it, and those of anyone else using lettuce_webdriver. As mentioned, I'm not interested in obsoleting existing steps, but I want the new ones to be as generally useful as possible.

npilon commented 11 years ago

Though I don't think we need the WebElement trick, do we? Can't I execute_script directly on the browser object? Or does something go funny with this?

danni commented 11 years ago

Yeah you could just wrap it in a utility function. The inheriting came from a project where we used selenium directly. Not through BDD.

On Thursday, 26 September 2013, Nicholas Pilon wrote:

Though I don't think we need the WebElement trick, do we? Can't I execute_script directly on the browser object? Or does something go funny with this?

— Reply to this email directly or view it on GitHubhttps://github.com/bbangert/lettuce_webdriver/pull/32#issuecomment-25121086 .

npilon commented 11 years ago

I think I'll start making these available in their current form, then work out if there's a way I like for the jquery style.