BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
d1ed9640
Commit
d1ed9640
authored
May 12, 2017
by
Douwe Maan
Committed by
Regis
May 18, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch 'dm-wait-for-requests' into 'master'
Wait for requests after each Spinach scenario instead of feature See merge request !11349
parent
a72a3cc2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
8 deletions
+3
-8
env.rb
features/support/env.rb
+2
-2
wait_for_requests.rb
spec/support/wait_for_requests.rb
+1
-6
No files found.
features/support/env.rb
View file @
d1ed9640
...
...
@@ -30,8 +30,8 @@ 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'
)
Spinach
.
hooks
.
after_
scenario
do
|
scenario_data
,
step_definitions
|
if
scenario_data
.
tags
.
include?
(
'javascript'
)
include
WaitForRequests
wait_for_requests_complete
end
...
...
spec/support/wait_for_requests.rb
View file @
d1ed9640
...
...
@@ -10,17 +10,12 @@ module WaitForRequests
def
wait_for_requests_complete
Gitlab
::
Testing
::
RequestBlockerMiddleware
.
block_requests!
wait_for
(
'pending AJAX requests complete'
)
do
Gitlab
::
Testing
::
RequestBlockerMiddleware
.
num_active_requests
.
zero?
&&
finished_all_requests?
Gitlab
::
Testing
::
RequestBlockerMiddleware
.
num_active_requests
.
zero?
end
ensure
Gitlab
::
Testing
::
RequestBlockerMiddleware
.
allow_requests!
end
def
finished_all_requests?
finished_all_ajax_requests?
&&
finished_all_vue_resource_requests?
end
# Waits until the passed block returns true
def
wait_for
(
condition_name
,
max_wait_time:
Capybara
.
default_max_wait_time
,
polling_interval:
0.01
)
wait_until
=
Time
.
now
+
max_wait_time
.
seconds
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment