Sha256: d8a51c94db0f027c166b5adea4cfb7498e49df75bcdacea35d1a2ac99941f1b9

Contents?: true

Size: 1.05 KB

Versions: 17

Compression:

Stored size: 1.05 KB

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, quirks: false, **options)
        find(:xpath, quirks ? '//body' : '/html').scroll_to(*args, **options)
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 5 rubygems

Version Path
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/capybara-3.40.0/lib/capybara/node/document.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/capybara-3.40.0/lib/capybara/node/document.rb
capybara-3.40.0 lib/capybara/node/document.rb
capybara-3.39.2 lib/capybara/node/document.rb
capybara-3.39.1 lib/capybara/node/document.rb
capybara-3.39.0 lib/capybara/node/document.rb
tdiary-5.2.4 vendor/bundle/ruby/3.1.0/gems/capybara-3.36.0/lib/capybara/node/document.rb
capybara-3.38.0 lib/capybara/node/document.rb
tdiary-5.2.3 vendor/bundle/ruby/3.1.0/gems/capybara-3.37.1/lib/capybara/node/document.rb
tdiary-5.2.2 vendor/bundle/ruby/3.1.0/gems/capybara-3.37.1/lib/capybara/node/document.rb
capybara-3.37.1 lib/capybara/node/document.rb
capybara-3.37.0 lib/capybara/node/document.rb
tdiary-5.2.1 vendor/bundle/ruby/3.1.0/gems/capybara-3.36.0/lib/capybara/node/document.rb
tdiary-5.2.0 vendor/bundle/ruby/3.0.0/gems/capybara-3.36.0/lib/capybara/node/document.rb
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/capybara-3.36.0/lib/capybara/node/document.rb
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/capybara-3.36.0/lib/capybara/node/document.rb
capybara-3.36.0 lib/capybara/node/document.rb