Find elements by data attributes
问题 I'm improving my tests with RSpec and capybara-webkit , trying to delete all the css and xpath selectors like find('#edit_user > div:nth-child(7) > div > div > button').click and I'm looking for the best option to replace them. I was going to use the css class of the elements but some "pro" capybara tester said this is not the best option. So my question is: can I use the data attributes in my tests? If I have an element <button name="button" type="submit" class="button last" data-test="edit