Sha256: 6f3b4fc1bf3087c5dd0bb2792a70eb72b2e55a8b1dd186545767a5e86c39f860

Contents?: true

Size: 1020 Bytes

Versions: 32

Compression:

Stored size: 1020 Bytes

Contents

# frozen_string_literal: true

module Capybara
  module Node
    ##
    #
    # A {Capybara::Document} represents an HTML document. Any operation
    # performed on it will be performed on the entire document.
    #
    # @see Capybara::Node
    #
    class Document < Base
      include Capybara::Node::DocumentMatchers

      def inspect
        %(#<Capybara::Document>)
      end

      ##
      #
      # @return [String]    The text of the document
      #
      def text(type = nil, normalize_ws: false)
        find(:xpath, '/html').text(type, normalize_ws: normalize_ws)
      end

      ##
      #
      # @return [String]    The title of the document
      #
      def title
        session.driver.title
      end

      def execute_script(*args)
        find(:xpath, '/html').execute_script(*args)
      end

      def evaluate_script(*args)
        find(:xpath, '/html').evaluate_script(*args)
      end

      def scroll_to(*args)
        find(:xpath, '//body').scroll_to(*args)
      end
    end
  end
end

Version data entries

32 entries across 32 versions & 3 rubygems

Version Path
tdiary-5.1.2 vendor/bundle/ruby/2.6.0/gems/capybara-3.29.0/lib/capybara/node/document.rb
tdiary-5.1.1 vendor/bundle/ruby/2.6.0/gems/capybara-3.29.0/lib/capybara/node/document.rb
tdiary-5.1.0 vendor/bundle/gems/capybara-3.29.0/lib/capybara/node/document.rb
chatops-rpc-0.0.2 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/capybara-3.29.0/lib/capybara/node/document.rb
chatops-rpc-0.0.1 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/capybara-3.29.0/lib/capybara/node/document.rb
capybara-3.29.0 lib/capybara/node/document.rb
capybara-3.28.0 lib/capybara/node/document.rb
capybara-3.27.0 lib/capybara/node/document.rb
capybara-3.26.0 lib/capybara/node/document.rb
capybara-3.25.0 lib/capybara/node/document.rb
capybara-3.24.0 lib/capybara/node/document.rb
capybara-3.23.0 lib/capybara/node/document.rb
capybara-3.22.0 lib/capybara/node/document.rb
capybara-3.21.0 lib/capybara/node/document.rb
capybara-3.20.2 lib/capybara/node/document.rb
capybara-3.20.1 lib/capybara/node/document.rb
capybara-3.20.0 lib/capybara/node/document.rb
capybara-3.19.1 lib/capybara/node/document.rb
capybara-3.19.0 lib/capybara/node/document.rb
capybara-3.18.0 lib/capybara/node/document.rb