Sha256: 63242485ab60fc735525a9ce21f4b4b20272b9cc811b9104549521f8cef0cc4f

Contents?: true

Size: 964 Bytes

Versions: 1

Compression:

Stored size: 964 Bytes

Contents

require "rubygems"
require "watir"

module Cello
  module PageObjects
    class Hub
      attr_accessor :context
      attr_reader :browser

      def initialize hub_url, caps
        @browser = 
          Watir::Browser.new(  
                             :remote,  
                             :url => hub_url,  
                             :desired_capabilities => caps
          )
      end
      
      def visit
        @context.visit
      end

      def context page
        @context = page.new @browser 
      end

      def search text 
       @browser.text.include? text 
      end

      def close
        @browser.close
      end

      def get_screenshot
        @browser.driver.save_screenshot 'screenshot.png'
      end

      def title
        @browser.title
      end

      def response_time
        #pending
      end

      def method_missing method_name, *arguments
        @context.send method_name, *arguments
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cello-0.0.35 lib/cello/pageobjects/hub.rb