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
cf7d23a6
Commit
cf7d23a6
authored
Jun 19, 2020
by
Desiree Chevalier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add create project milestone spec
Adds an e2e spec for creating a project milestone
parent
368ba899
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
175 additions
and
33 deletions
+175
-33
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/shared/milestones/_description.html.haml
app/views/shared/milestones/_description.html.haml
+3
-2
app/views/shared/milestones/_form_dates.html.haml
app/views/shared/milestones/_form_dates.html.haml
+2
-2
app/views/shared/milestones/_milestone.html.haml
app/views/shared/milestones/_milestone.html.haml
+2
-1
app/views/shared/milestones/_sidebar.html.haml
app/views/shared/milestones/_sidebar.html.haml
+2
-2
qa/qa.rb
qa/qa.rb
+1
-0
qa/qa/ee/page/project/milestone/show.rb
qa/qa/ee/page/project/milestone/show.rb
+16
-9
qa/qa/page/project/milestone/index.rb
qa/qa/page/project/milestone/index.rb
+15
-3
qa/qa/page/project/milestone/new.rb
qa/qa/page/project/milestone/new.rb
+20
-7
qa/qa/page/project/milestone/show.rb
qa/qa/page/project/milestone/show.rb
+35
-0
qa/qa/page/project/sub_menus/issues.rb
qa/qa/page/project/sub_menus/issues.rb
+8
-0
qa/qa/resource/project_milestone.rb
qa/qa/resource/project_milestone.rb
+19
-1
qa/qa/specs/features/browser_ui/2_plan/milestone/create_project_milestone_spec.rb
...wser_ui/2_plan/milestone/create_project_milestone_spec.rb
+41
-0
qa/qa/specs/features/ee/browser_ui/2_plan/burndown_chart/burndown_chart_spec.rb
...e/browser_ui/2_plan/burndown_chart/burndown_chart_spec.rb
+1
-1
qa/qa/specs/features/ee/browser_ui/2_plan/issues_weight/issue_weight_visualization_spec.rb
...i/2_plan/issues_weight/issue_weight_visualization_spec.rb
+1
-1
qa/qa/support/dates.rb
qa/qa/support/dates.rb
+5
-0
No files found.
app/views/projects/milestones/_form.html.haml
View file @
cf7d23a6
...
...
@@ -7,13 +7,13 @@
.col-form-label.col-sm-2
=
f
.
label
:title
,
_
(
'Title'
)
.col-sm-10
=
f
.
text_field
:title
,
maxlength:
255
,
class:
'
qa-milestone-title form-control'
,
required:
true
,
autofocus:
true
=
f
.
text_field
:title
,
maxlength:
255
,
class:
'
form-control'
,
data:
{
qa_selector:
'milestone_title_field'
}
,
required:
true
,
autofocus:
true
.form-group.row.milestone-description
.col-form-label.col-sm-2
=
f
.
label
:description
,
_
(
'Description'
)
.col-sm-10
=
render
layout:
'shared/md_preview'
,
locals:
{
url:
preview_markdown_path
(
@project
)
}
do
=
render
'shared/zen'
,
f:
f
,
attr: :description
,
classes:
'
qa-milestone-description note-textarea
'
,
placeholder:
_
(
'Write milestone description...'
)
=
render
'shared/zen'
,
f:
f
,
attr: :description
,
classes:
'
note-textarea'
,
qa_selector:
'milestone_description_field
'
,
placeholder:
_
(
'Write milestone description...'
)
=
render
'shared/notes/hints'
.clearfix
.error-alert
...
...
@@ -21,7 +21,7 @@
.form-actions
-
if
@milestone
.
new_record?
=
f
.
submit
_
(
'Create milestone'
),
class:
'btn-success btn
qa-milestone-create-button'
=
f
.
submit
_
(
'Create milestone'
),
class:
'btn-success btn
'
,
data:
{
qa_selector:
'create_milestone_button'
}
=
link_to
_
(
'Cancel'
),
project_milestones_path
(
@project
),
class:
'btn btn-cancel'
-
else
=
f
.
submit
_
(
'Save changes'
),
class:
'btn-success btn'
...
...
app/views/projects/milestones/index.html.haml
View file @
cf7d23a6
...
...
@@ -7,7 +7,7 @@
=
render
'shared/milestones/search_form'
=
render
'shared/milestones_sort_dropdown'
-
if
can?
(
current_user
,
:admin_milestone
,
@project
)
=
link_to
new_project_milestone_path
(
@project
),
class:
'btn btn-success
qa-new-project-milestone'
,
title:
_
(
'New milestone'
)
do
=
link_to
new_project_milestone_path
(
@project
),
class:
'btn btn-success
'
,
data:
{
qa_selector:
"new_project_milestone_link"
}
,
title:
_
(
'New milestone'
)
do
=
_
(
'New milestone'
)
.milestones
...
...
app/views/shared/milestones/_description.html.haml
View file @
cf7d23a6
.detail-page-description.milestone-detail
%h2
.title
%h2
{
data:
{
qa_selector:
"milestone_title_content"
}
}
.title
=
markdown_field
(
milestone
,
:title
)
-
if
milestone
.
try
(
:description
).
present?
%div
%div
{
data:
{
qa_selector:
"milestone_description_content"
}
}
.description.md
=
markdown_field
(
milestone
,
:description
)
app/views/shared/milestones/_form_dates.html.haml
View file @
cf7d23a6
...
...
@@ -3,11 +3,11 @@
.col-form-label.col-sm-2
=
f
.
label
:start_date
,
_
(
'Start Date'
)
.col-sm-10
=
f
.
text_field
:start_date
,
class:
"datepicker form-control"
,
placeholder:
_
(
'Select start date'
),
autocomplete:
'off'
=
f
.
text_field
:start_date
,
class:
"datepicker form-control"
,
data:
{
qa_selector:
"start_date_field"
},
placeholder:
_
(
'Select start date'
),
autocomplete:
'off'
%a
.inline.float-right.prepend-top-5.js-clear-start-date
{
href:
"#"
}=
_
(
'Clear start date'
)
.form-group.row
.col-form-label.col-sm-2
=
f
.
label
:due_date
,
_
(
'Due Date'
)
.col-sm-10
=
f
.
text_field
:due_date
,
class:
"datepicker form-control"
,
placeholder:
_
(
'Select due date'
),
autocomplete:
'off'
=
f
.
text_field
:due_date
,
class:
"datepicker form-control"
,
data:
{
qa_selector:
"due_date_field"
},
placeholder:
_
(
'Select due date'
),
autocomplete:
'off'
%a
.inline.float-right.prepend-top-5.js-clear-due-date
{
href:
"#"
}=
_
(
'Clear due date'
)
app/views/shared/milestones/_milestone.html.haml
View file @
cf7d23a6
...
...
@@ -6,7 +6,8 @@
.row
.col-sm-6
.gl-mb-2
%strong
=
link_to
truncate
(
milestone
.
title
,
length:
100
),
milestone_path
(
milestone
)
%strong
{
data:
{
qa_selector:
"milestone_link"
,
qa_milestone_title:
milestone
.
title
}
}
=
link_to
truncate
(
milestone
.
title
,
length:
100
),
milestone_path
(
milestone
)
-
if
@group
=
" -
#{
milestone_type
}
"
...
...
app/views/shared/milestones/_sidebar.html.haml
View file @
cf7d23a6
...
...
@@ -24,7 +24,7 @@
-
if
@project
&&
can?
(
current_user
,
:admin_milestone
,
@project
)
=
link_to
s_
(
'MilestoneSidebar|Edit'
),
edit_project_milestone_path
(
@project
,
@milestone
),
class:
'js-sidebar-dropdown-toggle edit-link float-right'
.value
%span
.value-content
%span
.value-content
{
data:
{
qa_selector:
'start_date_content'
}
}
-
if
milestone
.
start_date
%span
.bold
=
milestone
.
start_date
.
to_s
(
:medium
)
-
else
...
...
@@ -60,7 +60,7 @@
-
if
@project
&&
can?
(
current_user
,
:admin_milestone
,
@project
)
=
link_to
s_
(
'MilestoneSidebar|Edit'
),
edit_project_milestone_path
(
@project
,
@milestone
),
class:
'js-sidebar-dropdown-toggle edit-link float-right'
.value.hide-collapsed
%span
.value-content
%span
.value-content
{
data:
{
qa_selector:
'due_date_content'
}
}
-
if
milestone
.
due_date
%span
.bold
=
milestone
.
due_date
.
to_s
(
:medium
)
-
else
...
...
qa/qa.rb
View file @
cf7d23a6
...
...
@@ -320,6 +320,7 @@ module QA
module
Milestone
autoload
:New
,
'qa/page/project/milestone/new'
autoload
:Index
,
'qa/page/project/milestone/index'
autoload
:Show
,
'qa/page/project/milestone/show'
end
module
Operations
...
...
qa/qa/ee/page/project/milestone/show.rb
View file @
cf7d23a6
...
...
@@ -5,17 +5,24 @@ module QA
module
Page
module
Project
module
Milestone
class
Show
<
::
QA
::
Page
::
Base
view
'ee/app/views/shared/milestones/_weight.html.haml'
do
element
:total_issue_weight_value
end
module
Show
extend
QA
::
Page
::
PageConcern
view
'ee/app/assets/javascripts/burndown_chart/components/burn_charts.vue'
do
element
:weight_button
end
def
self
.
prepended
(
base
)
super
base
.
class_eval
do
view
'ee/app/views/shared/milestones/_weight.html.haml'
do
element
:total_issue_weight_value
end
view
'ee/app/assets/javascripts/burndown_chart/components/burn_charts.vue'
do
element
:weight_button
end
view
'ee/app/assets/javascripts/burndown_chart/components/burndown_chart.vue'
do
element
:burndown_chart
view
'ee/app/assets/javascripts/burndown_chart/components/burndown_chart.vue'
do
element
:burndown_chart
end
end
end
def
click_weight_button
...
...
qa/qa/page/project/milestone/index.rb
View file @
cf7d23a6
...
...
@@ -6,11 +6,23 @@ module QA
module
Milestone
class
Index
<
Page
::
Base
view
'app/views/projects/milestones/index.html.haml'
do
element
:new_project_milestone
element
:new_project_milestone
_link
end
def
click_new_milestone
click_element
:new_project_milestone
view
'app/views/shared/milestones/_milestone.html.haml'
do
element
:milestone_link
end
def
click_new_milestone_link
click_element
:new_project_milestone_link
end
def
has_milestone?
(
milestone
)
has_element?
:milestone_link
,
milestone_title:
milestone
.
title
end
def
click_milestone
(
milestone
)
click_element
:milestone_link
,
milestone_title:
milestone
.
title
end
end
end
...
...
qa/qa/page/project/milestone/new.rb
View file @
cf7d23a6
...
...
@@ -6,21 +6,34 @@ module QA
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
element
:create_milestone_button
element
:milestone_description_field
element
:milestone_title_field
end
view
'app/views/shared/milestones/_form_dates.html.haml'
do
element
:due_date_field
element
:start_date_field
end
def
click_create_milestone_button
click_element
:create_milestone_button
end
def
set_title
(
title
)
fill_element
:milestone_title
,
title
fill_element
:milestone_title
_field
,
title
end
def
set_description
(
description
)
fill_element
:milestone_description
,
description
fill_element
:milestone_description_field
,
description
end
def
set_due_date
(
due_date
)
fill_element
:due_date_field
,
due_date
.
to_s
+
"
\n
"
end
def
click_milestone_create_button
click_element
:milestone_create_button
def
set_start_date
(
start_date
)
fill_element
:start_date_field
,
start_date
.
to_s
+
"
\n
"
end
end
end
...
...
qa/qa/page/project/milestone/show.rb
0 → 100644
View file @
cf7d23a6
# frozen_string_literal: true
module
QA
module
Page
module
Project
module
Milestone
class
Show
<
::
QA
::
Page
::
Base
include
Support
::
Dates
view
'app/views/shared/milestones/_description.html.haml'
do
element
:milestone_title_content
,
required:
true
element
:milestone_description_content
end
view
'app/views/shared/milestones/_sidebar.html.haml'
do
element
:due_date_content
element
:start_date_content
end
def
has_due_date?
(
due_date
)
formatted_due_date
=
format_date
(
due_date
)
has_element?
(
:due_date_content
,
text:
formatted_due_date
)
end
def
has_start_date?
(
start_date
)
formatted_start_date
=
format_date
(
start_date
)
has_element?
(
:start_date_content
,
text:
formatted_start_date
)
end
end
end
end
end
end
QA
::
Page
::
Project
::
Milestone
::
Show
.
prepend_if_ee
(
'QA::EE::Page::Project::Milestone::Show'
)
qa/qa/page/project/sub_menus/issues.rb
View file @
cf7d23a6
...
...
@@ -50,6 +50,14 @@ module QA
end
end
def
go_to_milestones
hover_issues
do
within_submenu
do
click_element
(
:milestones_link
)
end
end
end
private
def
hover_issues
...
...
qa/qa/resource/project_milestone.rb
View file @
cf7d23a6
...
...
@@ -7,6 +7,7 @@ module QA
attribute
:id
attribute
:title
attribute
:description
attribute
:project
do
Project
.
fabricate_via_api!
do
|
resource
|
...
...
@@ -16,6 +17,7 @@ module QA
def
initialize
@title
=
"project-milestone-
#{
SecureRandom
.
hex
(
4
)
}
"
@description
=
"My awesome project milestone."
end
def
api_get_path
...
...
@@ -28,12 +30,28 @@ module QA
def
api_post_body
{
title:
title
title:
title
,
description:
description
}.
tap
do
|
hash
|
hash
[
:start_date
]
=
@start_date
if
@start_date
hash
[
:due_date
]
=
@due_date
if
@due_date
end
end
def
fabricate!
project
.
visit!
Page
::
Project
::
Menu
.
perform
(
&
:go_to_milestones
)
Page
::
Project
::
Milestone
::
Index
.
perform
(
&
:click_new_milestone_link
)
Page
::
Project
::
Milestone
::
New
.
perform
do
|
new_milestone
|
new_milestone
.
set_title
(
@title
)
new_milestone
.
set_description
(
@description
)
new_milestone
.
set_start_date
(
@start_date
)
if
@start_date
new_milestone
.
set_due_date
(
@due_date
)
if
@due_date
new_milestone
.
click_create_milestone_button
end
end
end
end
end
qa/qa/specs/features/browser_ui/2_plan/milestone/create_project_milestone_spec.rb
0 → 100644
View file @
cf7d23a6
# frozen_string_literal: true
module
QA
context
'Plan'
do
describe
'Project milestone'
do
include
Support
::
Dates
let
(
:title
)
{
'Project milestone'
}
let
(
:description
)
{
'This issue tests out project milestones.'
}
let
(
:start_date
)
{
current_date_yyyy_mm_dd
}
let
(
:due_date
)
{
next_month_yyyy_mm_dd
}
before
do
Flow
::
Login
.
sign_in
end
it
'creates a project milestone'
do
project_milestone
=
Resource
::
ProjectMilestone
.
fabricate_via_browser_ui!
do
|
milestone
|
milestone
.
title
=
title
milestone
.
description
=
description
milestone
.
start_date
=
start_date
milestone
.
due_date
=
due_date
end
Page
::
Project
::
Menu
.
perform
(
&
:go_to_milestones
)
Page
::
Project
::
Milestone
::
Index
.
perform
do
|
milestone_list
|
expect
(
milestone_list
).
to
have_milestone
(
project_milestone
)
milestone_list
.
click_milestone
(
project_milestone
)
end
Page
::
Project
::
Milestone
::
Show
.
perform
do
|
milestone
|
expect
(
milestone
).
to
have_element
(
:milestone_title_content
,
text:
title
)
expect
(
milestone
).
to
have_element
(
:milestone_description_content
,
text:
description
)
expect
(
milestone
).
to
have_start_date
(
start_date
)
expect
(
milestone
).
to
have_due_date
(
due_date
)
end
end
end
end
end
qa/qa/specs/features/ee/browser_ui/2_plan/burndown_chart/burndown_chart_spec.rb
View file @
cf7d23a6
...
...
@@ -24,7 +24,7 @@ module QA
it
'shows burndown chart on milestone page'
do
milestone
.
visit!
QA
::
EE
::
Page
::
Project
::
Milestone
::
Show
.
perform
do
|
show
|
QA
::
Page
::
Project
::
Milestone
::
Show
.
perform
do
|
show
|
expect
(
show
.
burndown_chart
).
to
be_visible
expect
(
show
.
burndown_chart
).
to
have_content
(
"Open issues"
)
...
...
qa/qa/specs/features/ee/browser_ui/2_plan/issues_weight/issue_weight_visualization_spec.rb
View file @
cf7d23a6
...
...
@@ -31,7 +31,7 @@ module QA
show
.
click_milestone_link
end
QA
::
EE
::
Page
::
Project
::
Milestone
::
Show
.
perform
do
|
show
|
QA
::
Page
::
Project
::
Milestone
::
Show
.
perform
do
|
show
|
expect
(
show
.
total_issue_weight_value
).
to
have_content
(
weight
)
end
...
...
qa/qa/support/dates.rb
View file @
cf7d23a6
...
...
@@ -11,6 +11,11 @@ module QA
current_date
.
next_month
.
strftime
(
"%Y/%m/%d"
)
end
def
format_date
(
date
)
new_date
=
DateTime
.
strptime
(
date
,
"%Y/%m/%d"
)
new_date
.
strftime
(
"%b %-d, %Y"
)
end
private
def
current_date
...
...
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