Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
9cc2123e
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,发现更多精彩内容 >>
提交
9cc2123e
编写于
4月 25, 2018
作者:
L
Lin Jen-Shin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Select everything so we could hit protect
Add missing QA selectors as well
上级
c5f6c811
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
41 addition
and
9 deletion
+41
-9
app/views/projects/protected_branches/_create_protected_branch.html.haml
...cts/protected_branches/_create_protected_branch.html.haml
+2
-2
app/views/projects/protected_branches/_update_protected_branch.html.haml
...cts/protected_branches/_update_protected_branch.html.haml
+1
-1
qa/qa/factory/resource/branch.rb
qa/qa/factory/resource/branch.rb
+13
-1
qa/qa/page/project/settings/protected_branches.rb
qa/qa/page/project/settings/protected_branches.rb
+25
-5
未找到文件。
app/views/projects/protected_branches/_create_protected_branch.html.haml
浏览文件 @
9cc2123e
-
content_for
:merge_access_levels
do
.merge_access_levels-container
=
dropdown_tag
(
'Select'
,
options:
{
toggle_class:
'js-allowed-to-merge wide'
,
dropdown_class:
'dropdown-menu-selectable capitalize-header'
,
options:
{
toggle_class:
'js-allowed-to-merge
qa-allowed-to-merge-select
wide'
,
dropdown_class:
'dropdown-menu-selectable
qa-allowed-to-merge-dropdown
capitalize-header'
,
data:
{
field_name:
'protected_branch[merge_access_levels_attributes][0][access_level]'
,
input_id:
'merge_access_levels_attributes'
}})
-
content_for
:push_access_levels
do
.push_access_levels-container
...
...
app/views/projects/protected_branches/_update_protected_branch.html.haml
浏览文件 @
9cc2123e
%td
=
hidden_field_tag
"allowed_to_merge_
#{
protected_branch
.
id
}
"
,
protected_branch
.
merge_access_levels
.
first
.
access_level
=
dropdown_tag
(
(
protected_branch
.
merge_access_levels
.
first
.
humanize
||
'Select'
)
,
options:
{
toggle_class:
'js-allowed-to-merge'
,
dropdown_class:
'dropdown-menu-selectable js-allowed-to-merge-container capitalize-header'
,
options:
{
toggle_class:
'js-allowed-to-merge
qa-allowed-to-merge
'
,
dropdown_class:
'dropdown-menu-selectable js-allowed-to-merge-container capitalize-header'
,
data:
{
field_name:
"allowed_to_merge_
#{
protected_branch
.
id
}
"
,
access_level_id:
protected_branch
.
merge_access_levels
.
first
.
id
}})
%td
=
hidden_field_tag
"allowed_to_push_
#{
protected_branch
.
id
}
"
,
protected_branch
.
push_access_levels
.
first
.
access_level
...
...
qa/qa/factory/resource/branch.rb
浏览文件 @
9cc2123e
...
...
@@ -2,7 +2,8 @@ module QA
module
Factory
module
Resource
class
Branch
<
Factory
::
Base
attr_accessor
:project
,
:branch_name
,
:allow_to_push
,
:protected
attr_accessor
:project
,
:branch_name
,
:allow_to_push
,
:allow_to_merge
,
:protected
dependency
Factory
::
Resource
::
Project
,
as: :project
do
|
project
|
project
.
name
=
'protected-branch-project'
...
...
@@ -23,6 +24,7 @@ module QA
def
initialize
@branch_name
=
'test/branch'
@allow_to_push
=
true
@allow_to_merge
=
true
@protected
=
false
end
...
...
@@ -63,6 +65,16 @@ module QA
page
.
allow_no_one_to_push
end
if
allow_to_merge
page
.
allow_devs_and_masters_to_merge
else
page
.
allow_no_one_to_merge
end
page
.
wait
(
reload:
false
)
do
!
page
.
first
(
'.btn-create'
).
disabled?
end
page
.
protect_branch
end
end
...
...
qa/qa/page/project/settings/protected_branches.rb
浏览文件 @
9cc2123e
...
...
@@ -11,6 +11,13 @@ module QA
view
'app/views/projects/protected_branches/_create_protected_branch.html.haml'
do
element
:allowed_to_push_select
element
:allowed_to_push_dropdown
element
:allowed_to_merge_select
element
:allowed_to_merge_dropdown
end
view
'app/views/projects/protected_branches/_update_protected_branch.html.haml'
do
element
:allowed_to_push
element
:allowed_to_merge
end
view
'app/views/projects/protected_branches/shared/_branches_list.html.haml'
do
...
...
@@ -30,11 +37,19 @@ module QA
end
def
allow_no_one_to_push
allow_to_push
(
'No one'
)
click_allow
(
:push
,
'No one'
)
end
def
allow_devs_and_masters_to_push
allow_to_push
(
'Developers + Masters'
)
click_allow
(
:push
,
'Developers + Masters'
)
end
def
allow_no_one_to_merge
click_allow
(
:merge
,
'No one'
)
end
def
allow_devs_and_masters_to_merge
click_allow
(
:merge
,
'Developers + Masters'
)
end
def
protect_branch
...
...
@@ -55,11 +70,16 @@ module QA
private
def
allow_to_push
(
text
)
click_element
:
allowed_to_push_select
def
click_allow
(
action
,
text
)
click_element
:
"allowed_to_
#{
action
}
_select"
within_element
(
:allowed_to_push_dropdown
)
do
within_element
(
:"allowed_to_
#{
action
}
_dropdown"
)
do
click_on
text
wait
(
reload:
false
)
do
has_css?
(
'.is-active'
)
end
end
end
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录