Remember to call super in any subclasses that override teardown.

Capybaras also wallow in shallow water and mud to keep cool during a hot day before wandering out in the evening to graze. They tend to eat around dawn and dusk, but if capybaras feel threatened, they wait until the safe cover of night to eat. Lots of helpers

In warmer climates, breeding may occur all year long, although the wet season is the most popular breeding time. Capybara courtship seems to be a water sport, and breeding occurs in the water. Five to six months later, the pregnant female leaves the group to give birth in a quiet spot. A female usually has one litter of young each year, but if the conditions are good and food is plentiful, she might produce a second litter later in the year. Capy cuties

Alternatively you can set the default selector to XPath:

Take a trip through the natural world with our themed collections of video clips from the natural history archive.

The capybara_minitest_spec gem (GitHub, provides MiniTest::Spec expectations for Capybara. For example:

When alarmed, capybara will run away quickly and will head towards water and swim away to escape potential threats.

Capybara.exact and the exact option work together with the is expression inside the XPath gem. When exact is true, all is expressions match exactly, when it is false, they allow substring matches. Many of the selectors built into Capybara use the is expression. This way you can specify whether you want to allow substring matches or not. Capybara.exact is false by default.

Set up your base class as with Test::Unit. (On Rails, the right base class could be something other than ActionDispatch::IntegrationTest.)

You can accept or dismiss a confirmation by wrapping it in a block, as well:

Capybaras chew on bark to help wear down their front teeth (Tambako the Jaguar/flickr)

Note: If using Ruby < 2.0 you will also need to limit the version of mime-types to < 3.0 and the version of rack to < 2.0

If you are not using Rails, tag all the example groups in which you want to use Capybara with :type => :feature.

Water is a source of life for the capybara, as the animal eats water plants and grasses and uses the water itself to escape from danger. In fact, a capybara can stay underwater for up to five minutes at a time to hide from predators. It uses those webbed feet (four toes on each front foot and three on each back one) to swim as well as walk.

Like its relative the guinea pig, the capybara does not have the capacity to synthesize vitamin C, and capybaras not supplemented with vitamin C in captivity have been reported to develop gum disease as a sign of scurvy.[23]

Is it a beaver without a tail? A hairy pig without a snout? No, it’s a capybara, the largest rodent in the world! Standing 2 feet (60 centimeters) tall at the shoulder and built somewhat like a barrel with legs, the “capy” has long, light brown, shaggy hair, a face that looks like a beaver’s, no tail, and slightly webbed feet. Originally thought to be a pig of some sort, we now know that the capybara is a rodent, closely related to cavies and guinea pigs.

Standing 1.5 feet tall at the shoulder and weighing in at up to 150 pounds, capybaras are the largest rodents in the world. In fact, they're closely related to guinea pigs and rock cavies and distantly related to agoutis and chinchillas.

The following habitats are found across the Capybara distribution range. Find out more about these environments, what it takes to live there and what else inhabits them.

Note: By default Capybara will only locate visible elements. This is because a real user would not be able to interact with non-visible elements.

Animal kingdom record breakers - how fast can a cheetah run, how heavy is an elephant and what's bigger than a dinosaur? Watch amazing video clips from the BBC archive and uncover the fascinating facts about our smallest primate, the longest stick insect and the most venomous snake.

This is mostly useful for debugging. You should avoid testing against the contents of page.html and use the more expressive finder methods instead.

“Capybaras have been introduced to northern Florida. Several sightings suggest they have been breeding,” Congdon told Red Orbit. “They might be able to make a go of it in the United States.”

Note: find will wait for an element to appear on the page, as explained in the Ajax section. If the element does not appear it will raise an error.

Capybaras are wild animals that aren't accustomed to living in homes, but that hasn't stopped people from keeping them as pets. The creatures require a great deal of outdoor space for grazing, as well as a body of water for swimming, and feeding them can be expensive.

Capybara also comes with a built in DSL for creating descriptive acceptance tests:


Capybaras will use both vocalisations and scent to keep in contact with their offspring and the rest of the group.

These animals are most active during the morning and afternoon, and will often feed at these times. They will spend the rest of the day resting or wallowing in mud and water to keep cool.

RackTest can be configured with a set of headers like this:

You can help us bring other species back from the brink by supporting the San Diego Zoo Global Wildlife Conservancy. Together we can save and protect wildlife around the globe.

San Diego Zoo Animals (formerly Animal Bytes) is the source for facts, articles, photos, videos, sounds, and more about the wildlife that you can find at the San Diego Zoo and San Diego Zoo Safari Park, as well as animals and habitats that San Diego Zoo Global Wildlife Conservancy is working to help through conservation and research projects. 

Capybara helps you test web applications by simulating how a real user would interact with your app. It is agnostic about the driver running your tests and comes with Rack::Test and Selenium support built in. WebKit is supported through an external gem.

At the moment, Capybara supports Selenium 2.0 (Webdriver), not Selenium RC. In order to use Selenium, you'll need to install the selenium-webdriver gem, and add it to your Gemfile if you're using bundler. Provided Firefox is installed, everything is set up for you, and you should be able to start using Selenium right away.

Capybaras are strong swimmers; they are known to be able to stay underwater for up to 5 minutes.

The cucumber-rails gem comes with Capybara support built-in. If you are not using Rails, manually load the capybara/cucumber module:

You can interact with the webapp by following links and buttons. Capybara automatically follows any redirects, and submits forms associated with buttons.

By default Capybara will try to boot a rack application automatically. You might want to switch off Capybara's rack server if you are running against a remote application:

The main threat faced by the capybara is hunting, for both meat and its hide which is highly-valued in South America. Capybaras are sometimes killed by farmers as they are known to eat crops and compete for food with domestic livestock.

Capybaras are hunted for their meat and pelts in some areas,[33] and otherwise killed by humans who see their grazing as competition for livestock. In some areas, they are farmed, which has the effect of ensuring the wetland habitats are protected. Their survival is aided by their ability to breed rapidly.[15]

Sound isn't the only way capybaras communicate: they also use scent. Capys have a pair of scent glands on their rump that they use to mark territories and communicate with one another. Males often walk right over bushes to mark them and can leave behind hairs that are crusted with the oily, smelly stuff. The males also mark females! Females scent mark less often than males do, mostly during the wet season when they are looking for a mate. All in good company

Note: switching the driver creates a new session, so you may not be able to switch in the middle of a test.