Skip to content

Testing Jekyll

Patrick Kubiak edited this page Sep 5, 2017 · 2 revisions

Acceptance Testing with RSpec, Capybara, and Selenium

Technologies used to test 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

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

Capybara makes it easy to simulate user interaction with the website. It talks to the Selenium webdriver.

Selenium

Selenium automates browsers. It is mainly used for automating web applications for testing purposes.

rack-jekyll

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:

Clone this wiki locally