Skip to content

Latest commit

 

History

History
197 lines (146 loc) · 14.7 KB

ruby-test-automation.md

File metadata and controls

197 lines (146 loc) · 14.7 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 using 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

  • Rubocop - A Ruby static code analyzer, based on the community Ruby style guide.
  • Pronto - Quick automated code review of your changes.

Test data

  • Fabrication - A simple and powerful object generation library.
  • factory_bot - 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.
    • unobtainium - configuration driven wrapper for Selenium WebDriver and appium, with PhantomJS support.
    • Airborne - RSpec driven API testing framework.
  • 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'
    • Site Prism - A Page Object Model DSL for Capybara
  • extensions
    • Selenium-Grid-Extras - Simplify the management of the Selenium Grid Nodes and stabilize said nodes by cleaning up the test environment after the build has been completed
    • Mailosaur - Ruby client for email testing/automation via Mailosaur.

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.
  • Appium - Appium is an open source test automation framework for use with native, hybrid and mobile web apps. It drives iOS, Android, and Windows apps using the WebDriver protocol.

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.
  • rbenv - Use rbenv to pick a Ruby version for your application and guarantee that your development environment matches production.
  • asdf-vm - Manage multiple runtime versions with a single CLI tool, for Node.js, Ruby, Python, Elixir

Performance & stress & load

  • Yandex.Tank - Yandex.Tank is a tool for performing load testing and analyzing the performance of web services and applications

Security checking

  • Brakeman - Static analysis security scanner for Ruby on Rails.
  • bundle-audit - Patch-level verification for bundler. Checks for vulnerable gems.

Continuous Integration

  • Knapsack - Optimal test suite parallelisation across CI nodes for RSpec, Cucumber, Minitest, Spinach and Turnip.
  • Teamcity - Powerful Continuous Integration out of the box
  • Jenkins - The leading open source automation server, Jenkins provides hundreds of plugins to support building, deploying and automating any project. As an extensible automation server, Jenkins can be used as a simple CI server or turned into the continuous delivery hub for any project.

Reporting

  • ReportPortal.io - Ruby Cucumber + RSpec powerfull results management and analytics for test automation reports. Powered with Machine Learning. Real-time integration and reports, visualization of trends and statistics, custom dashboards and widgets, gives you real visibility into the state of test automation. Integral part of CI/CD with TA and Continuous Testing. Server-client application, can be used for any type of automated tests. Free and OpenSourced, GitHub link.

Documentation generation

Contribute to this section

Editors, IDE, consoles

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.
  • screen-recorder - Ruby gem to video record your computer screen - desktop or specific window. Works on Windows, Linux, and macOS.

Resources

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

Websites

Other Awesome Test Automation Lists

Also we are supporting and looking for contribution for project:

Your contributions are always welcome!