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
58980ca1
Commit
58980ca1
authored
Oct 21, 2021
by
Andrejs Cunskis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update qa:internal specs with test for browser.log attachment
parent
c1d3f201
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
3 deletions
+18
-3
qa/qa/runtime/allure_report.rb
qa/qa/runtime/allure_report.rb
+1
-1
qa/spec/specs/allure_report_spec.rb
qa/spec/specs/allure_report_spec.rb
+17
-2
No files found.
qa/qa/runtime/allure_report.rb
View file @
58980ca1
...
@@ -80,7 +80,7 @@ module QA
...
@@ -80,7 +80,7 @@ module QA
config
.
append_after
do
|
example
|
config
.
append_after
do
|
example
|
Allure
.
add_attachment
(
Allure
.
add_attachment
(
name:
'browser.log'
,
name:
'browser.log'
,
source:
page
.
driver
.
browser
.
logs
.
get
(
:browser
).
map
(
&
:to_s
).
join
(
"
\n\n
"
),
source:
Capybara
.
current_session
.
driver
.
browser
.
logs
.
get
(
:browser
).
map
(
&
:to_s
).
join
(
"
\n\n
"
),
type:
Allure
::
ContentType
::
TXT
,
type:
Allure
::
ContentType
::
TXT
,
test_case:
true
test_case:
true
)
)
...
...
qa/spec/specs/allure_report_spec.rb
View file @
58980ca1
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
describe
QA
::
Runtime
::
AllureReport
do
describe
QA
::
Runtime
::
AllureReport
do
include
QA
::
Support
::
Helpers
::
StubEnv
include
QA
::
Support
::
Helpers
::
StubEnv
let
(
:rspec_config
)
{
double
(
'RSpec::Core::Configuration'
,
'add_formatter'
:
nil
,
after:
nil
)
}
let
(
:rspec_config
)
{
double
(
'RSpec::Core::Configuration'
,
'add_formatter'
:
nil
,
a
ppend_a
fter:
nil
)
}
let
(
:png_path
)
{
'png_path'
}
let
(
:png_path
)
{
'png_path'
}
let
(
:html_path
)
{
'html_path'
}
let
(
:html_path
)
{
'html_path'
}
...
@@ -46,6 +46,8 @@ describe QA::Runtime::AllureReport do
...
@@ -46,6 +46,8 @@ describe QA::Runtime::AllureReport do
let
(
:html_file
)
{
'html-file'
}
let
(
:html_file
)
{
'html-file'
}
let
(
:ci_job
)
{
'ee:relative 5'
}
let
(
:ci_job
)
{
'ee:relative 5'
}
let
(
:versions
)
{
{
version:
'14'
,
revision:
'6ced31db947'
}
}
let
(
:versions
)
{
{
version:
'14'
,
revision:
'6ced31db947'
}
}
let
(
:session
)
{
double
(
'session'
)
}
let
(
:browser_log
)
{
[
'log message 1'
,
'log message 2'
]
}
before
do
before
do
stub_env
(
'CI'
,
'true'
)
stub_env
(
'CI'
,
'true'
)
...
@@ -58,6 +60,9 @@ describe QA::Runtime::AllureReport do
...
@@ -58,6 +60,9 @@ describe QA::Runtime::AllureReport do
allow
(
RestClient
::
Request
).
to
receive
(
:execute
)
{
double
(
'response'
,
code:
200
,
body:
versions
.
to_json
)
}
allow
(
RestClient
::
Request
).
to
receive
(
:execute
)
{
double
(
'response'
,
code:
200
,
body:
versions
.
to_json
)
}
allow
(
QA
::
Runtime
::
Scenario
).
to
receive
(
:method_missing
).
with
(
:gitlab_address
).
and_return
(
'gitlab.com'
)
allow
(
QA
::
Runtime
::
Scenario
).
to
receive
(
:method_missing
).
with
(
:gitlab_address
).
and_return
(
'gitlab.com'
)
allow
(
Capybara
).
to
receive
(
:current_session
).
and_return
(
session
)
allow
(
session
).
to
receive_message_chain
(
'driver.browser.logs.get'
).
and_return
(
browser_log
)
described_class
.
configure!
described_class
.
configure!
end
end
...
@@ -76,7 +81,11 @@ describe QA::Runtime::AllureReport do
...
@@ -76,7 +81,11 @@ describe QA::Runtime::AllureReport do
.
with
(
QA
::
Support
::
Formatters
::
AllureMetadataFormatter
).
ordered
.
with
(
QA
::
Support
::
Formatters
::
AllureMetadataFormatter
).
ordered
end
end
it
'configures screenshot saving'
do
it
'configures attachments saving'
do
expect
(
rspec_config
).
to
have_received
(
:append_after
)
do
|&
arg
|
arg
.
call
end
aggregate_failures
do
aggregate_failures
do
expect
(
Allure
).
to
have_received
(
:add_attachment
).
with
(
expect
(
Allure
).
to
have_received
(
:add_attachment
).
with
(
name:
'screenshot'
,
name:
'screenshot'
,
...
@@ -90,6 +99,12 @@ describe QA::Runtime::AllureReport do
...
@@ -90,6 +99,12 @@ describe QA::Runtime::AllureReport do
type:
'text/html'
,
type:
'text/html'
,
test_case:
true
test_case:
true
)
)
expect
(
Allure
).
to
have_received
(
:add_attachment
).
with
(
name:
'browser.log'
,
source:
browser_log
.
join
(
"
\n\n
"
),
type:
Allure
::
ContentType
::
TXT
,
test_case:
true
)
end
end
end
end
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