Class: LegoTechSelenium::TestSuite
- Inherits:
-
Object
- Object
- LegoTechSelenium::TestSuite
- Defined in:
- lib/ui/test-suites/TestSuite.rb
Defined Under Namespace
Classes: Builder
Instance Method Summary collapse
-
#add_test_case(testCase) ⇒ Object
Function used to add a TestCase to thee TestSuite.
-
#get_name ⇒ String
Retrieve the name of the TestSuite.
-
#get_number_of_test_cases ⇒ Number
Retrieve the number of TestCases within the TestSuite.
-
#initialize(name, driver) ⇒ TestSuite
constructor
A new instance of TestSuite.
-
#run ⇒ Object
Function that will invoke all test cases.
Constructor Details
#initialize(name, driver) ⇒ TestSuite
Returns a new instance of TestSuite.
8 9 10 11 12 13 14 15 16 17 18 19 |
# 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 |
Instance Method Details
#add_test_case(testCase) ⇒ Object
Function used to add a TestCase to thee TestSuite
23 24 25 26 27 28 29 30 31 32 |
# 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 ⇒ String
Retrieve the name of the TestSuite
36 37 38 |
# File 'lib/ui/test-suites/TestSuite.rb', line 36 def get_name() return @name end |
#get_number_of_test_cases ⇒ Number
Retrieve the number of TestCases within the TestSuite
42 43 44 |
# File 'lib/ui/test-suites/TestSuite.rb', line 42 def get_number_of_test_cases return @testCases.size end |
#run ⇒ Object
Function that will invoke all test cases
47 48 49 50 51 |
# File 'lib/ui/test-suites/TestSuite.rb', line 47 def run() @testCases.each do |testCase| testCase.run() end end |