diff options
author | Rémy Coutable <remy@rymai.me> | 2017-04-26 12:40:52 +0200 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-04-26 12:40:52 +0200 |
commit | 11ad7444be81b656e8e2142ae24be0245be60a39 (patch) | |
tree | b154881118e2b1e870bbeca68adfecf21ddc7d47 /features/support | |
parent | 60a5273d7d49f074a75312642bcf2159b8a30ff6 (diff) | |
download | gitlab-ce-11ad7444be81b656e8e2142ae24be0245be60a39.tar.gz |
Ensure Spinach features with JS waits for requests to complete29836-try-waiting-for-ajax-in-addition-to-requests
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'features/support')
-rw-r--r-- | features/support/env.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/features/support/env.rb b/features/support/env.rb index 06c804b1db7..92d13bea4b6 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -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 |