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
13532353
Commit
13532353
authored
Apr 25, 2018
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Select everything so we could hit protect
Add missing QA selectors as well
parent
51125bfb
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
82 additions
and
15 deletions
+82
-15
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
ee/app/views/projects/protected_branches/ee/_create_protected_branch.html.haml
.../protected_branches/ee/_create_protected_branch.html.haml
+4
-4
ee/app/views/projects/protected_branches/ee/_protected_branch_access_summary.html.haml
...ed_branches/ee/_protected_branch_access_summary.html.haml
+2
-2
qa/qa/ee.rb
qa/qa/ee.rb
+6
-0
qa/qa/ee/page/project/settings/protected_branches.rb
qa/qa/ee/page/project/settings/protected_branches.rb
+27
-0
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
+27
-5
No files found.
app/views/projects/protected_branches/_create_protected_branch.html.haml
View file @
13532353
-
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
View file @
13532353
%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
...
...
ee/app/views/projects/protected_branches/ee/_create_protected_branch.html.haml
View file @
13532353
-
content_for
:merge_access_levels
do
.merge_access_levels-container
=
dropdown_tag
(
'Select'
,
options:
{
toggle_class:
'js-allowed-to-merge js-multiselect wide'
,
dropdown_class:
'dropdown-menu-user dropdown-menu-selectable capitalize-header'
,
filter:
true
,
options:
{
toggle_class:
'js-allowed-to-merge
qa-allowed-to-merge-select
js-multiselect wide'
,
dropdown_class:
'dropdown-menu-user dropdown-menu-selectable
qa-allowed-to-merge-dropdown
capitalize-header'
,
filter:
true
,
data:
{
input_id:
'merge_access_levels_attributes'
,
default_label:
'Select'
}
})
-
content_for
:push_access_levels
do
.push_access_levels-container
=
dropdown_tag
(
'Select'
,
options:
{
toggle_class:
'js-allowed-to-push js-multiselect wide'
,
dropdown_class:
'dropdown-menu-user dropdown-menu-selectable capitalize-header'
,
filter:
true
,
options:
{
toggle_class:
'js-allowed-to-push
qa-allowed-to-push-select
js-multiselect wide'
,
dropdown_class:
'dropdown-menu-user dropdown-menu-selectable
qa-allowed-to-push-dropdown
capitalize-header'
,
filter:
true
,
data:
{
input_id:
'push_access_levels_attributes'
,
default_label:
'Select'
}
})
.help-block
Only groups that
...
...
ee/app/views/projects/protected_branches/ee/_protected_branch_access_summary.html.haml
View file @
13532353
%td
=
render
partial:
'projects/settings/ee/access_level_dropdown'
,
locals:
{
protected_branch:
protected_branch
,
access_levels:
protected_branch
.
merge_access_levels
,
level_frequencies:
access_level_frequencies
(
protected_branch
.
merge_access_levels
),
input_basic_name:
'merge_access_levels'
,
toggle_class:
'js-allowed-to-merge'
}
=
render
partial:
'projects/settings/ee/access_level_dropdown'
,
locals:
{
protected_branch:
protected_branch
,
access_levels:
protected_branch
.
merge_access_levels
,
level_frequencies:
access_level_frequencies
(
protected_branch
.
merge_access_levels
),
input_basic_name:
'merge_access_levels'
,
toggle_class:
'js-allowed-to-merge
qa-allowed-to-merge
'
}
%td
=
render
partial:
'projects/settings/ee/access_level_dropdown'
,
locals:
{
protected_branch:
protected_branch
,
access_levels:
protected_branch
.
push_access_levels
,
level_frequencies:
access_level_frequencies
(
protected_branch
.
push_access_levels
),
input_basic_name:
'push_access_levels'
,
toggle_class:
'js-allowed-to-push'
}
=
render
partial:
'projects/settings/ee/access_level_dropdown'
,
locals:
{
protected_branch:
protected_branch
,
access_levels:
protected_branch
.
push_access_levels
,
level_frequencies:
access_level_frequencies
(
protected_branch
.
push_access_levels
),
input_basic_name:
'push_access_levels'
,
toggle_class:
'js-allowed-to-push
qa-allowed-to-push
'
}
qa/qa/ee.rb
View file @
13532353
...
...
@@ -19,6 +19,12 @@ module QA
end
end
module
Project
module
Settings
autoload
:ProtectedBranches
,
'qa/ee/page/project/settings/protected_branches'
end
end
module
MergeRequest
autoload
:Show
,
'qa/ee/page/merge_request/show'
end
...
...
qa/qa/ee/page/project/settings/protected_branches.rb
0 → 100644
View file @
13532353
module
QA
module
EE
module
Page
module
Project
module
Settings
module
ProtectedBranches
def
self
.
prepended
(
page
)
page
.
module_eval
do
view
'ee/app/views/projects/protected_branches/ee/_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
'ee/app/views/projects/protected_branches/ee/_protected_branch_access_summary.html.haml'
do
element
:allowed_to_push
element
:allowed_to_merge
end
end
end
end
end
end
end
end
end
qa/qa/factory/resource/branch.rb
View file @
13532353
...
...
@@ -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
View file @
13532353
...
...
@@ -3,6 +3,8 @@ module QA
module
Project
module
Settings
class
ProtectedBranches
<
Page
::
Base
prepend
EE
::
Page
::
Project
::
Settings
::
ProtectedBranches
view
'app/views/projects/protected_branches/shared/_dropdown.html.haml'
do
element
:protected_branch_select
element
:protected_branch_dropdown
...
...
@@ -11,6 +13,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 +39,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 +72,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
...
...
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