Class: TestSuite

Inherits:
Object
  • Object
show all
Defined in:
lib/ui/test-suites/TestSuite.rb

Defined Under Namespace

Classes: Builder

Instance Method Summary collapse

Constructor Details

#initialize(name, driver) ⇒ TestSuite

Returns a new instance of TestSuite.

Parameters:

  • name (String)

    is the name of the TestSuite

  • driver (Driver)

    is the driver variable



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/ui/test-suites/TestSuite.rb', line 4

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
  @entries = []
end

Instance Method Details

#addTestCase(testCase) ⇒ Object

Function used to add a TestCase to thee TestSuite

Parameters:

  • testCase (TestCase)

    A test case to be executed



19
20
21
# File 'lib/ui/test-suites/TestSuite.rb', line 19

def addTestCase(testCase)
  @entries.push(testCase)
end

#getNameString

Retrieve the name of the TestSuite

Returns:

  • (String)

    The name of the TestSuite



25
26
27
# File 'lib/ui/test-suites/TestSuite.rb', line 25

def getName()
  return @name
end

#getNumberOfTestCasesNumber

Retrieve the number of TestCases within the TestSuite

Returns:

  • (Number)

    Number of TestCases



31
32
33
# File 'lib/ui/test-suites/TestSuite.rb', line 31

def getNumberOfTestCases
  return @entries.size
end

#runObject

Function that will invoke all test cases



36
37
38
# File 'lib/ui/test-suites/TestSuite.rb', line 36

def run()
  raise "Not yet built"
end