Question

For my acceptance tests I use Steak and Capybara (+ Envjs). When trying to find an element like this find("#ticker").find("li:eq(0)") it tells me Unable to find 'li:eq(0)', but find("#ticker").find("li:eq(1)") return the correct first li element in the list. I am used to that eq selector starts with 0 (jQuery). Why does eq selector in Capybara starts with 1? Bug or feature?

Update

It seems that it is some unofficial selector which works like nth-child. What does Capybara (/Envjs) use under the hood for selectors? It doesn't seem to be jQuery as it would start with eq(0) as mentioned above.

Was it helpful?

Solution

Capybara uses Nokogiri under the hood.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top