Open mattheworiordan opened 12 years ago
Sorry, I should have added this in for reference, http://stackoverflow.com/questions/4124523/what-library-does-capybara-use-as-css-selector. I have seen a few mentions online of people experiencing the same surprise.
See https://github.com/tenderlove/nokogiri/issues/628 for related bug report.
Because this sort of change can break lots of things in bad ways, we're planning on addressing JQuery compatibility in 2.0. You can read more about the roadmap here: https://github.com/tenderlove/nokogiri/blob/master/ROADMAP.md
I'll add this issue to the roadmap.
Thanks for the reply, makes sense to make this part of a bigger update as you're right, it could certainly break things.
I read on https://github.com/tenderlove/nokogiri/wiki/From-jQuery-Traversing about using :eq for traversing and selecting an element using Nokogiri, which is great... untilI discovered that :eq(1) refers to the first element with Nokogiri, and in JQuery it refers to the second element (zero indexed), see http://api.jquery.com/eq/. As I interchangeably use my CSS selectors in client-side Javascript tests and Capybara tests, this is causing endless issues.
I propose that :eq should be compatible with JQuery and use an zero based index.