Module: PageObject::Platforms::Watir
- Defined in:
- lib/page-object/platforms/watir.rb,
lib/page-object/platforms/watir/page_object.rb
Defined Under Namespace
Classes: PageObject
Class Method Summary collapse
- .browser_for(root) ⇒ Object
- .browser_root_for(browser) ⇒ Object
- .create_page_object(browser) ⇒ Object
- .is_for?(browser) ⇒ Boolean
- .root_element_for(root) ⇒ Object
Class Method Details
.browser_for(root) ⇒ Object
15 16 17 18 19 |
# File 'lib/page-object/platforms/watir.rb', line 15 def self.browser_for root return watir_browser(root) if watir?(root) return selenium_browser(root) if selenium?(root) nil end |
.browser_root_for(browser) ⇒ Object
25 26 27 |
# File 'lib/page-object/platforms/watir.rb', line 25 def self.browser_root_for browser browser.element end |
.create_page_object(browser) ⇒ Object
5 6 7 8 |
# File 'lib/page-object/platforms/watir.rb', line 5 def self.create_page_object(browser) browser = selenium_browser(browser) unless watir?(browser) return Watir::PageObject.new(browser) end |
.is_for?(browser) ⇒ Boolean
10 11 12 13 |
# File 'lib/page-object/platforms/watir.rb', line 10 def self.is_for?(browser) require 'watir' watir?(browser) || selenium?(browser) end |