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
Boxiang Sun
gitlab-ce
Commits
a0c6d085
Commit
a0c6d085
authored
Mar 05, 2019
by
Linda Dai
Committed by
Mark Lapierre
Mar 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add QA test to download merge request patch/diffs
parent
d11b1126
Changes
5
Hide 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 @
a0c6d085
...
...
@@ -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 @
a0c6d085
...
...
@@ -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 @
a0c6d085
...
...
@@ -27,6 +27,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
...
...
@@ -159,6 +165,16 @@ module QA
def
edit!
click_element
:edit_button
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 @
a0c6d085
# 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 @
a0c6d085
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