Sha256: f4978927037513d1ce222dd92c1c119205aebabbb1115872377910876d463a2c

Contents?: true

Size: 808 Bytes

Versions: 10

Compression:

Stored size: 808 Bytes

Contents

require "rubygems"
require "watir-webdriver"

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

      def initialize browser
        @browser = Watir::Browser.new browser
      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

10 entries across 10 versions & 1 rubygems

Version Path
cello-0.0.34 lib/cello/pageobjects/browser.rb
cello-0.0.33 lib/cello/pageobjects/browser.rb
cello-0.0.32 lib/cello/pageobjects/browser.rb
cello-0.0.31 lib/cello/pageobjects/browser.rb
cello-0.0.30 lib/cello/pageobjects/browser.rb
cello-0.0.29 lib/cello/pageobjects/browser.rb
cello-0.0.28 lib/cello/pageobjects/browser.rb
cello-0.0.27 lib/cello/pageobjects/browser.rb
cello-0.0.26 lib/cello/pageobjects/browser.rb
cello-0.0.25 lib/cello/pageobjects/browser.rb