Sha256: 43ca5074ff5e6fb72c62f62e3a876296195bcf0cd861463b87fd1f8497ae16cd

Contents?: true

Size: 676 Bytes

Versions: 42

Compression:

Stored size: 676 Bytes

Contents

module Spider; module Test
    
    class PageObject
        attr_reader :browser
        
        def initialize(browser=nil)
            unless browser
                if Object.const_defined?(:Capybara) && Capybara.current_session
                    browser = Capybara.current_session
                end
            end
            @browser = browser
        end
        
        def go(url)
            if url =~ /^https?:\/\/([^\/])(\/.+)$/
                url = $1
            end
            @browser.visit(url)
        end
        
        def method_missing(method, *args)
            @browser.send(method, *args)
        end
        
        
    end
    
end; end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
spiderfw-1.0.1 lib/spiderfw/test/page_object.rb
spiderfw-1.0.0 lib/spiderfw/test/page_object.rb
spiderfw-0.6.39 lib/spiderfw/test/page_object.rb
spiderfw-0.6.38 lib/spiderfw/test/page_object.rb
spiderfw-0.6.37 lib/spiderfw/test/page_object.rb
spiderfw-0.6.35 lib/spiderfw/test/page_object.rb
spiderfw-0.6.34 lib/spiderfw/test/page_object.rb
spiderfw-0.6.33 lib/spiderfw/test/page_object.rb
spiderfw-0.6.32 lib/spiderfw/test/page_object.rb
spiderfw-0.6.31 lib/spiderfw/test/page_object.rb
spiderfw-0.6.30 lib/spiderfw/test/page_object.rb
spiderfw-0.6.29 lib/spiderfw/test/page_object.rb
spiderfw-0.6.28 lib/spiderfw/test/page_object.rb
spiderfw-0.6.27 lib/spiderfw/test/page_object.rb
spiderfw-0.6.26 lib/spiderfw/test/page_object.rb
spiderfw-0.6.26.pre1 lib/spiderfw/test/page_object.rb
spiderfw-0.6.25 lib/spiderfw/test/page_object.rb
spiderfw-0.6.24 lib/spiderfw/test/page_object.rb
spiderfw-0.6.23 lib/spiderfw/test/page_object.rb
spiderfw-0.6.22 lib/spiderfw/test/page_object.rb