Skip to content

A ruby wrapper for parts of the HP ALM (QualityCenter) API.

License

Notifications You must be signed in to change notification settings

ejlevin1/quality-center

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

quality-center

Provides export-oriented access to HP Application Lifecycle Management (Quality Center). See the API docs.

Installation

Add this line to your application's Gemfile:

gem 'quality_center', :git => 'git://github.com/Pearson-AI/quality-center.git'

And then execute:

$ bundle

Basic usage

  • Create a Connection:

      require 'quality_center'
      include QualityCenter::RemoteInterface
      conn = Rest.new(user:'user', password:'secret')
    
  • Construct Queries:

      query = Query.new.filter(id:'<20',severity:'2*').
                        paginate(page_size:7).
                        order_by(:last_modified, direction: 'DESC')
    
  • Retrieve Defects:

      defect_collection = QualityCenter::Defect::Collection.new(connection: conn, 
                                                                query:      query)
      defect_collection.flatten!.first
      # => { "id"            => "4",
             "name"          => "Some Defect",
             "creation-time" => "2008-12-02",
             "last-modified" => "2011-05-03 15:53:26",
             "severity"      => "2 - Major Problem",
             "detected-by"   => "somebody" }
      defect_collection.size
      # => 5
    
  • Retrieve other entities (full list documented in quality_center/constants.rb)

      conn.tasks(query:query, nice_keys:true)
      # => {:count =>50,
            :query => #<Query:0x00000003ffbc68>
            :type  =>"task",
            :entities =>
             [{"end-time"      => "2012-01-23 10:10:01",
               "result"        => "..."
               "passed"        => "Y",
               "state"         => "5",
               "type"          => "StartBuildGraph",
               "vts"           => "2012-01-23 10:10:01",
               "id"            => "1001",
               "ver-stamp"     => "2",
               "owner"         => "someuser",
               "creation-time" => "2012-01-23 10:09:46"},
               {...},
               {...}
             ]
    
  • Display friendly field labels.

      conn.tasks(query:query, nice_keys:true)
      # => {:count => 50,
            :query => #<Query:0x00000003ffbc68>
            :type  => "task",
            :entities =>
             [{"End Time"=>"2012-01-23 10:10:01",
               "Result"        => "..."
               "Passed"        => "Y",
               "Task State"    => "5",
               "Type"i         => "StartBuildGraph",
               "Modified"      => "2012-01-23 10:10:01",
               "Task Id"       => "1001",
               "Version Stamp" => "2",
               "Created By"    => "someuser",
               "Start Time"    => "2012-01-23 10:09:46"},
               {...},
               {...}
             ]
    
  • Retrieve Users.

      conn.users["Users"]["User"]
      # => [{"email"    => "[email protected]",
             "phone"    => "+12345678901",
             "Name"     => "user1",
             "FullName" => "One, User"},
            {"email"    => [email protected],
             "phone"    => "+19876543210",
             "Name"     => "someone",
             "FullName" => "Somebody, Somebody"},
            {...},
            {...}
           ]
    

Testing

Just run rake test. HTTP requests are mocked with VCR, so you don't need a password or even a working QC instance to run existing tests (although you do to add new ones).

About

A ruby wrapper for parts of the HP ALM (QualityCenter) API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published