lib/screenshot.rb in aipim-rails-0.0.15 vs lib/screenshot.rb in aipim-rails-0.0.16
- old
+ new
@@ -1,20 +1,14 @@
require 'selenium-webdriver'
-Capybara.register_driver :selenium do |app|
- Capybara::Selenium::Driver.new(app, :browser => :firefox)
-end
+%x[rm aipim/screenshots/*]
-%x[rm ../aipim/screenshots/*]
-
-# Other drivers are available as well http://selenium.googlecode.com/svn/trunk/docs/api/rb/Selenium/WebDriver.html#for-class_method
-#driver = WebDriver.new()
-
Before('@javascript') do |scenario|
page.driver.browser.manage.window.maximize
end
After('@screenshot') do
return unless page.driver.browser
sleep(1.0)
- page.driver.save_screenshot("../aipim/screenshots/#{Time.now.to_i}.png")
+ page.driver.save_screenshot("aipim/screenshots/#{Time.now.to_i}.png")
end
+