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
6c3f0aa2
Commit
6c3f0aa2
authored
Mar 05, 2019
by
Mark Lapierre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[EE] Add QA test to download merge request patch/diffs
parent
34c9cbcf
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
65 additions
and
3 deletions
+65
-3
app/assets/javascripts/vue_merge_request_widget/components/mr_widget_header.vue
.../vue_merge_request_widget/components/mr_widget_header.vue
+11
-3
qa/qa/page/base.rb
qa/qa/page/base.rb
+4
-0
qa/qa/page/merge_request/show.rb
qa/qa/page/merge_request/show.rb
+16
-0
qa/qa/specs/features/browser_ui/3_create/merge_request/view_merge_request_diff_patch_spec.rb
...reate/merge_request/view_merge_request_diff_patch_spec.rb
+34
-0
qa/qa/specs/features/browser_ui/3_create/repository/user_views_commit_diff_patch_spec.rb
.../3_create/repository/user_views_commit_diff_patch_spec.rb
+0
-0
No files found.
app/assets/javascripts/vue_merge_request_widget/components/mr_widget_header.vue
View file @
6c3f0aa2
...
...
@@ -135,7 +135,7 @@ export default {
<span
class=
"dropdown"
>
<button
type=
"button"
class=
"btn dropdown-toggle"
class=
"btn dropdown-toggle
qa-dropdown-toggle
"
data-toggle=
"dropdown"
aria-label=
"Download as"
aria-haspopup=
"true"
...
...
@@ -145,12 +145,20 @@ export default {
</button>
<ul
class=
"dropdown-menu dropdown-menu-right"
>
<li>
<a
:href=
"mr.emailPatchesPath"
class=
"js-download-email-patches"
download
>
<a
:href=
"mr.emailPatchesPath"
class=
"js-download-email-patches qa-download-email-patches"
download
>
{{
s__
(
'
mrWidget|Email patches
'
)
}}
</a>
</li>
<li>
<a
:href=
"mr.plainDiffPath"
class=
"js-download-plain-diff"
download
>
<a
:href=
"mr.plainDiffPath"
class=
"js-download-plain-diff qa-download-plain-diff"
download
>
{{
s__
(
'
mrWidget|Plain diff
'
)
}}
</a>
</li>
...
...
qa/qa/page/base.rb
View file @
6c3f0aa2
...
...
@@ -157,6 +157,10 @@ module QA
find
(
'body'
).
click
end
def
visit_link_in_element
(
name
)
visit
find_element
(
name
)[
'href'
]
end
def
self
.
path
raise
NotImplementedError
end
...
...
qa/qa/page/merge_request/show.rb
View file @
6c3f0aa2
...
...
@@ -28,6 +28,12 @@ module QA
element
:squash_checkbox
end
view
'app/assets/javascripts/vue_merge_request_widget/components/mr_widget_header.vue'
do
element
:dropdown_toggle
element
:download_email_patches
element
:download_plain_diff
end
view
'app/views/projects/merge_requests/show.html.haml'
do
element
:notes_tab
element
:diffs_tab
...
...
@@ -166,6 +172,16 @@ module QA
all_elements
(
:approver
).
map
(
&
:text
)
end
end
def
view_email_patches
click_element
:dropdown_toggle
visit_link_in_element
(
:download_email_patches
)
end
def
view_plain_diff
click_element
:dropdown_toggle
visit_link_in_element
(
:download_plain_diff
)
end
end
end
end
...
...
qa/qa/specs/features/browser_ui/3_create/merge_request/view_merge_request_diff_patch_spec.rb
0 → 100644
View file @
6c3f0aa2
# frozen_string_literal: true
module
QA
context
'Create'
do
describe
'Download merge request patch and diff'
do
before
(
:context
)
do
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Page
::
Main
::
Login
.
perform
(
&
:sign_in_using_credentials
)
@merge_request
=
Resource
::
MergeRequest
.
fabricate!
do
|
merge_request
|
merge_request
.
title
=
'This is a merge request'
merge_request
.
description
=
'For downloading patches and diffs'
end
end
it
'user views merge request email patches'
do
@merge_request
.
visit!
Page
::
MergeRequest
::
Show
.
perform
(
&
:view_email_patches
)
expect
(
page
.
text
).
to
start_with
(
'From'
)
expect
(
page
).
to
have_content
(
'Subject: [PATCH] This is a test commit'
)
expect
(
page
).
to
have_content
(
'diff --git a/added_file.txt b/added_file.txt'
)
end
it
'user views merge request plain diff'
do
@merge_request
.
visit!
Page
::
MergeRequest
::
Show
.
perform
(
&
:view_plain_diff
)
expect
(
page
.
text
).
to
start_with
(
'diff --git a/added_file.txt b/added_file.txt'
)
expect
(
page
).
to
have_content
(
'+File Added'
)
end
end
end
end
qa/qa/specs/features/browser_ui/3_create/repository/user_views_
raw_diff_patch_requests
_spec.rb
→
qa/qa/specs/features/browser_ui/3_create/repository/user_views_
commit_diff_patch
_spec.rb
View file @
6c3f0aa2
File moved
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