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
de2d7f35
Commit
de2d7f35
authored
Jun 24, 2020
by
Désirée Chevalier
Committed by
Sanad Liaquat
Jun 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add assign project milestone spec
Adds a new e2e spec for assigning project milestones
parent
e968773f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
88 additions
and
6 deletions
+88
-6
app/views/shared/issuable/_sidebar.html.haml
app/views/shared/issuable/_sidebar.html.haml
+2
-2
qa/qa/page/component/issuable/sidebar.rb
qa/qa/page/component/issuable/sidebar.rb
+27
-4
qa/qa/resource/issue.rb
qa/qa/resource/issue.rb
+1
-0
qa/qa/specs/features/browser_ui/2_plan/milestone/assign_project_milestone_spec.rb
...wser_ui/2_plan/milestone/assign_project_milestone_spec.rb
+58
-0
No files found.
app/views/shared/issuable/_sidebar.html.haml
View file @
de2d7f35
...
...
@@ -42,7 +42,7 @@
=
_
(
'Milestone'
)
=
icon
(
'spinner spin'
,
class:
'hidden block-loading'
,
'aria-hidden'
:
'true'
)
-
if
can_edit_issuable
=
link_to
_
(
'Edit'
),
'#'
,
class:
'js-sidebar-dropdown-toggle edit-link float-right'
,
data:
{
track_label:
"right_sidebar"
,
track_property:
"milestone"
,
track_event:
"click_edit_button"
,
track_value:
""
}
=
link_to
_
(
'Edit'
),
'#'
,
class:
'js-sidebar-dropdown-toggle edit-link float-right'
,
data:
{
qa_selector:
"edit_milestone_link"
,
track_label:
"right_sidebar"
,
track_property:
"milestone"
,
track_event:
"click_edit_button"
,
track_value:
""
}
.value.hide-collapsed
-
if
milestone
.
present?
=
link_to
milestone
[
:title
],
milestone
[
:web_url
],
class:
"bold has-tooltip"
,
title:
sidebar_milestone_remaining_days
(
milestone
),
data:
{
container:
"body"
,
html:
'true'
,
boundary:
'viewport'
,
qa_selector:
'milestone_link'
,
qa_title:
milestone
[
:title
]
}
...
...
@@ -107,7 +107,7 @@
=
_
(
'Labels'
)
=
icon
(
'spinner spin'
,
class:
'hidden block-loading'
,
'aria-hidden'
:
'true'
)
-
if
can_edit_issuable
=
link_to
_
(
'Edit'
),
'#'
,
class:
'js-sidebar-dropdown-toggle edit-link
qa-edit-link-labels float-right'
,
data:
{
track_label:
"right_sidebar"
,
track_property:
"labels"
,
track_event:
"click_edit_button"
,
track_value:
""
}
=
link_to
_
(
'Edit'
),
'#'
,
class:
'js-sidebar-dropdown-toggle edit-link
float-right'
,
data:
{
qa_selector:
"edit_labels_link"
,
track_label:
"right_sidebar"
,
track_property:
"labels"
,
track_event:
"click_edit_button"
,
track_value:
""
}
.value.issuable-show-labels.dont-hide.hide-collapsed
{
class:
(
"has-labels"
if
selected_labels
.
any?
),
data:
{
qa_selector:
'labels_block'
}
}
-
if
selected_labels
.
any?
-
selected_labels
.
each
do
|
label_hash
|
...
...
qa/qa/page/component/issuable/sidebar.rb
View file @
de2d7f35
...
...
@@ -25,13 +25,27 @@ module QA
base
.
view
'app/views/shared/issuable/_sidebar.html.haml'
do
element
:assignee_block
element
:dropdown_menu_labels
element
:edit_link_labels
element
:edit_labels_link
element
:edit_milestone_link
element
:labels_block
element
:milestone_block
element
:milestone_link
end
end
def
assign_milestone
(
milestone
)
click_element
(
:edit_milestone_link
)
within_element
(
:milestone_block
)
do
click_link
(
"
#{
milestone
.
title
}
"
)
end
wait_until
(
reload:
false
)
do
has_element?
(
:milestone_block
,
text:
milestone
.
title
,
wait:
0
)
end
refresh
end
def
click_milestone_link
click_element
(
:milestone_link
)
end
...
...
@@ -55,7 +69,7 @@ module QA
end
def
has_milestone?
(
milestone_title
)
w
ithin_element
(
:milestone_block
)
do
w
ait_milestone_block_finish_loading
do
has_element?
(
:milestone_link
,
title:
milestone_title
)
end
end
...
...
@@ -66,7 +80,7 @@ module QA
def
select_labels_and_refresh
(
labels
)
Support
::
Retrier
.
retry_until
do
click_element
(
:edit_l
ink_labels
)
click_element
(
:edit_l
abels_link
)
has_element?
(
:dropdown_menu_labels
,
text:
labels
.
first
)
end
...
...
@@ -76,7 +90,7 @@ module QA
end
end
click_element
(
:edit_l
ink_labels
)
click_element
(
:edit_l
abels_link
)
labels
.
each
do
|
label
|
has_element?
(
:labels_block
,
text:
label
,
wait:
0
)
...
...
@@ -103,6 +117,15 @@ module QA
end
end
end
def
wait_milestone_block_finish_loading
within_element
(
:milestone_block
)
do
wait_until
(
reload:
false
,
max_duration:
10
,
sleep_interval:
1
)
do
finished_loading_block?
yield
end
end
end
end
end
end
...
...
qa/qa/resource/issue.rb
View file @
de2d7f35
...
...
@@ -34,6 +34,7 @@ module QA
Page
::
Project
::
Issue
::
New
.
perform
do
|
new_page
|
new_page
.
fill_title
(
@title
)
new_page
.
fill_description
(
@description
)
new_page
.
choose_milestone
(
@milestone
)
if
@milestone
new_page
.
create_new_issue
end
end
...
...
qa/qa/specs/features/browser_ui/2_plan/milestone/assign_project_milestone_spec.rb
0 → 100644
View file @
de2d7f35
# frozen_string_literal: true
module
QA
context
'Plan'
do
describe
'Project milestone'
do
include
Support
::
Dates
let
(
:title
)
{
'Project milestone'
}
let
(
:start_date
)
{
current_date_yyyy_mm_dd
}
let
(
:due_date
)
{
next_month_yyyy_mm_dd
}
let
(
:project
)
do
Resource
::
Project
.
fabricate_via_api!
do
|
project
|
project
.
name
=
'project-to-test-milestones'
end
end
let
(
:issue
)
do
Resource
::
Issue
.
fabricate_via_api!
do
|
issue
|
issue
.
project
=
project
end
end
let
(
:project_milestone
)
do
Resource
::
ProjectMilestone
.
fabricate_via_api!
do
|
milestone
|
milestone
.
project
=
project
milestone
.
start_date
=
start_date
milestone
.
due_date
=
due_date
end
end
before
do
Flow
::
Login
.
sign_in
end
it
'assigns a project milestone to an existing issue'
do
issue
.
visit!
Page
::
Project
::
Issue
::
Show
.
perform
do
|
existing_issue
|
existing_issue
.
assign_milestone
(
project_milestone
)
expect
(
existing_issue
).
to
have_milestone
(
project_milestone
.
title
)
end
end
it
'assigns a project milestone to a new issue'
do
Resource
::
Issue
.
fabricate_via_browser_ui!
do
|
issue
|
issue
.
project
=
project
issue
.
milestone
=
project_milestone
end
Page
::
Project
::
Issue
::
Show
.
perform
do
|
issue
|
expect
(
issue
).
to
have_milestone
(
project_milestone
.
title
)
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