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
2e08fd3c
Commit
2e08fd3c
authored
Jun 16, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'sh-fix-issue-33756' into 'master'
Wait for all Ajax and Vue requests to complete in JavaScript tests Closes #33756 See merge request !12203
parents
301386ed
fdf78bb9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
wait_for_requests.rb
spec/support/wait_for_requests.rb
+4
-4
No files found.
spec/support/wait_for_requests.rb
View file @
2e08fd3c
...
...
@@ -7,7 +7,7 @@ module WaitForRequests
def
block_and_wait_for_requests_complete
Gitlab
::
Testing
::
RequestBlockerMiddleware
.
block_requests!
wait_for
(
'pending requests complete'
)
do
Gitlab
::
Testing
::
RequestBlockerMiddleware
.
num_active_requests
.
zero?
Gitlab
::
Testing
::
RequestBlockerMiddleware
.
num_active_requests
.
zero?
&&
finished_all_requests?
end
ensure
Gitlab
::
Testing
::
RequestBlockerMiddleware
.
allow_requests!
...
...
@@ -40,13 +40,13 @@ module WaitForRequests
end
def
finished_all_vue_resource_requests?
page
.
evaluate_script
(
'window.activeVueResources || 0'
).
zero?
Capybara
.
page
.
evaluate_script
(
'window.activeVueResources || 0'
).
zero?
end
def
finished_all_ajax_requests?
return
true
if
page
.
evaluate_script
(
'typeof jQuery === "undefined"'
)
return
true
if
Capybara
.
page
.
evaluate_script
(
'typeof jQuery === "undefined"'
)
page
.
evaluate_script
(
'jQuery.active'
).
zero?
Capybara
.
page
.
evaluate_script
(
'jQuery.active'
).
zero?
end
def
javascript_test?
...
...
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