Skip to content

sai59/capybara_quick_ref

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 

Repository files navigation

capybara_quick_ref

Visiting pages

  visit "/posts"

Current path

  current_path.should == "/login"

Buttons and Links

  click_link("Ads")    # Name or id of the link
  click_button("Save") # Name or id of the button
  click_on("some")     # Either link or button

Form elements

  fill_in("Name", :with => "DHH")           # Name or id of the field  # Text field
  select("Male", :from => "gender_id")      # Normal Select, Use id of the field
  select2_select("Male", "gender_id_input") # Select2 select, _input is necessory
  check('A Checkbox')                       # Checkbox, use id or name
  choose('Male')                            # Name or id of the Radio Button

Page expectations

  expect(page).to have_content("Awesome Post") # expecting text  
  expect(page).to have_link("Edit Post")       # expecting link
  expect(page).to have_css(".acitve")          # expecting css

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published