Class: OLE_QA::Framework::Common_Object

Inherits:
Object
  • Object
show all
Includes:
Helpers
Defined in:
lib/common/common_object.rb

Overview

Note:

The instance variable @browser can be used internally to refer to the browser and only the browser, whereas the instance method .browser, defined in Helpers#browser will refer either to the browser itself or to the browser within the context of the “iframeportlet” frame, if it is found to be present.

OLE object class to be inherited by both Page Object and Data Object classes.

(Grouping together common initialize settings for DRYness.)

Direct Known Subclasses

Data_Object, Page

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helpers

#browser, #load_yml, #set_element, #set_function

Constructor Details

#initialize(ole_session) ⇒ Common_Object

Returns a new instance of Common_Object.

Parameters:

  • ole_session (Object)

    The OLE_QA::Framework::Session instance with which the object should load.



34
35
36
37
38
39
40
41
# File 'lib/common/common_object.rb', line 34

def initialize(ole_session)
  @ole = ole_session
  @browser = ole_session.browser
  @elements = Array.new
  @functions = Array.new
  set_elements if defined?(self.set_elements)
  set_functions if defined?(self.set_functions)
end

Instance Attribute Details

#elementsObject (readonly)

Arrays containing the name (Symbol) of each element or function declared

on a data object.


31
32
33
# File 'lib/common/common_object.rb', line 31

def elements
  @elements
end

#functionsObject (readonly)

Arrays containing the name (Symbol) of each element or function declared

on a data object.


31
32
33
# File 'lib/common/common_object.rb', line 31

def functions
  @functions
end

#oleObject

The OLE_QA::Framework::Session instance passed to the Data Object.



27
28
29
# File 'lib/common/common_object.rb', line 27

def ole
  @ole
end

Instance Method Details

#set_elementsObject

Note:

This method is automatically called on any subclass if defined therein.

Fill this method with element definitions in a subclass.

  • Call super first in this method if the subclass overrides elements from the superclass.

  • Use with Helpers#set_element



47
48
# File 'lib/common/common_object.rb', line 47

def set_elements
end

#set_functionsObject

Note:

This method is automatically called on any subclass if defined therein.

Fill this method with function definitions in a subclass.

  • Call super first in this method if the subclass overrides functions from the superclass.

  • Use with Helpers#set_function



54
55
# File 'lib/common/common_object.rb', line 54

def set_functions
end