CSC/ECE 517 Fall 2015 E1582 Create integration tests for the instructor interface using capybara and rspec: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
== Intro ==
== Intro ==


=== rspec ===
=== RSpec ===


=== capybara ===
=== Capybara ===
Capybara is a test tool for web application that simulates a real user to follow the scenarios of user stories.<ref>[https://github.com/jnicklas/capybara capybara on GitHub]</ref> It could interact with app to receive pages, parse the HTML and submit forms as a user would.<ref>[https://www.youtube.com/watch?v=p7ZcZNuZ0aw on YouTube]</ref>
Capybara is a web-based automation test tool that simulates a real user to follow the scenarios of user stories.<ref>[https://github.com/jnicklas/capybara Capybara on GitHub]</ref> It could interact with app to receive pages, parse the HTML and submit forms as a user would.<ref>[https://www.youtube.com/watch?v=p7ZcZNuZ0aw Introducing cucumber & capybara on YouTube]</ref> Used with RSpec and Ruby on Rails (version 1.9 or later), capybara makes it easier to write integration tests. <ref>[http://techiferous.com/2010/04/using-capybara-in-rails-3/ Using Capybara in Rails 3]</ref> It is used on the top of an underlying web-based driver and offers a user-friendly DSL (Domain Specific Language) to describe actions executed by the underlying web driver. Such as <code>rack::test</code>, <code>selenium-webdriver</code> and <code>capybara-webkit</code>.<ref>[http://www.sitepoint.com/basics-capybara-improving-tests/ The Basics of Capybara and Improving Your Tests]</ref>


=== integration test ===
In this project, we use capybara with rspec by adding the following line:
  require 'capybara/rspec'
Then put capybara specs in <code>spec/features</code>.
=== Integration test ===





Revision as of 20:49, 5 November 2015

Intro

RSpec

Capybara

Capybara is a web-based automation test tool that simulates a real user to follow the scenarios of user stories.<ref>Capybara on GitHub</ref> It could interact with app to receive pages, parse the HTML and submit forms as a user would.<ref>Introducing cucumber & capybara on YouTube</ref> Used with RSpec and Ruby on Rails (version 1.9 or later), capybara makes it easier to write integration tests. <ref>Using Capybara in Rails 3</ref> It is used on the top of an underlying web-based driver and offers a user-friendly DSL (Domain Specific Language) to describe actions executed by the underlying web driver. Such as rack::test, selenium-webdriver and capybara-webkit.<ref>The Basics of Capybara and Improving Your Tests</ref>

In this project, we use capybara with rspec by adding the following line:

 require 'capybara/rspec'

Then put capybara specs in spec/features.

Integration test

Testing

References

<references></references>