Module: Capybara::DSL
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Extended In:
| |
Defined in: | lib/capybara/rspec/matcher_proxies.rb, lib/capybara/dsl.rb |
Overview
:nocov:
Class Method Summary
- .extended(base)
-
.included(base)
See additional method definition at file lib/capybara/dsl.rb line 7.
Instance Method Summary
-
#page ⇒ Capybara::Session
Shortcut to accessing the current session.
-
#using_session(name_or_session, &block)
Shortcut to working in a different session.
-
#using_wait_time(seconds, &block)
Shortcut to using a different wait time.
Class Method Details
.extended(base)
[ GitHub ]# File 'lib/capybara/dsl.rb', line 12
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)
See additional method definition at file lib/capybara/dsl.rb line 7.
# File 'lib/capybara/rspec/matcher_proxies.rb', line 29
def self.included(base) warn 'including Capybara::DSL in the global scope is not recommended!' if base == Object super end
Instance Method Details
#page ⇒ Capybara::Session
Shortcut to accessing the current session.
class MyClass
include Capybara::DSL
def has_header?
page.has_css?('h1')
end
end
# File 'lib/capybara/dsl.rb', line 45
def page Capybara.current_session end
#using_session(name_or_session, &block)
Shortcut to working in a different session.
# File 'lib/capybara/dsl.rb', line 21
def using_session(name_or_session, &block) Capybara.using_session(name_or_session, &block) end
#using_wait_time(seconds, &block)
Shortcut to using a different wait time.
# File 'lib/capybara/dsl.rb', line 27
def using_wait_time(seconds, &block) page.using_wait_time(seconds, &block) end