A development tool for creating and managing system tests in Ruby on Rails >= 5.1 applications
This gem is used only in development and is a mountable rails engine that creates JSON endpoints for a chrome extension.
Add this line to your application's Gemfile:
gem 'system_tester', group: :development
Add the system_tester db to
# you may want to consider a shared MySQL/Postgres database # if you have a team that needs shared access system_tester: <<: *default database: db/system_tester.sqlite3
And then install and run the migrations:
$ bundle install $ rails system_tester:migrate
Mount the engine in config/routes.rb:
Rails.application.routes.draw do # ... other routes # Mount in development environment only if Rails.env.development? mount SystemTester::Engine => "/system_tester" end end
Start your dev server and you are good to go.
The chrome extension provides a Devtools tab and acts as a client to this gem.
System Tester is designed to work with a chrome extension, but could potentially be used for other applications as well.
rails routes to see what endpoints are provided. The following design was set in place for the easy of reusing
- Features - the top level: one test script for a feature
- Scenarios - 1:M assocation from Feature to Scenario. A Scenario is one test method.
- Steps - Basically a line of code that can be an action or an assertion. STI is used to provide different step types.
- ScenarioSteps - M:M assocation for Steps and Scenarios which also as a position attribute to allow for reordering.
- Stairs - an ordered group of steps that can be reused.
- StairSteps - M:M association to support stairs, Stair inherits from Step so the fk points back to the same table.
The gem is available as open source under the terms of the MIT License.