Class: EasyqaApi::TestRun

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

Overview

Test Run 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

#attributesObject

Returns the value of attribute attributes.



24
25
26
# File 'lib/easyqa_api/items/test_run.rb', line 24

def attributes
  @attributes
end

#idObject

Returns the value of attribute id.



24
25
26
# File 'lib/easyqa_api/items/test_run.rb', line 24

def id
  @id
end

#project_tokenObject

Returns the value of attribute project_token.



24
25
26
# File 'lib/easyqa_api/items/test_run.rb', line 24

def project_token
  @project_token
end

#titleObject

Returns the value of attribute title.



24
25
26
# File 'lib/easyqa_api/items/test_run.rb', line 24

def title
  @title
end

Class Method Details

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

List of all test runs in project



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

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

Instance Method Details

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

Note:

If you add test plan id to tes_run_result_attributes all test cases from this test plan has been included to your test run

Create test run on EasyQA website. Have a class method analog



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

def create(attrs, user = @@default_user)
  attrs = { project_token: @project_token }.merge(attrs)
  @attributes = send_request('test_runs', :post) do |req|
    req.body = {
      test_run: attrs.except(:project_token),
      token: attrs[:project_token],
      auth_token: user.auth_token
    }
  end
end

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

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



82
83
84
85
86
87
88
89
# File 'lib/easyqa_api/items/test_run.rb', line 82

def delete(project_token = @project_token, id = @id, user = @@default_user)
  @attributes = send_request("test_runs/#{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 from EasyQA website. Have a class method analog



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

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

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

Note:

If you add test plan id to tes_run_result_attributes all test cases from this test plan has been included to your test run

Update test run on EasyQA website. Have a class method analog

Options Hash (attrs):

  • :id (Fixnum) — default: @id

    test run id

See Also:



69
70
71
72
73
74
75
76
77
78
# File 'lib/easyqa_api/items/test_run.rb', line 69

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