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

Unable to find table row by Hash/Keyword Arguments

andrewhavens opened this issue · comments

I just ran into this issue and found the behavior surprising.

# doesn't work
find(:table_row, "First Name" => person.first_name)

# works
find(:table_row, {"First Name" => person.first_name})

The error that you see is also confusing:

# NoMethodError:
#   undefined method `shift' for nil:NilClass
#   ...capybara/selector/definition/table_row.rb:15:in `block (2 levels) in <top (required)>'

I found this issue that describes the problem in a little more detail but it was closed without being fixed: #2664

Meta

Capybara Version: 3.39.2
Driver Information: Cuprite 0.14.3

Please read the reasoning on the ticket you linked, you need to pass the Hash because of ruby 3 behavior with keywords