Project

rtrail

0.0
No commit activity in last 3 years
No release in over 3 years
RTrail wraps the TestRail API v2.0 in Ruby objects
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.7
~> 0.10
~> 10.3
~> 2.1
~> 3.0
~> 0.9
~> 1.4
~> 1.6
~> 1.2
~> 0.8
~> 4.10

Runtime

~> 3.3
 Project Readme

RTrail

Build Status Coverage Status

Ruby object wrapper for the TestRail API v2

Please use the issue tracker to report bugs or request improvements, and fork this repository if you'd like to hack on it.

Installation

Run from a console:

$ gem install rtrail

Or add to your Gemfile before a bundle install:

gem 'rtrail'

Overview

RTrail provides a hierarchy of Ruby objects, mirroring the data structure within TestRail. Here's a rough look:

  • Project(s)
    • Plan(s)
    • Suite(s)
      • Case(s)
      • Section(s)
    • Run(s)
      • Test(s)
        • Result(s)

Within RTrail, each of these things are modeled by a class, with a common base class known as Entity.

Usage

The top-level interface is through RTrail::API; simply provide your TestRail server's hostname, username and password:

> api = RTrail::API.new("http://example.com/", "epierce", "myPa$$w0rd")

Some convenience methods are provided; for example:

# Get a list of all Projects
> api.projects
=> [#<RTrail::Project ...>, ..., #<RTrail::Project ...>]

# Get a single Project by name
> api.project("Web Applications")
=> #<RTrail::Project ...>

# Get a Suite within a Project
> api.suite("Web Applications", "Storefront")
=> #<RTrail::Suite ...>

Each Entity type provides wrappers for some of the API methods you're likely to use; for instance:

> project = api.project("Web Applications")
> project.suites        # GET /get_suites/<project_id>
> project.plans         # GET /get_plans/<project_id>
> project.runs          # GET /get_runs/<project_id>

> project.runs.count
=> 4

> project.runs.each { |run| run.id }
=> [103, 104, 119, 127]

> run = project.runs.first

> run.completed?
=> true
> run.summary
=> "103: Website Login [completed 2014-07-16 21:45:08 UTC]

Development

To contribute, please fork this repository, develop your code and write spec tests that cover it, commit to your fork and submit a pull request with your changes.

References

License

MIT License.