Selenium
Watir
Capybara
Easy to read and maintain.
Agile/TDD environments.
Avoid doing repetitive tasks.
Capybara is a library/gem built to be used on top of an underlying web-based driver.
Tool of choice for developing web-based automated tests.
Capybara will try to locate the relevant element in the DOM (Document Object Model) and execute the action, such as click button, link, etc.
it offers a user-friendly DSL (Domain Specific Language) which is used to describe actions that are executed by the underlying web driver.
rack::test
selenium-webdriver
capybara-webkit
gem install capybara
Cucumber is a powerful tool to write BDD Tests
Feature: Find the GameSparks Website
Scenario: Search for the website
Given I am on the Google homepage
Then I will search for "GameSpark"
Then I should see "GameSpark"
Then I will click the Get Started link
1. Describe behaviour in plain text
2. Write a step definition in Ruby
Given(/^I am on the Google homepage$/) do
visit 'http://www.google.com'
end
Then(/^I will search for "(.*?)"$/) do |searchText|
fill_in 'lst-ib', :with => searchText
end
Then(/^I should see "(.*?)"$/) do |expectedText|
page.should have_content(expectedText)
end
Then(/^I will click the Get Started link$/) do
click_link('Get Started')
end