mirror of
https://github.com/Fishwaldo/huginn.git
synced 2025-03-15 19:31:26 +00:00
Removes unnecessary screenshot helper
Switches timeout based on being on slow CI, or fast dev boxes - can use Capybara's built in `save_and_open_screenshot`
This commit is contained in:
parent
7c9fe17493
commit
8a7f3fe4f1
4 changed files with 4 additions and 18 deletions
1
Gemfile
1
Gemfile
|
@ -144,7 +144,6 @@ group :development do
|
|||
gem 'coveralls', require: false
|
||||
gem 'capybara-select2', require: false
|
||||
gem 'delorean'
|
||||
gem 'launchy', require: false
|
||||
gem 'poltergeist'
|
||||
gem 'pry-rails'
|
||||
gem 'rr'
|
||||
|
|
|
@ -627,7 +627,6 @@ DEPENDENCIES
|
|||
jsonpath (~> 0.5.6)
|
||||
kaminari (~> 0.16.1)
|
||||
kramdown (~> 1.3.3)
|
||||
launchy
|
||||
letter_opener_web
|
||||
liquid (~> 3.0.3)
|
||||
listen (~> 3.0.5)
|
||||
|
|
|
@ -2,18 +2,18 @@ require 'rails_helper'
|
|||
require 'capybara/rails'
|
||||
require 'capybara/poltergeist'
|
||||
require 'capybara-select2'
|
||||
require 'helpers/capybara_poltergeist_screenshot'
|
||||
|
||||
CAPYBARA_TIMEOUT = ENV['CI'] == 'true' ? 60 : 5
|
||||
|
||||
Capybara.register_driver :poltergeist do |app|
|
||||
Capybara::Poltergeist::Driver.new(app, timeout: 5)
|
||||
Capybara::Poltergeist::Driver.new(app, timeout: CAPYBARA_TIMEOUT)
|
||||
end
|
||||
|
||||
Capybara.javascript_driver = :poltergeist
|
||||
Capybara.default_max_wait_time = 5
|
||||
Capybara.default_max_wait_time = CAPYBARA_TIMEOUT
|
||||
|
||||
RSpec.configure do |config|
|
||||
config.include Warden::Test::Helpers
|
||||
config.include Capybara::PoltergeistScreenshot
|
||||
config.before :suite do
|
||||
Warden.test_mode!
|
||||
end
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
require 'launchy'
|
||||
|
||||
module Capybara
|
||||
module PoltergeistScreenshot
|
||||
def screenshot_and_open_image(full: false)
|
||||
timestamp = Time.now.strftime('%Y-%m-%d-%H-%M-%S')
|
||||
screenshot_path = "tmp/capybara/screenshot_#{timestamp}_#{SecureRandom.hex}.png"
|
||||
page.save_screenshot(screenshot_path, full: full)
|
||||
Launchy.open screenshot_path
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Reference in a new issue