Class: EasyqaApi::TestRunResult

Inherits:
Item
  • Object
show all
Defined in:
lib/easyqa_api/items/test_run_result.rb

Overview

Test run result representation from EasyQA website

Constant Summary

Constants inherited from Item

Item::CONNECTION

Constants included from ClassMethodsSettable

ClassMethodsSettable::METHODS

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Item

#initialize, #install_variables!, json_connection, multipart_connection, operation_status, send_request

Methods included from ClassMethodsSettable

#install_class_methods!

Constructor Details

This class inherits a constructor from EasyqaApi::Item

Instance Attribute Details

#attributesHash

Returns item attributes from response body in your requests.

Returns:

  • (Hash)

    item attributes from response body in your requests



11
# File 'lib/easyqa_api/items/test_run_result.rb', line 11

attr_accessor :id, :attributes, :project_token, :test_run_id

#idFixnum

Returns The uniq identeficator item on EasyQA website.

Returns:

  • (Fixnum)

    The uniq identeficator item on EasyQA website



11
12
13
# File 'lib/easyqa_api/items/test_run_result.rb', line 11

def id
  @id
end

#project_tokenString

Returns your project token.

Returns:

  • (String)

    your project token



11
# File 'lib/easyqa_api/items/test_run_result.rb', line 11

attr_accessor :id, :attributes, :project_token, :test_run_id

#test_run_idString

Returns Test run id on EasyQA.

Returns:

  • (String)

    Test run id on EasyQA



11
# File 'lib/easyqa_api/items/test_run_result.rb', line 11

attr_accessor :id, :attributes, :project_token, :test_run_id

Class Method Details

.all(project_token, test_run_id, user = @@default_user) ⇒ Array

List of all test run results in test run

Parameters:

  • user (Easyqapi::User) (defaults to: @@default_user)

    authenticated user in EasyQA

  • project_token (String)

    token of project

  • test_run_id (Fixnum)

    test run id on EasyQA website

Returns:

  • (Array)

    list of test run results

See Also:



21
22
23
24
25
26
27
28
# File 'lib/easyqa_api/items/test_run_result.rb', line 21

def self.all(project_token, test_run_id, user = @@default_user)
  send_request("test_runs/#{test_run_id}/test_run_results", :get) do |req|
    req.params = {
      auth_token: user.auth_token,
      token: project_token
    }
  end
end

Instance Method Details

#delete(project_token = @project_token, id = @id, user = @@default_user) ⇒ Hash

Delete test run result on EasyQA website Have a class method analog

Parameters:

  • user (Easyqapi::User) (defaults to: @@default_user)

    authenticated user in EasyQA

  • project_token (String) (defaults to: @project_token)

    token of project

  • id (String) (defaults to: @id)

    item id

Returns:

  • (Hash)

    item attribtues on EasyQA website

See Also:



58
59
60
61
62
63
64
65
# File 'lib/easyqa_api/items/test_run_result.rb', line 58

def delete(project_token = @project_token, id = @id, user = @@default_user)
  @attributes = send_request("test_run_results/#{id}", :delete) do |req|
    req.body = {
      token: project_token,
      auth_token: user.auth_token
    }
  end
end

#show(project_token = @project_token, id = @id, user = @@default_user) ⇒ Hash

Show test run result from EasyQA website Have a class method analog

Parameters:

  • user (Easyqapi::User) (defaults to: @@default_user)

    authenticated user in EasyQA

  • project_token (String) (defaults to: @project_token)

    token of project

  • id (String) (defaults to: @id)

    item id

Returns:

  • (Hash)

    item attribtues on EasyQA website

See Also:



32
33
34
35
36
37
38
39
# File 'lib/easyqa_api/items/test_run_result.rb', line 32

def show(project_token = @project_token, id = @id, user = @@default_user)
  @attributes = send_request("test_run_results/#{id}", :get) do |req|
    req.params = {
      token: project_token,
      auth_token: user.auth_token
    }
  end
end

#update(attrs, user = @@default_user) ⇒ Hash

Note:

test_run_result_status can be ‘pass’, ‘block’, ‘untested’ or ‘fail’

Have a class method analog

Parameters:

  • user (Easyqapi::User) (defaults to: @@default_user)

    authenticated user in EasyQA

  • attrs (Hash)

    attributes for action

Options Hash (attrs):

  • :project_token (String) — default: @project_token

    Project token on EasyQA

  • :id (Fixnum) — default: @id

    uniq item identeficator

  • :test_case_id (Fixnum)

    test case id on EasyQA website

  • :result_status (String)

    test run result status

Returns:

  • (Hash)

    item attribtues on EasyQA website

See Also:



45
46
47
48
49
50
51
52
53
54
# File 'lib/easyqa_api/items/test_run_result.rb', line 45

def update(attrs, user = @@default_user)
  attrs = { id: @id, project_token: @project_token }.merge(attrs)
  @attributes = send_request("test_run_results/#{attrs[:id]}", :put) do |req|
    req.body = {
      test_run_result: attrs.except(:project_token, :id),
      token: attrs[:project_token],
      auth_token: user.auth_token
    }
  end
end