teamcapybara / capybara

Acceptance test framework for web applications

Home Page:http://teamcapybara.github.io/capybara/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

table_row selector does not work with an array longer than two values

jparr opened this issue · comments

Meta

Capybara Version: 3.40.0

Expected Behavior

have_selector(:table_row, %w[Thomas Walpole Oceanside]) should match against a row with those values

Actual Behavior

The selector works if there are only two values as demonstrated in the tests but fails if there are more than two values.

Steps to reproduce

Add the third column to the test as shown here: jparr@e7bac39

If you look at how this is implemented for the :table, with_rows: [...] selector you can see that it builds a nested xpath here:

cell[XPath.following_sibling[cond]]

The table_row selector builds a different shape for its xpath. The commit above makes the necessary change.