Class: OnlyofficeTestrailWrapper::TestrailResult

Inherits:
TestrailApiObject show all
Defined in:
lib/onlyoffice_testrail_wrapper/testrail_result.rb

Overview

Class for working with Test results

Author:

  • Roman.Zagudaev

Constant Summary collapse

RESULT_STATUSES =
{ passed: 1, blocked: 2, untested: 3, retest: 4, failed: 5, passed_2: 6, work_for_me: 7,
pending: 8, aborted: 9, js_error: 10, lpv: 11, service_unavailable: 12 }.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from TestrailApiObject

#init_from_hash, #name_id_pairs

Constructor Details

#initialize(status = nil, comment = nil, version = nil) ⇒ TestResultTestRail

Default constructor

Parameters:

  • status (Symbol) (defaults to: nil)

    status to set. Could be :passed, blocked, retest or :failed

  • comment (String) (defaults to: nil)

    Comment of result

  • version (String) (defaults to: nil)

    Version



30
31
32
33
34
35
36
37
# File 'lib/onlyoffice_testrail_wrapper/testrail_result.rb', line 30

def initialize(status = nil, comment = nil, version = nil)
  super()
  @title = status.to_s
  @status_id = RESULT_STATUSES[status]
  @comment = comment
  @version = version
  @error = nil
end

Instance Attribute Details

#commentString

Returns Comment of result.

Returns:

  • (String)

    Comment of result



16
17
18
# File 'lib/onlyoffice_testrail_wrapper/testrail_result.rb', line 16

def comment
  @comment
end

#created_onInteger

Returns date of creation of result from begging of era.

Returns:

  • (Integer)

    date of creation of result from begging of era



20
21
22
# File 'lib/onlyoffice_testrail_wrapper/testrail_result.rb', line 20

def created_on
  @created_on
end

#errorString

Returns error if any happened.

Returns:

  • (String)

    error if any happened



23
24
25
# File 'lib/onlyoffice_testrail_wrapper/testrail_result.rb', line 23

def error
  @error
end

#idInteger

Returns Id of test result.

Returns:

  • (Integer)

    Id of test result



10
11
12
# File 'lib/onlyoffice_testrail_wrapper/testrail_result.rb', line 10

def id
  @id
end

#status_idInteger

Returns Status id of result.

Returns:

  • (Integer)

    Status id of result



14
15
16
# File 'lib/onlyoffice_testrail_wrapper/testrail_result.rb', line 14

def status_id
  @status_id
end

#test_idObject (readonly)

Returns the value of attribute test_id.



21
22
23
# File 'lib/onlyoffice_testrail_wrapper/testrail_result.rb', line 21

def test_id
  @test_id
end

#titleString

Returns Title of test result.

Returns:

  • (String)

    Title of test result



12
13
14
# File 'lib/onlyoffice_testrail_wrapper/testrail_result.rb', line 12

def title
  @title
end

#versionString

Returns Version.

Returns:

  • (String)

    Version



18
19
20
# File 'lib/onlyoffice_testrail_wrapper/testrail_result.rb', line 18

def version
  @version
end