Class: EasyqaApi::TestModule
- Defined in:
- lib/easyqa_api/items/test_module.rb
Overview
Test module 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.
-
#project_token ⇒ String
Your project token.
-
#test_plan_id ⇒ String
Test plan id on EasyQA.
-
#title ⇒ String
Test module title on EasyQA.
Class Method Summary collapse
-
.all(project_token, test_plan_id, user = @@default_user) ⇒ Array
List of all test modules.
Instance Method Summary collapse
-
#create(attrs, user = @@default_user) ⇒ Hash
Create test module 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.
21 |
# File 'lib/easyqa_api/items/test_module.rb', line 21 attr_accessor :title, :id, :attributes, :project_token, :test_plan_id |
#id ⇒ Fixnum
Returns The uniq identeficator item on EasyQA website.
21 |
# File 'lib/easyqa_api/items/test_module.rb', line 21 attr_accessor :title, :id, :attributes, :project_token, :test_plan_id |
#project_token ⇒ String
Returns your project token.
21 |
# File 'lib/easyqa_api/items/test_module.rb', line 21 attr_accessor :title, :id, :attributes, :project_token, :test_plan_id |
#test_plan_id ⇒ String
Returns Test plan id on EasyQA.
21 |
# File 'lib/easyqa_api/items/test_module.rb', line 21 attr_accessor :title, :id, :attributes, :project_token, :test_plan_id |
#title ⇒ String
Returns Test module title on EasyQA.
21 22 23 |
# File 'lib/easyqa_api/items/test_module.rb', line 21 def title @title end |
Class Method Details
.all(project_token, test_plan_id, user = @@default_user) ⇒ Array
List of all test modules
31 32 33 34 35 36 37 38 |
# File 'lib/easyqa_api/items/test_module.rb', line 31 def self.all(project_token, test_plan_id, user = @@default_user) send_request("test_plans/#{test_plan_id}/test_modules", :get) do |req| req.params = { auth_token: user.auth_token, token: project_token } end end |
Instance Method Details
#create(attrs, user = @@default_user) ⇒ Hash
Create test module on EasyQA website. Have a class method analog
43 44 45 46 47 48 49 50 51 52 |
# File 'lib/easyqa_api/items/test_module.rb', line 43 def create(attrs, user = @@default_user) attrs = { project_token: @project_token, test_plan_id: @test_plan_id }.merge(attrs) @attributes = send_request("test_plans/#{attrs[:test_plan_id]}/test_modules", :post) do |req| req.body = { test_module: attrs.except(:project_token, :test_plan_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
81 82 83 84 85 86 87 88 |
# File 'lib/easyqa_api/items/test_module.rb', line 81 def delete(project_token = @project_token, id = @id, user = @@default_user) @attributes = send_request("test_modules/#{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
56 57 58 59 60 61 62 63 |
# File 'lib/easyqa_api/items/test_module.rb', line 56 def show(project_token = @project_token, id = @id, user = @@default_user) @attributes = send_request("test_modules/#{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
68 69 70 71 72 73 74 75 76 77 |
# File 'lib/easyqa_api/items/test_module.rb', line 68 def update(attrs, user = @@default_user) attrs = { id: @id, project_token: @project_token }.merge(attrs) @attributes = send_request("test_modules/#{attrs[:id]}", :put) do |req| req.body = { test_module: attrs.except(:project_token), token: attrs[:project_token], auth_token: user.auth_token } end end |