-
Notifications
You must be signed in to change notification settings - Fork 22
Testing Jekyll
Technologies used to test the site:
- RSpec - Behaviour Driven Development for Ruby
- Capybara - Simulates user interaction
- Selenium - Automates browsers
- rack-jekyll - Serves the site
Tests are written in RSpec with Capybara as the acceptance test API Selenium automates the browser to run these tests against the site which is served by rack-jekyll.
RSpec is behavior driven development for Ruby. It uses the idea of Test-driven development (TDD). The TDD software development process relies on the repetition of a very short development cycle. The developer writes an initially failing test and then writes code to pass that test.
Capybara makes it easy to simulate user interaction with the website. It talks to the Selenium webdriver.
Selenium automates browsers. It is mainly used for automating web applications for testing purposes.
Most popular Ruby applications (such as Ruby on Rails and Sinatra) use the Rack interface to connect web requests to Ruby code. Since Jekyll generates static pages, it doesn't have a Rack interface by default - however rack-jekyll is a gem that bridges the gap, and allows us to serve our pages to Selenium so we can test it using the browser.
Using multiple browsers see: http://blog.bruzilla.com/2012/04/10/using-multiple-capybara-sessions-in-rspec-request.html
References: