class LegoTechSelenium::TestCase

Public Class Methods

new(name, driver) click to toggle source
# File lib/ui/test-cases/TestCase.rb, line 6
def initialize(name, driver)
  if name.nil? or name.empty?
    raise "All TestCasses must have a name associated to them"
  end

  if driver.nil?
    raise "The driver is nil in the TestCase"
  end
  @name = name
  @driver = driver

  @actions = []
end

Public Instance Methods

add_action(action) click to toggle source

Function used to add an action to the list of actions to later be invoked @param action [Action] an object that represents a list of events to invoke @return nil

# File lib/ui/test-cases/TestCase.rb, line 23
def add_action(action)
  if action.nil?
    raise "Cannot pass a nil action to TestCase"
  end

  unless action.class.superclass.name.eql? ("LegoTechSelenium::Action")
    raise "action is not an instance of LegoTechSelenium::Action within TestCase"
  end
  @actions.push(action)
  return nil
end
get_name() click to toggle source

Function used to get the name of the Test Case instance @return [String] Name of the Test Case Instance

# File lib/ui/test-cases/TestCase.rb, line 37
def get_name()
  @name
end
get_number_of_actions() click to toggle source

Function get the number of actions within the TestCase

Number

The number of actions within the TestCase

# File lib/ui/test-cases/TestCase.rb, line 43
def get_number_of_actions()
  @actions.size
end
run() click to toggle source

Function used to invoke all of the actions within the list

# File lib/ui/test-cases/TestCase.rb, line 48
def run()
  @actions.each do |action|
    action.test()
  end
end