Class: EasyqaApi::TestCase
- Defined in:
- lib/easyqa_api/items/test_case.rb
Overview
Test case representation from EasyQA website
Constant Summary
Constants inherited from Item
Constants included from ClassMethodsSettable
Instance Attribute Summary collapse
-
#attributes ⇒ Hash
Item attributes from response body in your requests.
-
#id ⇒ Fixnum
The uniq identeficator item on EasyQA website.
-
#module_id ⇒ String
Test module id on EasyQA.
-
#project_token ⇒ String
Your project token.
-
#title ⇒ String
Test case title on EasyQA.
Class Method Summary collapse
-
.all(attrs, user = @@default_user) ⇒ Array
List of all test cases.
Instance Method Summary collapse
-
#create(attrs, user = @@default_user) ⇒ Hash
Create test case on EasyQA website.
-
#delete(project_token = @project_token, id = @id, user = @@default_user) ⇒ Hash
Delete Test Case on EasyQA website.
-
#show(project_token = @project_token, id = @id, user = @@default_user) ⇒ Hash
Show Test Case from EasyQA website.
-
#update(attrs, user = @@default_user) ⇒ Hash
Update Test Case on EasyQA website.
Methods inherited from Item
#initialize, #install_variables!, json_connection, multipart_connection, operation_status, send_request
Methods included from ClassMethodsSettable
Constructor Details
This class inherits a constructor from EasyqaApi::Item
Instance Attribute Details
#attributes ⇒ Hash
Returns item attributes from response body in your requests.
23 |
# File 'lib/easyqa_api/items/test_case.rb', line 23 attr_accessor :title, :id, :attributes, :project_token, :module_id |
#id ⇒ Fixnum
Returns The uniq identeficator item on EasyQA website.
23 |
# File 'lib/easyqa_api/items/test_case.rb', line 23 attr_accessor :title, :id, :attributes, :project_token, :module_id |
#module_id ⇒ String
Returns Test module id on EasyQA.
23 |
# File 'lib/easyqa_api/items/test_case.rb', line 23 attr_accessor :title, :id, :attributes, :project_token, :module_id |
#project_token ⇒ String
Returns your project token.
23 |
# File 'lib/easyqa_api/items/test_case.rb', line 23 attr_accessor :title, :id, :attributes, :project_token, :module_id |
#title ⇒ String
Returns Test case title on EasyQA.
23 24 25 |
# File 'lib/easyqa_api/items/test_case.rb', line 23 def title @title end |
Class Method Details
.all(attrs, user = @@default_user) ⇒ Array
List of all test cases
35 36 37 38 39 40 41 42 |
# File 'lib/easyqa_api/items/test_case.rb', line 35 def self.all(attrs, user = @@default_user) send_request("#{attrs[:parent_name]}/#{attrs[:parent_id]}/test_cases", :get) do |req| req.params = { auth_token: user.auth_token, token: attrs[:project_token] } end end |
Instance Method Details
#create(attrs, user = @@default_user) ⇒ Hash
Create test case on EasyQA website. Have a class method analog
47 48 49 50 51 52 53 54 55 56 |
# File 'lib/easyqa_api/items/test_case.rb', line 47 def create(attrs, user = @@default_user) attrs = { project_token: @project_token, module_id: @module_id }.merge(attrs) @attributes = send_request("test_modules/#{attrs[:module_id]}/test_cases", :post) do |req| req.body = { test_case: attrs.except(:project_token, :module_id), token: attrs[:project_token], auth_token: user.auth_token } end end |
#delete(project_token = @project_token, id = @id, user = @@default_user) ⇒ Hash
Delete Test Case on EasyQA website. Have a class method analog
85 86 87 88 89 90 91 92 |
# File 'lib/easyqa_api/items/test_case.rb', line 85 def delete(project_token = @project_token, id = @id, user = @@default_user) @attributes = send_request("test_cases/#{id}", :delete) do |req| req.params = { token: project_token, auth_token: user.auth_token } end end |
#show(project_token = @project_token, id = @id, user = @@default_user) ⇒ Hash
Show Test Case from EasyQA website. Have a class method analog
60 61 62 63 64 65 66 67 |
# File 'lib/easyqa_api/items/test_case.rb', line 60 def show(project_token = @project_token, id = @id, user = @@default_user) @attributes = send_request("test_cases/#{id}", :get) do |req| req.params = { token: project_token, auth_token: user.auth_token } end end |
#update(attrs, user = @@default_user) ⇒ Hash
Update Test Case on EasyQA website. Have a class method analog
72 73 74 75 76 77 78 79 80 81 |
# File 'lib/easyqa_api/items/test_case.rb', line 72 def update(attrs, user = @@default_user) attrs = { id: @id, project_token: @project_token }.merge(attrs) @attributes = send_request("test_cases/#{attrs[:id]}", :put) do |req| req.body = { test_case: attrs.except(:project_token, :id), token: attrs[:project_token], auth_token: user.auth_token } end end |