For this course, I've created a sample project for us to download — TAU-Capybara — you can access the sample project on my GitHub site.
There's two ways to install this project: either through a zip file or through Git.
In order to download it through a zip file, hit Clone or Download > Download ZIP and save this project and extract it.
Or, if you wanted to use Git, you can copy to URL [from the Clone or download box].
Go to the directory you want to save it in, and type in
and paste in the link [after it on the same line].
Now the project is all installed.
As you are learning automation development, I fully recommend not only that you code sample projects on your own, but that you upload the best of them to Github.com.
This project consists of 2 parts:
The intro, which contains specifications of all the basic features of capybara we will be testing
Advanced topics, which contains topics such as adding ChromeDriver logging, checking out the new Apparition browser built by Team Capybara, and how to integrate visual validation with Applitools
Let's focus on the intro section for now.
When you go into the intro folder, we can see there's a gemfile which contains all the Ruby dependencies for this project.
Keeping with the Ruby theme, each code library in Ruby is called a gem.
The Capybara gem [
gem ‘capybara’] which contains the tool we're using
gem ‘rspec’], which will be our test framework
Selenium WebDriver [
gem ‘selenium-webdriver’], the Ruby bindings for Selenium.
To enter the project, we're going to:
Type “cd” for change directory, “tau” —
cd tau — and then a tab to complete:
Enter the intro folder
And to install all the dependencies, type in:
Bundler looks at the name of each Ruby gem, the versions we're requesting, and finds it on rubygems.org and downloads it to your computer.
Going back to our gemfile, how did I know what was the newest version of Capybara?
To find out, all I had to do was go to rubygems.org and search for “capybara”. The latest version pulls right up, and you can see as of this date that the latest version was released March 19th.
To copy this to my gemfile, all I had to do was copy to the clipboard, go back to my gemfile, and paste it there.
When we ran
bundle install, this command took each gem, checked it against the dependencies listed in rubygems.org, and downloaded each dependency we needed to run each gem in the gemfile.
In the next section, we'll take a look at the Spec and the Spec Helper.
The quiz for this chapter can be found in section 1.3