Class: TestCentricity::PageManager
Instance Attribute Summary collapse
-
#current_page ⇒ Object
Returns the value of attribute current_page.
Class Method Summary collapse
-
.current_page ⇒ PageObject
Get the currently active PageObject.
- .find_page(page_name) ⇒ Object
-
.loaded? ⇒ Boolean
Have all PageObjects been registered?.
- .register_page_object(page_ref, page_object) ⇒ Object
-
.set_current_page(page) ⇒ Object
Sets the currently active PageObject.
Instance Attribute Details
#current_page ⇒ Object
Returns the value of attribute current_page.
22 23 24 |
# File 'lib/testcentricity_web.rb', line 22 def current_page @current_page end |
Class Method Details
.current_page ⇒ PageObject
Get the currently active PageObject
55 56 57 |
# File 'lib/testcentricity_web.rb', line 55 def self.current_page @current_page end |
.find_page(page_name) ⇒ Object
44 45 46 47 |
# File 'lib/testcentricity_web.rb', line 44 def self.find_page(page_name) (page_name.is_a? String) ? page_id = page_name.gsub(/\s+/, "").downcase.to_sym : page_id = page_name @page_objects[page_id] end |
.loaded? ⇒ Boolean
Have all PageObjects been registered?
40 41 42 |
# File 'lib/testcentricity_web.rb', line 40 def self.loaded? not @page_objects.empty? end |
.register_page_object(page_ref, page_object) ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/testcentricity_web.rb', line 26 def self.register_page_object(page_ref, page_object) @page_objects[page_ref] = page_object unless @page_objects.has_key?(page_ref) page_key = page_object.page_name.gsub(/\s+/, "").downcase.to_sym if page_key != page_ref @page_objects[page_key] = page_object unless @page_objects.has_key?(page_key) end end |
.set_current_page(page) ⇒ Object
Sets the currently active PageObject
65 66 67 |
# File 'lib/testcentricity_web.rb', line 65 def self.set_current_page(page) @current_page = page end |