Module: CapybaraRails::Selenium::ClassMethods

Defined in:
lib/capybara_rails/selenium.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#use_firebugObject

Returns the value of attribute use_firebug.



26
27
28
# File 'lib/capybara_rails/selenium.rb', line 26

def use_firebug
  @use_firebug
end

Instance Method Details

#firebugObject



27
28
29
# File 'lib/capybara_rails/selenium.rb', line 27

def firebug
  self.use_firebug = true
end

#javascriptObject



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/capybara_rails/selenium.rb', line 31

def javascript
  self.use_transactional_fixtures = false
  DatabaseCleaner.strategy = :truncation

  setup do
    DatabaseCleaner.start
    Capybara.current_driver = :selenium
    Capybara.current_driver = :selenium_with_firebug if self.class.use_firebug
    page.driver.options[:resynchronize] = true
  end

  teardown do
    DatabaseCleaner.clean
    Capybara.use_default_driver
  end
end