class TestRail::Suite

Public Instance Methods

add_section( args) click to toggle source

suite.add_section( :name => 'Section name )

# File lib/test_rail/suite.rb, line 26
def add_section( args)
  @api.add_section( :project_id => project_id, :suite_id => @id, :name =>  args[:name] )
end
find_or_create_section( args ) click to toggle source
# File lib/test_rail/suite.rb, line 35
def find_or_create_section( args )
  name = args[:name] or raise "Need to provide the section name"
  section = self.find_section( args )
  if section.nil?
    section = add_section( args )
  end
  section
end
find_section( args ) click to toggle source
# File lib/test_rail/suite.rb, line 30
def find_section( args )
  name = args[:name] or raise "Need to provide the section name"
  sections.select{ |s| s.name == name }.first
end
sections() click to toggle source

Get a list of sections for this suite

# File lib/test_rail/suite.rb, line 20
def sections
  sections = @api.get_sections( :project_id => @project_id, :suite_id => @id )
  sections.reject{ |s| s.parent_id != nil }
end
update() click to toggle source

Save changes made to this object back in testrail suite.description = “New description” suite.update

# File lib/test_rail/suite.rb, line 15
def update
  @api.update_suite( :id => @id, :name => @name, :description => @description)
end