Test Automation Univerity is an Applitools sponsored free collection of courses to help train automation developers in their craft, from those just entering the field to seasoned experts.
TAU-Capybara is the companion piece for the Test Automation University course, Introduction to Capybara, created by T.J. Maher: https://testautomationu.applitools.com/capybara-ruby/
Capybara is a domain specific language – a DSL – that comes with methods that allow you to visit a page, fill in a textbox, click a button, click a link, check a checkbox, choose a radio button, selecting an item from a dropdown, search within a section of the page, test a login screen, and verify popups and modals work. Sample code for these features can be found in the intro section.
In order to run tests in the intro section:
- Download the entire TAU Capybara project to your local machine, through Zip file or Git.
- Go into the intro folder of the project: cd intro
- Install all intro project dependencies: bundle install
- Run all tests in the spec folder: bundle exec rspec spec
- Run only the first test in the spec folder: bundle exec rspec spec/features/01_visit_home_spec.rb
The Advanced Topics section consists of four sample projects:
- 01_debugging_with_save_and_open: Explore how Capybara saves screenshots, then with the Launchy gem, opens them to view.
- 02_chrome_logging: Examine how the Chromium project has allowed users to trap Selenium WebDriver errors, and JavaScript errors in the browser.
- 03_apparition_driver: Implementing the new headless Apparition browser, created by Thomas Walpole, the current maintainer of Capybara.
- 04_applitools: Review how to integrate Applitools Eyes into your Capybara project in order to perform visual validation.
Each of the four Advanced Topics has its own project folder. In order to run:
- From the root folder: Change the directory to the topic you wish, such as: cd advanced_topics/01_debugging_with_save_and_open
- Install all project dependencies of that advanced topic: bundle install
- Once in the proper subtopic folder, to run all projects in that subfolder: bundle exec rspec spec
All sample code tests against Dave Haeffner's test site, The-Internet.