class OnlyofficeTestrailWrapper::TestrailProject
@author Roman.Zagudaev Class for working with Test Projects
Attributes
@return [String] announcement string
@return [String] Date, when test completed
@return [Integer] Id of project
@return [true, false] is project completed
@return [Array<String>] name of milestones
@return [String] Name
of project
@return [Array<String>] name of planes
@return [Array<String>] name of runs
@return [true, false] is show announcement option enabled
@return [Array<String>] name of suites
@return [String] url to project
Public Class Methods
Default constructor @param id [id] id of project, default = nil @param name [String] name of project, default = nil @param announcement [String] announcement of project, default = nil @param is_completed
[true, false] is project completed, default = nil @return [TestRunTestRail] new Test run
# File lib/onlyoffice_testrail_wrapper/testrail_project.rb, line 51 def initialize(name = '', announcement = nil, show_announcement = true, is_completed = false, id = nil) @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
Public Instance Methods
# File lib/onlyoffice_testrail_wrapper/testrail_project.rb, line 72 def delete Testrail2.http_post "index.php?/api/v2/delete_project/#{@id}", {} OnlyofficeLoggerHelper.log "Deleted project: #{@name}" @testrail.projects_names.delete @name end
# File lib/onlyoffice_testrail_wrapper/testrail_project.rb, line 63 def update(is_completed = false, name = @name, announcement = @announcement, show_announcement = @show_announcement) @testrail.projects_names.delete[@name] @testrail.projects_names[StringHelper.warnstrip!(name.to_s)] = @id updated_project = HashHelper.parse_to_class_variable(Testrail2.http_post("index.php?/api/v2/update_project/#{@id}", name: name, announcement: announcement, show_announcement: show_announcement, is_completed: is_completed), TestrailProject) OnlyofficeLoggerHelper.log "Updated project: #{updated_project.name}" updated_project end