Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
fdf78bb9
Commit
fdf78bb9
authored
Jun 15, 2017
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid including Capybara::DSL to conflict with definition of page
parent
806ffd2c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
5 deletions
+3
-5
spec/support/wait_for_requests.rb
spec/support/wait_for_requests.rb
+3
-5
No files found.
spec/support/wait_for_requests.rb
View file @
fdf78bb9
...
@@ -3,8 +3,6 @@ require_relative './wait_for_requests'
...
@@ -3,8 +3,6 @@ require_relative './wait_for_requests'
module
WaitForRequests
module
WaitForRequests
extend
self
extend
self
include
Capybara
::
DSL
# This is inspired by http://www.salsify.com/blog/engineering/tearing-capybara-ajax-tests
# This is inspired by http://www.salsify.com/blog/engineering/tearing-capybara-ajax-tests
def
block_and_wait_for_requests_complete
def
block_and_wait_for_requests_complete
Gitlab
::
Testing
::
RequestBlockerMiddleware
.
block_requests!
Gitlab
::
Testing
::
RequestBlockerMiddleware
.
block_requests!
...
@@ -42,13 +40,13 @@ module WaitForRequests
...
@@ -42,13 +40,13 @@ module WaitForRequests
end
end
def
finished_all_vue_resource_requests?
def
finished_all_vue_resource_requests?
page
.
evaluate_script
(
'window.activeVueResources || 0'
).
zero?
Capybara
.
page
.
evaluate_script
(
'window.activeVueResources || 0'
).
zero?
end
end
def
finished_all_ajax_requests?
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
end
def
javascript_test?
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