Sha256: c62055fd85d1d9c5398bd7d74100af55889e208cda334894b5f9b7d1c148856d

Contents?: true

Size: 745 Bytes

Versions: 1

Compression:

Stored size: 745 Bytes

Contents

module PageObject
  module Platforms
    module WatirWebDriver

      def self.create_page_object(browser)
        return WatirWebDriver::PageObject.new(browser)
      end

      def self.is_for?(browser)
        require 'watir'
        browser.is_a?(::Watir::Browser) || browser.is_a?(::Watir::HTMLElement)
      end

      def self.browser_for root
        return root if root.is_a?(::Watir::Browser)
        root.browser
      end

      def self.root_element_for root
        Elements::Element.new root, :platform => :watir if root.is_a? ::Watir::HTMLElement
      end

      def self.browser_root_for browser
        browser.element
      end
    end
  end
end

PageObject::Platforms.register(:watir, PageObject::Platforms::WatirWebDriver)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
page-object-2.0.0 lib/page-object/platforms/watir.rb