Module: Capybara::DSL

### Home Classes Methods

### In Files

- lib/capybara/dsl.rb

### Methods

- ::extended
- ::included
- #page
- #using_session
- #using_wait_time

### Files

- another_test_file.txt
- test_file.txt

### Class/Module Index

Quicksearch

- Capybara
- Capybara::Ambiguous
- Capybara::CapybaraError
- Capybara::DSL
- Capybara::Driver
- Capybara::Driver::Base
- Capybara::Driver::Node
- Capybara::DriverNotFoundError
- Capybara::ElementNotFound
- Capybara::ExpectationNotMet
- Capybara::Features
- Capybara::FileNotFound
- Capybara::FrozenInTime
- Capybara::Helpers
- Capybara::InfiniteRedirectError
- Capybara::ModalNotFound
- Capybara::Node
- Capybara::Node::Actions
- Capybara::Node::Base
- Capybara::Node::Document
- Capybara::Node::DocumentMatchers
- Capybara::Node::Element
- Capybara::Node::Finders
- Capybara::Node::Matchers
- Capybara::Node::Simple
- Capybara::NotSupportedByDriverError
- Capybara::Queries
- Capybara::Queries::BaseQuery
- Capybara::Queries::TextQuery
- Capybara::Queries::TitleQuery
- Capybara::Query
- Capybara::RSpecMatchers
- Capybara::RSpecMatchers::BecomeClosed
- Capybara::RSpecMatchers::HaveSelector
- Capybara::RSpecMatchers::HaveText
- Capybara::RSpecMatchers::HaveTitle
- Capybara::RSpecMatchers::Matcher
- Capybara::RackTest
- Capybara::RackTest::Browser
- Capybara::RackTest::CSSHandlers
- Capybara::RackTest::Driver
- Capybara::RackTest::Form
- Capybara::RackTest::Form::NilUploadedFile
- Capybara::RackTest::Node
- Capybara::ReadOnlyElementError
- Capybara::Result
- Capybara::ScopeError
- Capybara::Selector
- Capybara::Selector::Filter
- Capybara::Selenium
- Capybara::Selenium::Driver
- Capybara::Selenium::Node
- Capybara::Server
- Capybara::Server::Middleware
- Capybara::Session
- Capybara::SpecHelper
- Capybara::UnselectNotAllowed
- Capybara::Window
- Capybara::WindowError
- TestApp
- TestApp::TestAppError
- Object

No matching classes.

# Capybara::DSL

### Public Class Methods

extended(base) click to toggle source

    # File lib/capybara/dsl.rb, line 10
    def self.extended(base)
      warn "extending the main object with Capybara::DSL is not recommended!" if base == TOPLEVEL_BINDING.eval("self")
      super
    end

included(base) click to toggle source

    # File lib/capybara/dsl.rb, line 5
    def self.included(base)
      warn "including Capybara::DSL in the global scope is not recommended!" if base == Object
      super
    end

### Public Instance Methods

page() click to toggle source

Shortcut to accessing the current session.

    class MyClass
      include Capybara::DSL

      def has_header?
        page.has_css?('h1')
      end
    end

@return [Capybara::Session] The current session object

    # File lib/capybara/dsl.rb, line 45
    def page
      Capybara.current_session
    end

using_session(name, &block) click to toggle source

Shortcut to working in a different session.

    # File lib/capybara/dsl.rb, line 19
    def using_session(name, &block)
      Capybara.using_session(name, &block)
    end

using_wait_time(seconds, &block) click to toggle source

Shortcut to using a different wait time.

    # File lib/capybara/dsl.rb, line 27
    def using_wait_time(seconds, &block)
      Capybara.using_wait_time(seconds, &block)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.