Commit 11ad7444 authored by Rémy Coutable's avatar Rémy Coutable

Ensure Spinach features with JS waits for requests to complete

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 60a5273d
......@@ -10,7 +10,7 @@ if ENV['CI']
Knapsack::Adapters::SpinachAdapter.bind
end
%w(select2_helper test_env repo_helpers wait_for_ajax sidekiq).each do |f|
%w(select2_helper test_env repo_helpers wait_for_ajax wait_for_requests sidekiq).each do |f|
require Rails.root.join('spec', 'support', f)
end
......@@ -30,6 +30,13 @@ Spinach.hooks.before_run do
include FactoryGirl::Syntax::Methods
end
Spinach.hooks.after_feature do |feature_data|
if feature_data.scenarios.flat_map(&:tags).include?('javascript')
include WaitForRequests
wait_for_requests_complete
end
end
module StdoutReporterWithScenarioLocation
# Override the standard reporter to show filename and line number next to each
# scenario for easy, focused re-runs
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment