class OnlyofficeTestrailWrapper::TestrailProject

@author Roman.Zagudaev Class for working with Test Projects

Attributes

announcement[RW]

@return [String] announcement string

completed_on[RW]

@return [String] Date, when test completed

id[RW]

@return [Integer] Id of project

is_completed[RW]

@return [true, false] is project completed

milestones_names[RW]

@return [Array<String>] name of milestones

name[RW]

@return [String] Name of project

plans_names[RW]

@return [Array<String>] name of planes

runs_names[RW]

@return [Array<String>] name of runs

show_announcement[RW]

@return [true, false] is show announcement option enabled

suites_names[RW]

@return [Array<String>] name of suites

url[RW]

@return [String] url to project

Public Class Methods

new(name = '', announcement = nil, show_announcement = true, is_completed = false, id = nil) click to toggle source

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

delete() click to toggle source
# 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
update(is_completed = false, name = @name, announcement = @announcement, show_announcement = @show_announcement) click to toggle source
# 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