For my acceptance tests, I use Steak and Capybara (+ Envjs). When he tries to find such an element, find("#ticker").find("li:eq(0)")he informs me Unable to find 'li:eq(0)', but find("#ticker").find("li:eq(1)")returns the correct first element liin the list. I'm used to the fact that the eq selector starts with 0 (jQuery). Why does the eq selector in Capybara start at 1? Error or function?
Update
It seems to be some kind of unofficial selector that works like nth-child. What does Capybara (/ Envjs) use under the hood for selectors? This doesn't seem to be jQuery since it started with eq (0) as mentioned above.
source
share