Module: Capybara::DSL

Included in:
Capybara
Defined in:
lib/capybara/dsl.rb

Instance Method Summary collapse

Instance Method Details

#pageCapybara::Session

Shortcut to accessing the current session.

class MyClass
  include Capybara::DSL

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

Returns:



36
37
38
# File 'lib/capybara/dsl.rb', line 36

def page
  Capybara.current_session
end

#using_session(name, &block) ⇒ Object

Shortcut to working in a different session.



10
11
12
# File 'lib/capybara/dsl.rb', line 10

def using_session(name, &block)
  Capybara.using_session(name, &block)
end

#using_wait_time(seconds, &block) ⇒ Object

Shortcut to using a different wait time.



18
19
20
# File 'lib/capybara/dsl.rb', line 18

def using_wait_time(seconds, &block)
  Capybara.using_wait_time(seconds, &block)
end