Skip to content

Create Update Test Formatter

Pavel Garchenko edited this page Oct 30, 2017 · 6 revisions

Intro

atm_create_test_formatter provides ability to post locally created specs to Test Management For JIRA.

Configuration

Setup Formatter

NOTE: Do not run with atm_result_formatter.

Add configuration block to spec_helper

ATMFormatter.configure do |c|
  c.base_url    = 'https://localhost'
  c.auth_type   = :basic
  c.project_id  = 'CC'
  c.test_run_id = 'CC-R180'
  c.environment = "".upcase
  c.username    = 'Test'
  c.password    = 'Test'
  c.create_test_formatter_options = { update_existing_tests: true, 
                                      test_owner: 'Test', 
                                      custom_labels: ['automated'] }
end

Options

By default all of the options are set to false/nil.

update_existing_tests: - will update update all existing tests when set to true.

test_owner: - sets owner for a test case. Test owner will be set to unassigned if the key not provided.

custom_labels: - provides ability to set custom label for a test case. Multiple labels can be specified(ex. custom_labels: ['automated','smoke']).

Setup Rake Task

Add this require to the Rakefile

require 'atm_formatter/tasks/test_manipulation_tasks'

Tasks

NOTE: The tasks will run with dry run.

bundle exec rake atm:create[path] - Create test cases

bundle exec rake atm:update[path] - Update test cases

Example Spec

require "spec_helper"

PRECONDITION = 'PROVIDE SOME DATA HERE' # Will set text in the precondition field
OBJECTIVE    = 'JUST A TEST' # Will set text in the objective field

describe 'Some Feature |', precondition: PRECONDITION, objective: OBJECTIVE, folder: '/Web', status: 'Approved' do
 it 'Test Example From Local', test_id: '' do
   # Some code
 end