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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
542765fb
Commit
542765fb
authored
Mar 17, 2020
by
Maxime Orefice
Committed by
Heinrich Lee Yu
Mar 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add rspec stdout metadata
Ties a capybara screenshot to a rspec failing test
parent
d0290377
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
qa/qa/runtime/browser.rb
qa/qa/runtime/browser.rb
+11
-0
spec/support/capybara.rb
spec/support/capybara.rb
+6
-0
No files found.
qa/qa/runtime/browser.rb
View file @
542765fb
...
@@ -44,11 +44,21 @@ module QA
...
@@ -44,11 +44,21 @@ module QA
new
.
visit
(
address
,
page_class
,
&
block
)
new
.
visit
(
address
,
page_class
,
&
block
)
end
end
# rubocop: disable Metrics/AbcSize
def
self
.
configure!
def
self
.
configure!
RSpec
.
configure
do
|
config
|
RSpec
.
configure
do
|
config
|
config
.
define_derived_metadata
(
file_path:
%r{/qa/specs/features/}
)
do
|
metadata
|
config
.
define_derived_metadata
(
file_path:
%r{/qa/specs/features/}
)
do
|
metadata
|
metadata
[
:type
]
=
:feature
metadata
[
:type
]
=
:feature
end
end
config
.
around
(
:each
)
do
|
example
|
example
.
run
if
example
.
metadata
[
:screenshot
]
screenshot
=
example
.
metadata
[
:screenshot
][
:image
]
||
example
.
metadata
[
:screenshot
][
:html
]
example
.
metadata
[
:stdout
]
=
%{[[ATTACHMENT|#{screenshot}]]}
end
end
end
end
Capybara
.
server_port
=
9887
+
ENV
[
'TEST_ENV_NUMBER'
].
to_i
Capybara
.
server_port
=
9887
+
ENV
[
'TEST_ENV_NUMBER'
].
to_i
...
@@ -140,6 +150,7 @@ module QA
...
@@ -140,6 +150,7 @@ module QA
config
.
default_normalize_ws
=
true
config
.
default_normalize_ws
=
true
end
end
end
end
# rubocop: enable Metrics/AbcSize
class
Session
class
Session
include
Capybara
::
DSL
include
Capybara
::
DSL
...
...
spec/support/capybara.rb
View file @
542765fb
...
@@ -126,6 +126,12 @@ RSpec.configure do |config|
...
@@ -126,6 +126,12 @@ RSpec.configure do |config|
Capybara
.
raise_server_errors
=
false
Capybara
.
raise_server_errors
=
false
example
.
run
example
.
run
if
example
.
metadata
[
:screenshot
]
screenshot
=
example
.
metadata
[
:screenshot
][
:image
]
||
example
.
metadata
[
:screenshot
][
:html
]
example
.
metadata
[
:stdout
]
=
%{[[ATTACHMENT|#{screenshot}]]}
end
ensure
ensure
Capybara
.
raise_server_errors
=
true
Capybara
.
raise_server_errors
=
true
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