Skip to content

Latest commit

 

History

History
171 lines (123 loc) · 11.6 KB

ruby-test-automation.md

File metadata and controls

171 lines (123 loc) · 11.6 KB

Ruby test automation

A comprehensive curated list of Ruby test automation frameworks, tools, libraries and software to help software engineers easily bootstrap test automation on Ruby. Sponsored by http://sdclabs.com

Have questions\issues\problems, join the chat at https://gitter.im/atinfo/awesome-test-automation

Table of content:

Also:


xUnit frameworks

  • Test::Unit - is intended for unit testing and comes bundled with Ruby.
  • MiniTest - becomes available on attaching the minitest-reporters gem. The minitests are added to the Test::Unit framework.
  • yard-doctest - allows to use YARD examples as tests

TDD \ ATDD \ BDD

  • TDD
    • RR - A test double framework that features a rich selection of double techniques and a terse syntax.
  • BDD
    • RSpec - Behaviour Driven Development for Ruby. RSpec becomes available in Ruby projects on attaching the rspec gem. For the Rails applications, rspec-rails gem is also required.
    • Cucumber - This testing tool supports BDD, and enables using features and scenarios written in a human-readable language, either English or any other language specified in the # language: comment. Cucumber becomes available in project upon installing and activating the cucumber gem.
    • Bacon - A small RSpec clone.
    • minitest - minitest provides a complete suite of testing facilities supporting TDD, BDD, mocking, and benchmarking.
    • Spinach - Spinach is a high-level BDD framework that leverages the expressive Gherkin language (used by Cucumber) to help you define executable specifications of your application or library's acceptance criteria.
  • Assertions
    • Shoulda - is intended for unit testing, and becomes available in Ruby projects on attaching the shoulda gem. So doing, the Shoulda tests are added on to the Test::Unit framework.
    • shoulda-matchers - Provides Test::Unit- and RSpec-compatible one-liners that test common Rails functionality. These tests would otherwise be much longer, more complex, and error-prone.
  • Mocking
    • ActiveMocker - Generate mocks from ActiveRecord models for unit tests that run fast because they don’t need to load Rails or a database.
    • TestXml - TestXml is a small extension for testing XML/HTML.
    • WebMock - Library for stubbing and setting expectations on HTTP requests.
    • vcr - Record your test suite's HTTP interactions and replay them during future test runs for fast, deterministic, accurate tests.
  • Extensions
    • Cutest - Isolated tests in Ruby. Each test file is run in a forked process to avoid shared state. Once a failure is found, you get a report detailing what failed and how to locate the error and the rest of the file is skipped.
    • Spork - A DRb server for testing frameworks (RSpec / Cucumber currently).

Code analysis

Contribute to this section

Test data

  • Fabrication - A simple and powerful object generation library.
  • factory_girl - A library for setting up Ruby objects as test data.
  • Fake Person - Uses some of the most popular given & surnames in the US & UK.
  • faker - A library for generating fake data such as names, addresses, and phone numbers.
  • ffaker - A faster Faker, generates dummy data, rewrite of faker.
  • Forgery - Easy and customizable generation of forged data.
  • Machinist - Fixtures aren't fun. Machinist is.

Web UI test automation

  • libraries
    • Selenium WebDriver - This gem provides Ruby bindings for WebDriver.
    • API Taster - A quick and easy way to visually test your Rails application's API.
    • Watir - Web application testing in Ruby.
    • Watir-webdriver - The most elegant way to use WebDriver with ruby.
    • Poltergeist - Poltergeist is a driver for Capybara. It allows you to run your Capybara tests on a headless WebKit browser, provided by PhantomJS.
    • PhantomJS - is a headless WebKit scriptable with a JavaScript API. It has fast and native support for various web standards: DOM handling, CSS selector, JSON, Canvas, and SVG.
  • frameworks
    • Capybara - Acceptance test framework for web applications.
    • Konacha - Test your Rails application's JavaScript with the mocha test framework and chai assertion library.
    • chemistrykit - Simple and opinionated web testing framework for Selenium WebDriver that follows convention over configuration and integrates with SauceLabs for cross-browser execution in the cloud.
    • howitzer - is a Ruby-based framework for acceptance testing. It was originally developed for testing web applications, but you can also use it for API testing and web service testing.The framework was built with modern patterns, techniques, and tools in automated testing.
  • page objects
    • page-object - Gem to implement PageObject pattern in watir-webdriver and selenium-webdriver.
    • watirsome - Awesome page objects with Watir.
    • widgeon - Yet another 'page objects for Capybara' gem with ability to create custom loadable elements akka 'widgets'
  • extensions
    • Selenium-Grid-Extras - Simplify the managment of the Selenium Grid Nodes and stabilize said nodes by cleaning up the test environment after the build has been completed

Mobile test automation

  • Calabash - Calabash enables you to write and execute automated acceptance tests on mobile apps. It's cross-platform, supporting Android and iOS native apps.

Windows UI test automation

Contribute to this section

Unix \ Linux UI test automation

Contribute to this section

MacOS UI test automation

Contribute to this section

Virtual environments

  • RVM - Ruby Version Manager (RVM) is a unix command-line tool which allows you to easily install, manage, and work with multiple ruby environments from interpreters to sets of gems.
  • Pik - Multi-Ruby Manager for Windows

Performance & stress & load

Contribute to this section

Security checking

Contribute to this section

Continuous Integration

Contribute to this section

Reporting

Contribute to this section

Documentation generation

Contribute to this section

Editors, IDE, consoles

Contribute to this section

Useful libs

  • parallel_tests - Speedup Test::Unit + RSpec + Cucumber by running parallel on multiple CPUs (or cores). ParallelTests splits tests into even groups(by number of tests or runtime) and runs each group in a single process with its own database.
  • headless - Is the Ruby interface for Xvfb. It allows you to create a headless display straight from Ruby code, hiding some low-level action. It can also capture images and video from the virtual framebuffer.
  • watir-jquery - Watir-jquery gem allows you to use the jQuery syntax to find page elements and returns Watir-object type (e.x. "#<Watir::Div:0x..").

Resources

Where to discover new libraries, information, tools, etc.

Websites

Other Awesome Test Automation Lists

Your contributions are always welcome!