Class: OLE_QA::Framework::Common_Object
- Inherits:
-
Object
- Object
- OLE_QA::Framework::Common_Object
- Includes:
- Helpers
- Defined in:
- lib/common/common_object.rb
Overview
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
Instance Attribute Summary collapse
-
#elements ⇒ Object
readonly
Arrays containing the name (Symbol) of each element or function declared on a data object.
-
#functions ⇒ Object
readonly
Arrays containing the name (Symbol) of each element or function declared on a data object.
-
#ole ⇒ Object
The OLE_QA::Framework::Session instance passed to the Data Object.
Instance Method Summary collapse
-
#initialize(ole_session) ⇒ Common_Object
constructor
A new instance of Common_Object.
-
#set_elements ⇒ Object
Fill this method with element definitions in a subclass.
-
#set_functions ⇒ Object
Fill this method with function definitions in a subclass.
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.
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
#elements ⇒ Object (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 |
#functions ⇒ Object (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 |
#ole ⇒ Object
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_elements ⇒ Object
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_functions ⇒ Object
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 |