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
82033e2e
Unverified
Commit
82033e2e
authored
Oct 18, 2016
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wait for ajax for every merge request spinach test
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
146e0cbc
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
14 deletions
+9
-14
merge_requests.rb
features/steps/project/merge_requests.rb
+4
-0
note.rb
features/steps/shared/note.rb
+0
-2
env.rb
features/support/env.rb
+1
-1
wait_for_ajax.rb
features/support/wait_for_ajax.rb
+0
-11
wait_for_ajax.rb
spec/support/wait_for_ajax.rb
+4
-0
No files found.
features/steps/project/merge_requests.rb
View file @
82033e2e
...
...
@@ -9,6 +9,10 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
include
SharedUser
include
WaitForAjax
after
do
wait_for_ajax
if
javascript_test?
end
step
'I click link "New Merge Request"'
do
click_link
"New Merge Request"
end
...
...
features/steps/shared/note.rb
View file @
82033e2e
require
Rails
.
root
.
join
(
'features/support/wait_for_ajax'
)
module
SharedNote
include
Spinach
::
DSL
include
WaitForAjax
...
...
features/support/env.rb
View file @
82033e2e
...
...
@@ -15,7 +15,7 @@ if ENV['CI']
Knapsack
::
Adapters
::
SpinachAdapter
.
bind
end
%w(select2_helper test_env repo_helpers)
.
each
do
|
f
|
%w(select2_helper test_env repo_helpers
wait_for_ajax
)
.
each
do
|
f
|
require
Rails
.
root
.
join
(
'spec'
,
'support'
,
f
)
end
...
...
features/support/wait_for_ajax.rb
deleted
100644 → 0
View file @
146e0cbc
module
WaitForAjax
def
wait_for_ajax
Timeout
.
timeout
(
Capybara
.
default_max_wait_time
)
do
loop
until
finished_all_ajax_requests?
end
end
def
finished_all_ajax_requests?
page
.
evaluate_script
(
'jQuery.active'
).
zero?
end
end
spec/support/wait_for_ajax.rb
View file @
82033e2e
...
...
@@ -8,4 +8,8 @@ module WaitForAjax
def
finished_all_ajax_requests?
page
.
evaluate_script
(
'jQuery.active'
).
zero?
end
def
javascript_test?
[
:selenium
,
:webkit
,
:chrome
,
:poltergeist
].
include?
(
Capybara
.
current_driver
)
end
end
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