Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
a0c6d085
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a0c6d085
编写于
3月 05, 2019
作者:
L
Linda Dai
提交者:
Mark Lapierre
3月 05, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add QA test to download merge request patch/diffs
上级
d11b1126
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
65 addition
and
3 deletion
+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
未找到文件。
app/assets/javascripts/vue_merge_request_widget/components/mr_widget_header.vue
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
浏览文件 @
a0c6d085
文件已移动
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录