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
Léo-Paul Géneau
gitlab-ce
Commits
2fa56074
Commit
2fa56074
authored
Mar 31, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly eagerly-load the Capybara server for JS feature specs only
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
f659c406
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
4 deletions
+9
-4
features/support/capybara.rb
features/support/capybara.rb
+1
-1
spec/support/capybara.rb
spec/support/capybara.rb
+6
-2
spec/support/test_env.rb
spec/support/test_env.rb
+2
-1
No files found.
features/support/capybara.rb
View file @
2fa56074
...
...
@@ -3,7 +3,7 @@ require 'capybara/poltergeist'
require
'capybara-screenshot/spinach'
# Give CI some extra time
timeout
=
(
ENV
[
'CI'
]
||
ENV
[
'CI_SERVER'
])
?
40
:
1
0
timeout
=
(
ENV
[
'CI'
]
||
ENV
[
'CI_SERVER'
])
?
60
:
3
0
Capybara
.
javascript_driver
=
:poltergeist
Capybara
.
register_driver
:poltergeist
do
|
app
|
...
...
spec/support/capybara.rb
View file @
2fa56074
# rubocop:disable Style/GlobalVars
require
'capybara/rails'
require
'capybara/rspec'
require
'capybara/poltergeist'
require
'capybara-screenshot/rspec'
# Give CI some extra time
timeout
=
(
ENV
[
'CI'
]
||
ENV
[
'CI_SERVER'
])
?
40
:
1
0
timeout
=
(
ENV
[
'CI'
]
||
ENV
[
'CI_SERVER'
])
?
60
:
3
0
Capybara
.
javascript_driver
=
:poltergeist
Capybara
.
register_driver
:poltergeist
do
|
app
|
...
...
@@ -26,7 +27,10 @@ Capybara.ignore_hidden_elements = true
Capybara
::
Screenshot
.
prune_strategy
=
:keep_last_run
RSpec
.
configure
do
|
config
|
config
.
before
(
:suite
)
do
config
.
before
(
:context
,
:js
)
do
next
if
$capybara_server_already_started
TestEnv
.
eager_load_driver_server
$capybara_server_already_started
=
true
end
end
spec/support/test_env.rb
View file @
2fa56074
...
...
@@ -172,7 +172,8 @@ module TestEnv
def
eager_load_driver_server
return
unless
defined?
(
Capybara
)
Capybara
.
current_session
.
driver
.
visit
'/'
puts
"Starting the Capybara driver' server..."
Capybara
.
current_session
.
visit
'/'
end
private
...
...
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