balvig / utensils

Rspec stuff we use over and over again
MIT License
11 stars 9 forks source link

Add a :role selector to Capybara, based on data-role attribute #6

Closed davidstosik closed 7 years ago

davidstosik commented 7 years ago

Alllows:

<li data-role="recipe">

within(:role, "recipe") do
  # ...
end

expect(page).to have_role?("recipe")

expect(page).to have_role?("recipe", count: 20)

page.find_all(:role, "recipe")
davidstosik commented 7 years ago

@balvig Should I close this?

balvig commented 7 years ago

@davidstosik thanks a lot for this! I guess based on our conclusions in https://github.com/cookpad/guides/pull/49 we won't need it just yet (could change!), so maybe ok to close for now?

davidstosik commented 7 years ago

Okay!