Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一张有很多行的桌子。这些行根据其中的数据进行排序。我正在寻找为表中行的顺序编写测试。有没有办法使用 RSpec/Capybara 做到这一点?
您可以尝试使用 xpath 选择器,例如
within(:xpath, "//table/tr[1]/td") do page.should have_content('First row content') end within(:xpath, "//table/tr[2]/td") do page.should have_content('Second row content') end