class LegoTechSelenium::TestSuite

Public Class Methods

new(name, driver) click to toggle source

@param name [String] is the name of the TestSuite @param driver [Driver] is the driver variable

# File lib/ui/test-suites/TestSuite.rb, line 8
def initialize(name, driver)
  if name.nil? or name.empty?
    raise "All TestSuites must have a name associated to them"
  end

  if driver.nil?
    raise "Driver must be non nil"
  end
  @name = name
  @driver = driver
  @testCases = []
end

Public Instance Methods

add_test_case(testCase) click to toggle source

Function used to add a TestCase to thee TestSuite @param testCase [TestCase] A test case to be executed

# File lib/ui/test-suites/TestSuite.rb, line 23
def add_test_case(testCase)
  if testCase.nil?
    raise "Cannot have nil testCase within TestSuite"
  end

  unless testCase.instance_of? LegoTechSelenium::TestCase
    raise "testCase is not an instance of TestCase within the TestSuite"
  end
  @testCases.push(testCase)
end
get_name() click to toggle source

Retrieve the name of the TestSuite @return [String] The name of the TestSuite

# File lib/ui/test-suites/TestSuite.rb, line 36
def get_name()
  return @name
end
get_number_of_test_cases() click to toggle source

Retrieve the number of TestCases within the TestSuite @return [Number] Number of TestCases

# File lib/ui/test-suites/TestSuite.rb, line 42
def get_number_of_test_cases
  return @testCases.size
end
run() click to toggle source

Function that will invoke all test cases

# File lib/ui/test-suites/TestSuite.rb, line 47
def run()
  @testCases.each do |testCase|
    testCase.run()
  end
end