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
f72adcc9
Commit
f72adcc9
authored
Jul 11, 2018
by
Dan Davison
Committed by
Rémy Coutable
Jul 11, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Milestone tests
parent
51da26fd
Changes
16
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
151 additions
and
18 deletions
+151
-18
app/views/layouts/nav/sidebar/_project.html.haml
app/views/layouts/nav/sidebar/_project.html.haml
+1
-1
app/views/projects/milestones/_form.html.haml
app/views/projects/milestones/_form.html.haml
+3
-3
app/views/projects/milestones/index.html.haml
app/views/projects/milestones/index.html.haml
+1
-1
app/views/projects/milestones/show.html.haml
app/views/projects/milestones/show.html.haml
+1
-1
app/views/shared/_new_project_item_select.html.haml
app/views/shared/_new_project_item_select.html.haml
+2
-2
app/views/shared/issuable/_milestone_dropdown.html.haml
app/views/shared/issuable/_milestone_dropdown.html.haml
+1
-1
app/views/shared/issuable/form/_metadata.html.haml
app/views/shared/issuable/form/_metadata.html.haml
+1
-1
qa/qa.rb
qa/qa.rb
+6
-0
qa/qa/factory/resource/merge_request.rb
qa/qa/factory/resource/merge_request.rb
+8
-3
qa/qa/factory/resource/project_milestone.rb
qa/qa/factory/resource/project_milestone.rb
+36
-0
qa/qa/page/menu/side.rb
qa/qa/page/menu/side.rb
+7
-0
qa/qa/page/merge_request/new.rb
qa/qa/page/merge_request/new.rb
+15
-0
qa/qa/page/merge_request/show.rb
qa/qa/page/merge_request/show.rb
+6
-0
qa/qa/page/project/milestone/index.rb
qa/qa/page/project/milestone/index.rb
+17
-0
qa/qa/page/project/milestone/new.rb
qa/qa/page/project/milestone/new.rb
+27
-0
qa/qa/specs/features/merge_request/create_spec.rb
qa/qa/specs/features/merge_request/create_spec.rb
+19
-5
No files found.
app/views/layouts/nav/sidebar/_project.html.haml
View file @
f72adcc9
...
@@ -122,7 +122,7 @@
...
@@ -122,7 +122,7 @@
=
render_if_exists
'projects/sidebar/issues_service_desk'
=
render_if_exists
'projects/sidebar/issues_service_desk'
=
nav_link
(
controller: :milestones
)
do
=
nav_link
(
controller: :milestones
)
do
=
link_to
project_milestones_path
(
@project
),
title:
'Milestones'
do
=
link_to
project_milestones_path
(
@project
),
title:
'Milestones'
,
class:
'qa-milestones-link'
do
%span
%span
=
_
(
'Milestones'
)
=
_
(
'Milestones'
)
-
if
project_nav_tab?
:external_issue_tracker
-
if
project_nav_tab?
:external_issue_tracker
...
...
app/views/projects/milestones/_form.html.haml
View file @
f72adcc9
...
@@ -7,12 +7,12 @@
...
@@ -7,12 +7,12 @@
.form-group.row
.form-group.row
=
f
.
label
:title
,
"Title"
,
class:
"col-form-label col-sm-2"
=
f
.
label
:title
,
"Title"
,
class:
"col-form-label col-sm-2"
.col-sm-10
.col-sm-10
=
f
.
text_field
:title
,
maxlength:
255
,
class:
"form-control"
,
required:
true
,
autofocus:
true
=
f
.
text_field
:title
,
maxlength:
255
,
class:
"
qa-milestone-title
form-control"
,
required:
true
,
autofocus:
true
.form-group.row.milestone-description
.form-group.row.milestone-description
=
f
.
label
:description
,
"Description"
,
class:
"col-form-label col-sm-2"
=
f
.
label
:description
,
"Description"
,
class:
"col-form-label col-sm-2"
.col-sm-10
.col-sm-10
=
render
layout:
'projects/md_preview'
,
locals:
{
url:
preview_markdown_path
(
@project
)
}
do
=
render
layout:
'projects/md_preview'
,
locals:
{
url:
preview_markdown_path
(
@project
)
}
do
=
render
'projects/zen'
,
f:
f
,
attr: :description
,
classes:
'note-textarea'
,
placeholder:
'Write milestone description...'
=
render
'projects/zen'
,
f:
f
,
attr: :description
,
classes:
'
qa-milestone-description
note-textarea'
,
placeholder:
'Write milestone description...'
=
render
'shared/notes/hints'
=
render
'shared/notes/hints'
.clearfix
.clearfix
.error-alert
.error-alert
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
.form-actions
.form-actions
-
if
@milestone
.
new_record?
-
if
@milestone
.
new_record?
=
f
.
submit
'Create milestone'
,
class:
"btn-create btn"
=
f
.
submit
'Create milestone'
,
class:
"btn-create btn
qa-milestone-create-button
"
=
link_to
"Cancel"
,
project_milestones_path
(
@project
),
class:
"btn btn-cancel"
=
link_to
"Cancel"
,
project_milestones_path
(
@project
),
class:
"btn btn-cancel"
-
else
-
else
=
f
.
submit
'Save changes'
,
class:
"btn-save btn"
=
f
.
submit
'Save changes'
,
class:
"btn-save btn"
...
...
app/views/projects/milestones/index.html.haml
View file @
f72adcc9
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
.nav-controls
.nav-controls
=
render
'shared/milestones_sort_dropdown'
=
render
'shared/milestones_sort_dropdown'
-
if
can?
(
current_user
,
:admin_milestone
,
@project
)
-
if
can?
(
current_user
,
:admin_milestone
,
@project
)
=
link_to
new_project_milestone_path
(
@project
),
class:
"btn btn-new"
,
title:
'New milestone'
do
=
link_to
new_project_milestone_path
(
@project
),
class:
"btn btn-new
qa-new-project-milestone
"
,
title:
'New milestone'
do
New milestone
New milestone
.milestones
.milestones
...
...
app/views/projects/milestones/show.html.haml
View file @
f72adcc9
...
@@ -60,7 +60,7 @@
...
@@ -60,7 +60,7 @@
=
icon
(
'angle-double-left'
)
=
icon
(
'angle-double-left'
)
.detail-page-description.milestone-detail
.detail-page-description.milestone-detail
%h2
.title
%h2
.title
.qa-milestone-title
=
markdown_field
(
@milestone
,
:title
)
=
markdown_field
(
@milestone
,
:title
)
%div
%div
...
...
app/views/shared/_new_project_item_select.html.haml
View file @
f72adcc9
-
if
any_projects?
(
@projects
)
-
if
any_projects?
(
@projects
)
.project-item-select-holder.btn-group
.project-item-select-holder.btn-group
%a
.btn.btn-new.new-project-item-link
{
href:
''
,
data:
{
label:
local_assigns
[
:label
],
type:
local_assigns
[
:type
]
}
}
%a
.btn.btn-new.new-project-item-link
.qa-new-project-item-link
{
href:
''
,
data:
{
label:
local_assigns
[
:label
],
type:
local_assigns
[
:type
]
}
}
=
icon
(
'spinner spin'
)
=
icon
(
'spinner spin'
)
=
project_select_tag
:project_path
,
class:
"project-item-select"
,
data:
{
include_groups:
local_assigns
[
:include_groups
],
order_by:
'last_activity_at'
,
relative_path:
local_assigns
[
:path
]
},
with_feature_enabled:
local_assigns
[
:with_feature_enabled
]
=
project_select_tag
:project_path
,
class:
"project-item-select"
,
data:
{
include_groups:
local_assigns
[
:include_groups
],
order_by:
'last_activity_at'
,
relative_path:
local_assigns
[
:path
]
},
with_feature_enabled:
local_assigns
[
:with_feature_enabled
]
%button
.btn.btn-new.new-project-item-select-button
%button
.btn.btn-new.new-project-item-select-button
.qa-new-project-item-select-button
=
icon
(
'caret-down'
)
=
icon
(
'caret-down'
)
app/views/shared/issuable/_milestone_dropdown.html.haml
View file @
f72adcc9
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
-
dropdown_title
=
local_assigns
.
fetch
(
:dropdown_title
,
"Filter by milestone"
)
-
dropdown_title
=
local_assigns
.
fetch
(
:dropdown_title
,
"Filter by milestone"
)
-
if
selected
.
present?
||
params
[
:milestone_title
].
present?
-
if
selected
.
present?
||
params
[
:milestone_title
].
present?
=
hidden_field_tag
(
name
,
name
==
:milestone_title
?
selected_text
:
selected
.
id
)
=
hidden_field_tag
(
name
,
name
==
:milestone_title
?
selected_text
:
selected
.
id
)
=
dropdown_tag
(
milestone_dropdown_label
(
selected_text
),
options:
{
title:
dropdown_title
,
toggle_class:
"
js-milestone-select js-filter-submit
#{
extra_class
}
"
,
filter:
true
,
dropdown_class:
"
dropdown-menu-selectable dropdown-menu-milestone"
,
=
dropdown_tag
(
milestone_dropdown_label
(
selected_text
),
options:
{
title:
dropdown_title
,
toggle_class:
"
qa-issuable-milestone-dropdown js-milestone-select js-filter-submit
#{
extra_class
}
"
,
filter:
true
,
dropdown_class:
"qa-issuable-dropdown-menu-milestone
dropdown-menu-selectable dropdown-menu-milestone"
,
placeholder:
"Search milestones"
,
footer_content:
project
.
present?
,
data:
{
show_no:
true
,
show_menu_above:
show_menu_above
,
show_any:
show_any
,
show_upcoming:
show_upcoming
,
show_started:
show_started
,
field_name:
name
,
selected:
selected_text
,
project_id:
project
.
try
(
:id
),
milestones:
milestones_filter_dropdown_path
,
default_label:
"Milestone"
}
})
do
placeholder:
"Search milestones"
,
footer_content:
project
.
present?
,
data:
{
show_no:
true
,
show_menu_above:
show_menu_above
,
show_any:
show_any
,
show_upcoming:
show_upcoming
,
show_started:
show_started
,
field_name:
name
,
selected:
selected_text
,
project_id:
project
.
try
(
:id
),
milestones:
milestones_filter_dropdown_path
,
default_label:
"Milestone"
}
})
do
-
if
project
-
if
project
%ul
.dropdown-footer-list
%ul
.dropdown-footer-list
...
...
app/views/shared/issuable/form/_metadata.html.haml
View file @
f72adcc9
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
=
form
.
label
:milestone_id
,
"Milestone"
,
class:
"col-form-label
#{
has_due_date
?
"col-md-2 col-lg-4"
:
"col-sm-2"
}
"
=
form
.
label
:milestone_id
,
"Milestone"
,
class:
"col-form-label
#{
has_due_date
?
"col-md-2 col-lg-4"
:
"col-sm-2"
}
"
.col-sm-10
{
class:
(
"col-md-8"
if
has_due_date
)
}
.col-sm-10
{
class:
(
"col-md-8"
if
has_due_date
)
}
.issuable-form-select-holder
.issuable-form-select-holder
=
render
"shared/issuable/milestone_dropdown"
,
selected:
issuable
.
milestone
,
name:
"
#{
issuable
.
class
.
model_name
.
param_key
}
[milestone_id]"
,
show_any:
false
,
show_upcoming:
false
,
show_started:
false
,
extra_class:
"js-issuable-form-dropdown js-dropdown-keep-input"
,
dropdown_title:
"Select milestone"
=
render
"shared/issuable/milestone_dropdown"
,
selected:
issuable
.
milestone
,
name:
"
#{
issuable
.
class
.
model_name
.
param_key
}
[milestone_id]"
,
show_any:
false
,
show_upcoming:
false
,
show_started:
false
,
extra_class:
"
qa-issuable-milestone-dropdown
js-issuable-form-dropdown js-dropdown-keep-input"
,
dropdown_title:
"Select milestone"
.form-group.row
.form-group.row
-
has_labels
=
@labels
&&
@labels
.
any?
-
has_labels
=
@labels
&&
@labels
.
any?
=
form
.
label
:label_ids
,
"Labels"
,
class:
"col-form-label
#{
has_due_date
?
"col-md-2 col-lg-4"
:
"col-sm-2"
}
"
=
form
.
label
:label_ids
,
"Labels"
,
class:
"col-form-label
#{
has_due_date
?
"col-md-2 col-lg-4"
:
"col-sm-2"
}
"
...
...
qa/qa.rb
View file @
f72adcc9
...
@@ -47,6 +47,7 @@ module QA
...
@@ -47,6 +47,7 @@ module QA
autoload
:Runner
,
'qa/factory/resource/runner'
autoload
:Runner
,
'qa/factory/resource/runner'
autoload
:PersonalAccessToken
,
'qa/factory/resource/personal_access_token'
autoload
:PersonalAccessToken
,
'qa/factory/resource/personal_access_token'
autoload
:KubernetesCluster
,
'qa/factory/resource/kubernetes_cluster'
autoload
:KubernetesCluster
,
'qa/factory/resource/kubernetes_cluster'
autoload
:ProjectMilestone
,
'qa/factory/resource/project_milestone'
autoload
:Wiki
,
'qa/factory/resource/wiki'
autoload
:Wiki
,
'qa/factory/resource/wiki'
end
end
...
@@ -166,6 +167,11 @@ module QA
...
@@ -166,6 +167,11 @@ module QA
autoload
:Index
,
'qa/page/project/issue/index'
autoload
:Index
,
'qa/page/project/issue/index'
end
end
module
Milestone
autoload
:New
,
'qa/page/project/milestone/new'
autoload
:Index
,
'qa/page/project/milestone/index'
end
module
Operations
module
Operations
module
Kubernetes
module
Kubernetes
autoload
:Index
,
'qa/page/project/operations/kubernetes/index'
autoload
:Index
,
'qa/page/project/operations/kubernetes/index'
...
...
qa/qa/factory/resource/merge_request.rb
View file @
f72adcc9
...
@@ -7,7 +7,10 @@ module QA
...
@@ -7,7 +7,10 @@ module QA
attr_accessor
:title
,
attr_accessor
:title
,
:description
,
:description
,
:source_branch
,
:source_branch
,
:target_branch
:target_branch
,
:assignee
,
:milestone
,
:labels
product
:project
do
|
factory
|
product
:project
do
|
factory
|
factory
.
project
factory
.
project
...
@@ -41,16 +44,18 @@ module QA
...
@@ -41,16 +44,18 @@ module QA
@description
=
'This is a test merge request'
@description
=
'This is a test merge request'
@source_branch
=
"qa-test-feature-
#{
SecureRandom
.
hex
(
8
)
}
"
@source_branch
=
"qa-test-feature-
#{
SecureRandom
.
hex
(
8
)
}
"
@target_branch
=
"master"
@target_branch
=
"master"
@assignee
=
nil
@milestone
=
nil
@labels
=
[]
end
end
def
fabricate!
def
fabricate!
project
.
visit!
project
.
visit!
Page
::
Project
::
Show
.
act
{
new_merge_request
}
Page
::
Project
::
Show
.
act
{
new_merge_request
}
Page
::
MergeRequest
::
New
.
perform
do
|
page
|
Page
::
MergeRequest
::
New
.
perform
do
|
page
|
page
.
fill_title
(
@title
)
page
.
fill_title
(
@title
)
page
.
fill_description
(
@description
)
page
.
fill_description
(
@description
)
page
.
choose_milestone
(
@milestone
)
if
@milestone
page
.
create_merge_request
page
.
create_merge_request
end
end
end
end
...
...
qa/qa/factory/resource/project_milestone.rb
0 → 100644
View file @
f72adcc9
module
QA
module
Factory
module
Resource
class
ProjectMilestone
<
Factory
::
Base
attr_accessor
:description
attr_reader
:title
dependency
Factory
::
Resource
::
Project
,
as: :project
product
(
:title
)
{
|
factory
|
factory
.
title
}
def
title
=
(
title
)
@title
=
"
#{
title
}
-
#{
SecureRandom
.
hex
(
4
)
}
"
@description
=
'A milestone'
end
def
fabricate!
project
.
visit!
Page
::
Menu
::
Side
.
act
do
click_issues
click_milestones
end
Page
::
Project
::
Milestone
::
Index
.
act
{
click_new_milestone
}
Page
::
Project
::
Milestone
::
New
.
perform
do
|
milestone_new
|
milestone_new
.
set_title
(
@title
)
milestone_new
.
set_description
(
@description
)
milestone_new
.
create_new_milestone
end
end
end
end
end
end
qa/qa/page/menu/side.rb
View file @
f72adcc9
...
@@ -16,6 +16,7 @@ module QA
...
@@ -16,6 +16,7 @@ module QA
element
:operations_section
,
"class: 'shortcuts-operations'"
element
:operations_section
,
"class: 'shortcuts-operations'"
element
:activity_link
,
"title: 'Activity'"
element
:activity_link
,
"title: 'Activity'"
element
:wiki_link_text
,
"Wiki"
element
:wiki_link_text
,
"Wiki"
element
:milestones_link
end
end
view
'app/assets/javascripts/fly_out_nav.js'
do
view
'app/assets/javascripts/fly_out_nav.js'
do
...
@@ -70,6 +71,12 @@ module QA
...
@@ -70,6 +71,12 @@ module QA
end
end
end
end
def
click_milestones
within_sidebar
do
click_element
:milestones_link
end
end
def
click_wiki
def
click_wiki
within_sidebar
do
within_sidebar
do
click_link
(
'Wiki'
)
click_link
(
'Wiki'
)
...
...
qa/qa/page/merge_request/new.rb
View file @
f72adcc9
...
@@ -10,10 +10,18 @@ module QA
...
@@ -10,10 +10,18 @@ module QA
element
:issuable_form_title
element
:issuable_form_title
end
end
view
'app/views/shared/issuable/form/_metadata.html.haml'
do
element
:issuable_milestone_dropdown
end
view
'app/views/shared/form_elements/_description.html.haml'
do
view
'app/views/shared/form_elements/_description.html.haml'
do
element
:issuable_form_description
element
:issuable_form_description
end
end
view
'app/views/shared/issuable/_milestone_dropdown.html.haml'
do
element
:issuable_dropdown_menu_milestone
end
def
create_merge_request
def
create_merge_request
click_element
:issuable_create_button
click_element
:issuable_create_button
end
end
...
@@ -25,6 +33,13 @@ module QA
...
@@ -25,6 +33,13 @@ module QA
def
fill_description
(
description
)
def
fill_description
(
description
)
fill_element
:issuable_form_description
,
description
fill_element
:issuable_form_description
,
description
end
end
def
choose_milestone
(
milestone
)
click_element
:issuable_milestone_dropdown
within_element
(
:issuable_dropdown_menu_milestone
)
do
click_on
milestone
.
title
end
end
end
end
end
end
end
end
...
...
qa/qa/page/merge_request/show.rb
View file @
f72adcc9
...
@@ -79,6 +79,12 @@ module QA
...
@@ -79,6 +79,12 @@ module QA
click_element
:squash_checkbox
click_element
:squash_checkbox
end
end
def
has_milestone?
(
milestone_title
)
page
.
within
(
'.issuable-sidebar'
)
do
!!
find
(
"[href*='/milestones/']"
,
text:
milestone_title
,
wait:
1
)
end
end
end
end
end
end
end
end
...
...
qa/qa/page/project/milestone/index.rb
0 → 100644
View file @
f72adcc9
module
QA
module
Page
module
Project
module
Milestone
class
Index
<
Page
::
Base
view
'app/views/projects/milestones/index.html.haml'
do
element
:new_project_milestone
end
def
click_new_milestone
click_element
:new_project_milestone
end
end
end
end
end
end
qa/qa/page/project/milestone/new.rb
0 → 100644
View file @
f72adcc9
module
QA
module
Page
module
Project
module
Milestone
class
New
<
Page
::
Base
view
'app/views/projects/milestones/_form.html.haml'
do
element
:milestone_create_button
element
:milestone_title
element
:milestone_description
end
def
set_title
(
title
)
fill_element
:milestone_title
,
title
end
def
set_description
(
description
)
fill_element
:milestone_description
,
description
end
def
create_new_milestone
click_element
:milestone_create_button
end
end
end
end
end
end
qa/qa/specs/features/merge_request/create_spec.rb
View file @
f72adcc9
...
@@ -4,14 +4,28 @@ module QA
...
@@ -4,14 +4,28 @@ module QA
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Page
::
Main
::
Login
.
act
{
sign_in_using_credentials
}
Page
::
Main
::
Login
.
act
{
sign_in_using_credentials
}
current_project
=
Factory
::
Resource
::
Project
.
fabricate!
do
|
project
|
project
.
name
=
'project-with-merge-request-and-milestone'
end
current_milestone
=
Factory
::
Resource
::
ProjectMilestone
.
fabricate!
do
|
milestone
|
milestone
.
title
=
'unique-milestone'
milestone
.
project
=
current_project
end
Factory
::
Resource
::
MergeRequest
.
fabricate!
do
|
merge_request
|
Factory
::
Resource
::
MergeRequest
.
fabricate!
do
|
merge_request
|
merge_request
.
title
=
'This is a merge request'
merge_request
.
title
=
'This is a merge request with a milestone'
merge_request
.
description
=
'Great feature'
merge_request
.
description
=
'Great feature with milestone'
merge_request
.
project
=
current_project
merge_request
.
milestone
=
current_milestone
end
end
expect
(
page
).
to
have_content
(
'This is a merge request'
)
Page
::
MergeRequest
::
Show
.
perform
do
|
merge_request
|
expect
(
page
).
to
have_content
(
'Great feature'
)
expect
(
page
).
to
have_content
(
'This is a merge request with a milestone'
)
expect
(
page
).
to
have_content
(
'Great feature with milestone'
)
expect
(
page
).
to
have_content
(
/Opened [\w\s]+ ago/
)
expect
(
page
).
to
have_content
(
/Opened [\w\s]+ ago/
)
expect
(
merge_request
).
to
have_milestone
(
current_milestone
.
title
)
end
end
end
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