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.
41 42 43 |
# File 'lib/testcentricity_web.rb', line 41 def current_page @current_page end |
Class Method Details
.current_page ⇒ PageObject
Get the currently active PageObject
72 73 74 |
# File 'lib/testcentricity_web.rb', line 72 def self.current_page @current_page end |
.current_page=(page) ⇒ Object
Sets the currently active PageObject
82 83 84 |
# File 'lib/testcentricity_web.rb', line 82 def self.current_page=(page) @current_page = page end |
.find_page(page_name) ⇒ Object
59 60 61 62 63 64 |
# File 'lib/testcentricity_web.rb', line 59 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?
55 56 57 |
# File 'lib/testcentricity_web.rb', line 55 def self.loaded? !@page_objects.empty? end |
.register_page_objects(pages) ⇒ Object
45 46 47 |
# File 'lib/testcentricity_web.rb', line 45 def self.register_page_objects(pages) @page_objects = pages end |