- around
- before
- after
- around
in capybara/rspec.rb
config.after do
if self.class.include?(Capybara::DSL)
Capybara.reset_sessions!
Capybara.use_default_driver
end
end
config.before do |example|
if self.class.include?(Capybara::DSL)
Capybara.current_driver = Capybara.javascript_driver if example.metadata[:js]
Capybara.current_driver = example.metadata[:driver] if example.metadata[:driver]
end
end
Capybara の session から driver をたどって driver の機能を直接使うには after hook を抜ける前になんとかする必要がある。