class TestRail::Project
Public Instance Methods
find_or_create_plan( args )
click to toggle source
# File lib/test_rail/project.rb, line 61 def find_or_create_plan( args ) name =args[:name] or raise "Need to provide name of plan" plan = self.find_plan( args ) if plan.nil? plan = new_plan( args ) end plan end
find_or_create_suite( args )
click to toggle source
Find or create a suite in this project based on the suite name project.find_or_create_suite( :name => “My Suite” )
# File lib/test_rail/project.rb, line 52 def find_or_create_suite( args ) name = args[:name] or raise "Need to provide the name of a suite" suite = self.find_suite( args ) if suite.nil? suite = new_suite( args ) end suite end
find_plan( args )
click to toggle source
Find a plan in this project based on the plan name project.find_plan( :name => “My Plan” )
# File lib/test_rail/project.rb, line 44 def find_plan( args ) name = args[:name] or raise "Need to provide the name of plan" plans.select{ |s| s.name == name }.first end
find_suite( args )
click to toggle source
Find a suite in this project based on the suite name project.find_suite( :name => “My Suite” )
# File lib/test_rail/project.rb, line 32 def find_suite( args ) name = args[:name] or raise "Need to provide the name of a suite" suites.select{ |s| s.name == name }.first end
new_plan( args )
click to toggle source
Create a new plan for this project
# File lib/test_rail/project.rb, line 38 def new_plan( args ) @api.add_plan( args.merge({:project_id => id}) ) end
new_suite( args )
click to toggle source
Create a new suite for this project
# File lib/test_rail/project.rb, line 26 def new_suite( args ) @api.add_suite( args.merge({:project_id => id}) ) end
plans()
click to toggle source
Return a list of plans belonging to this project
# File lib/test_rail/project.rb, line 20 def plans @api.get_plans( :project_id => @id ) end
suites()
click to toggle source
Return a list of suites belonging to this project
# File lib/test_rail/project.rb, line 15 def suites @api.get_suites( :project_id => @id ) end