Class: OnlyofficeTestrailWrapper::TestrailProject
- Inherits:
-
TestrailApiObject
- Object
- TestrailApiObject
- OnlyofficeTestrailWrapper::TestrailProject
- Includes:
- ProjectCleanup, TestrailProjectMilestoneMethods, TestrailProjectPlanHelper, TestrailProjectRunMethods, TestrailProjectSuiteMethods
- Defined in:
- lib/onlyoffice_testrail_wrapper/testrail_project.rb
Overview
Class for working with Test Projects
Instance Attribute Summary collapse
-
#announcement ⇒ String
Announcement string.
-
#completed_on ⇒ String
Date, when test completed.
-
#id ⇒ Integer
Id of project.
-
#is_completed ⇒ true, false
Is project completed.
-
#milestones_names ⇒ Array<String>
Name of milestones.
-
#name ⇒ String
Name of project.
-
#plans_names ⇒ Array<String>
Name of planes.
-
#runs_names ⇒ Array<String>
Name of runs.
-
#show_announcement ⇒ true, false
Is show announcement option enabled.
-
#suites_names ⇒ Array<String>
Name of suites.
-
#url ⇒ String
Url to project.
Instance Method Summary collapse
- #delete ⇒ Object
-
#initialize(name = '', announcement = nil, show_announcement = true, is_completed = false, id = nil) ⇒ TestRunTestRail
constructor
Default constructor.
- #update(is_completed = false, name = @name, announcement = @announcement, show_announcement = @show_announcement) ⇒ Object
Methods included from TestrailProjectSuiteMethods
#create_new_suite, #get_suite_by_id, #get_suite_by_name, #get_suites, #init_suite_by_name, #suite, #suites
Methods included from TestrailProjectRunMethods
#create_new_run, #get_run_by_id, #get_run_by_name, #get_runs, #init_run_by_name, #runs, #runs_older_than_days, #test_run
Methods included from TestrailProjectPlanHelper
#create_new_plan, #get_plan_by_id, #get_plan_by_name, #get_plans, #init_plan_by_name, #plan, #plan_by_name, #plans
Methods included from TestrailProjectMilestoneMethods
#create_new_milestone, #get_milestone_by_id, #get_milestone_by_name, #get_milestones, #init_milestone_by_name, #milestone
Methods included from ProjectCleanup
Methods inherited from TestrailApiObject
#init_from_hash, #name_id_pairs
Constructor Details
#initialize(name = '', announcement = nil, show_announcement = true, is_completed = false, id = nil) ⇒ TestRunTestRail
Default constructor
51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/onlyoffice_testrail_wrapper/testrail_project.rb', line 51 def initialize(name = '', announcement = nil, show_announcement = true, is_completed = false, id = nil) super() @id = id.to_i @name = name @announcement = announcement @show_announcement = show_announcement @is_completed = is_completed @suites_names = {} @runs_names = {} @plans_names = {} @milestones_names = {} end |
Instance Attribute Details
#announcement ⇒ String
Returns announcement string.
27 28 29 |
# File 'lib/onlyoffice_testrail_wrapper/testrail_project.rb', line 27 def announcement @announcement end |
#completed_on ⇒ String
Returns Date, when test completed.
33 34 35 |
# File 'lib/onlyoffice_testrail_wrapper/testrail_project.rb', line 33 def completed_on @completed_on end |
#id ⇒ Integer
Returns Id of project.
23 24 25 |
# File 'lib/onlyoffice_testrail_wrapper/testrail_project.rb', line 23 def id @id end |
#is_completed ⇒ true, false
Returns is project completed.
31 32 33 |
# File 'lib/onlyoffice_testrail_wrapper/testrail_project.rb', line 31 def is_completed @is_completed end |
#milestones_names ⇒ Array<String>
Returns name of milestones.
43 44 45 |
# File 'lib/onlyoffice_testrail_wrapper/testrail_project.rb', line 43 def milestones_names @milestones_names end |
#name ⇒ String
Returns Name of project.
25 26 27 |
# File 'lib/onlyoffice_testrail_wrapper/testrail_project.rb', line 25 def name @name end |
#plans_names ⇒ Array<String>
Returns name of planes.
41 42 43 |
# File 'lib/onlyoffice_testrail_wrapper/testrail_project.rb', line 41 def plans_names @plans_names end |
#runs_names ⇒ Array<String>
Returns name of runs.
39 40 41 |
# File 'lib/onlyoffice_testrail_wrapper/testrail_project.rb', line 39 def runs_names @runs_names end |
#show_announcement ⇒ true, false
Returns is show announcement option enabled.
29 30 31 |
# File 'lib/onlyoffice_testrail_wrapper/testrail_project.rb', line 29 def show_announcement @show_announcement end |
#suites_names ⇒ Array<String>
Returns name of suites.
37 38 39 |
# File 'lib/onlyoffice_testrail_wrapper/testrail_project.rb', line 37 def suites_names @suites_names end |
#url ⇒ String
Returns url to project.
35 36 37 |
# File 'lib/onlyoffice_testrail_wrapper/testrail_project.rb', line 35 def url @url end |
Instance Method Details
#delete ⇒ Object
74 75 76 77 |
# File 'lib/onlyoffice_testrail_wrapper/testrail_project.rb', line 74 def delete Testrail2.http_post "index.php?/api/v2/delete_project/#{@id}", {} OnlyofficeLoggerHelper.log "Deleted project: #{@name}" end |
#update(is_completed = false, name = @name, announcement = @announcement, show_announcement = @show_announcement) ⇒ Object
64 65 66 67 68 69 70 71 72 |
# File 'lib/onlyoffice_testrail_wrapper/testrail_project.rb', line 64 def update(is_completed = false, name = @name, announcement = @announcement, show_announcement = @show_announcement) updated_project = TestrailProject.new.init_from_hash(Testrail2.http_post("index.php?/api/v2/update_project/#{@id}", name: name, announcement: announcement, show_announcement: show_announcement, is_completed: is_completed)) OnlyofficeLoggerHelper.log "Updated project: #{updated_project.name}" updated_project end |