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.
-
.current_page=(page) ⇒ Object
Sets the currently active PageObject.
- .find_page(page_name) ⇒ Object
-
.loaded? ⇒ Boolean
Have all PageObjects been registered?.
- .register_page_objects(pages) ⇒ Object
Instance Attribute Details
#current_page ⇒ Object
Returns the value of attribute current_page.
40 41 42 |
# File 'lib/testcentricity_web.rb', line 40 def current_page @current_page end |
Class Method Details
.current_page ⇒ PageObject
Get the currently active PageObject
71 72 73 |
# File 'lib/testcentricity_web.rb', line 71 def self.current_page @current_page end |
.current_page=(page) ⇒ Object
Sets the currently active PageObject
81 82 83 |
# File 'lib/testcentricity_web.rb', line 81 def self.current_page=(page) @current_page = page end |
.find_page(page_name) ⇒ Object
58 59 60 61 62 63 |
# File 'lib/testcentricity_web.rb', line 58 def self.find_page(page_name) page_id = (page_name.is_a? String) ? page_name.gsub(/\s+/, '').downcase.to_sym : page_name page = @page_objects[page_id] raise "No page object defined for page named '#{page_name}'" unless page page end |
.loaded? ⇒ Boolean
Have all PageObjects been registered?
54 55 56 |
# File 'lib/testcentricity_web.rb', line 54 def self.loaded? !@page_objects.empty? end |
.register_page_objects(pages) ⇒ Object
44 45 46 |
# File 'lib/testcentricity_web.rb', line 44 def self.register_page_objects(pages) @page_objects = pages end |