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
1304ef05
Commit
1304ef05
authored
Jun 02, 2021
by
Ezekiel Kigbo
Committed by
charlie ablett
Jun 02, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update vsa navigation specs for the horizontal flow
parent
c6e57e5a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
103 additions
and
25 deletions
+103
-25
ee/spec/features/groups/analytics/cycle_analytics/multiple_value_streams_spec.rb
.../analytics/cycle_analytics/multiple_value_streams_spec.rb
+98
-25
spec/support/helpers/cycle_analytics_helpers.rb
spec/support/helpers/cycle_analytics_helpers.rb
+5
-0
No files found.
ee/spec/features/groups/analytics/cycle_analytics/multiple_value_streams_spec.rb
View file @
1304ef05
...
...
@@ -6,6 +6,7 @@ RSpec.describe 'Multiple value streams', :js do
let_it_be
(
:group
)
{
create
(
:group
,
name:
'CA-test-group'
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
,
namespace:
group
,
group:
group
,
name:
'Cool fun project'
)
}
let_it_be
(
:sub_group
)
{
create
(
:group
,
name:
'CA-sub-group'
,
parent:
group
)
}
let_it_be
(
:user
)
do
create
(
:user
).
tap
do
|
u
|
group
.
add_owner
(
u
)
...
...
@@ -14,7 +15,6 @@ RSpec.describe 'Multiple value streams', :js do
end
let
(
:extended_form_fields_selector
)
{
'[data-testid="extended-form-fields"]'
}
let
(
:custom_value_stream_name
)
{
"New created value stream"
}
let!
(
:default_value_stream
)
{
create
(
:cycle_analytics_group_value_stream
,
group:
group
,
name:
'default'
)
}
3
.
times
do
|
i
|
...
...
@@ -34,10 +34,16 @@ RSpec.describe 'Multiple value streams', :js do
wait_for_requests
end
describe
'Create value stream'
do
before
do
select_group
(
group
)
def
path_nav_elem
page
.
find
(
'[data-testid="gl-path-nav"]'
)
end
def
click_action_button
(
action
,
index
)
page
.
find
(
"[data-testid='stage-action-
#{
action
}
-
#{
index
}
']"
).
click
end
shared_examples
'create a value stream'
do
|
custom_value_stream_name
|
before
do
toggle_value_stream_dropdown
page
.
find_button
(
_
(
'Create new Value Stream'
)).
click
end
...
...
@@ -56,52 +62,95 @@ RSpec.describe 'Multiple value streams', :js do
add_custom_stage_to_form
# Hide some default stages
page
.
find
(
"[data-testid='stage-action-hide-5']"
).
click
page
.
find
(
"[data-testid='stage-action-hide-3']"
).
click
page
.
find
(
"[data-testid='stage-action-hide-1']"
).
click
click_action_button
(
'hide'
,
5
)
click_action_button
(
'hide'
,
3
)
click_action_button
(
'hide'
,
1
)
save_value_stream
(
custom_value_stream_name
)
expect
(
page
).
to
have_text
(
_
(
"'%{name}' Value Stream created"
)
%
{
name:
custom_value_stream_name
})
expect
(
pa
ge
.
find
(
'[data-testid="gl-path-nav"]'
)
).
to
have_text
(
"Cool custom stage - name"
)
expect
(
pa
th_nav_elem
).
to
have_text
(
"Cool custom stage - name"
)
end
end
describe
'Edit value stream'
do
shared_examples
'update a value stream'
do
|
custom_value_stream_name
|
before
do
select_group
(
group
)
create_custom_value_stream
(
custom_value_stream_name
)
page
.
find_button
(
_
(
'Edit'
)).
click
end
it
'includes additional form fields'
do
expect
(
page
).
to
have_selector
(
extended_form_fields_selector
)
expect
(
page
).
to
have_button
(
"Save Value Stream"
)
end
it
'can reorder stages'
do
expect
(
path_nav_stage_names_without_median
).
to
eq
([
"Overview"
,
"Issue"
,
"Plan"
,
"Code"
,
"Test"
,
"Review"
,
"Staging"
,
"Cool custom stage - name 7"
])
it
'can update the value stream name'
do
edited_name
=
"Edit new value stream"
fill_in
'create-value-stream-name'
,
with:
edited_name
page
.
find_button
(
_
(
'Edit'
)).
click
# Re-arrange a few stages
page
.
all
(
"[data-testid*='stage-action-move-down-']"
).
first
.
click
page
.
all
(
"[data-testid*='stage-action-move-up-']"
).
last
.
click
page
.
find_button
(
_
(
'Save Value Stream'
)).
click
wait_for_requests
expect
(
pa
ge
).
to
have_text
(
_
(
"'%{name}' Value Stream saved"
)
%
{
name:
edited_name
}
)
expect
(
pa
th_nav_stage_names_without_median
).
to
eq
([
"Overview"
,
"Plan"
,
"Issue"
,
"Code"
,
"Test"
,
"Review"
,
"Cool custom stage - name 7"
,
"Staging"
]
)
end
it
'can add a custom stage'
do
add_custom_stage_to_form
context
'updating'
do
before
do
page
.
find_button
(
_
(
'Edit'
)).
click
end
page
.
find_button
(
_
(
'Save Value Stream'
)).
click
wait_for_requests
it
'includes additional form fields'
do
expect
(
page
).
to
have_selector
(
extended_form_fields_selector
)
expect
(
page
).
to
have_button
(
"Save Value Stream"
)
end
it
'can update the value stream name'
do
edited_name
=
"Edit new value stream"
fill_in
'create-value-stream-name'
,
with:
edited_name
page
.
find_button
(
_
(
'Save Value Stream'
)).
click
wait_for_requests
expect
(
page
).
to
have_text
(
_
(
"'%{name}' Value Stream saved"
)
%
{
name:
edited_name
})
end
it
'can add and remove custom stages'
do
add_custom_stage_to_form
page
.
find_button
(
_
(
'Save Value Stream'
)).
click
wait_for_requests
expect
(
page
).
to
have_text
(
_
(
"'%{name}' Value Stream saved"
)
%
{
name:
custom_value_stream_name
})
expect
(
path_nav_elem
).
to
have_text
(
"Cool custom stage - name"
)
page
.
find_button
(
_
(
'Edit'
)).
click
# Delete the custom stages, delete the last one first since the list gets reordered after a deletion
click_action_button
(
'remove'
,
7
)
click_action_button
(
'remove'
,
6
)
page
.
find_button
(
_
(
'Save Value Stream'
)).
click
wait_for_requests
expect
(
path_nav_elem
).
not_to
have_text
(
"Cool custom stage - name"
)
end
it
'can hide default stages'
do
click_action_button
(
'hide'
,
5
)
click_action_button
(
'hide'
,
4
)
click_action_button
(
'hide'
,
3
)
page
.
find_button
(
_
(
'Save Value Stream'
)).
click
wait_for_requests
expect
(
page
).
to
have_text
(
_
(
"'%{name}' Value Stream saved"
)
%
{
name:
custom_value_stream_name
})
expect
(
path_nav_elem
).
not_to
have_text
(
"Staging"
)
expect
(
path_nav_elem
).
not_to
have_text
(
"Review"
)
expect
(
path_nav_elem
).
not_to
have_text
(
"Test"
)
end
end
end
describe
'Delete value stream'
do
shared_examples
'delete a value stream'
do
|
custom_value_stream_name
|
before
do
value_stream
=
create
(
:cycle_analytics_group_value_stream
,
name:
custom_value_stream_name
,
group:
group
)
create
(
:cycle_analytics_group_stage
,
value_stream:
value_stream
)
...
...
@@ -121,4 +170,28 @@ RSpec.describe 'Multiple value streams', :js do
expect
(
page
).
to
have_text
(
_
(
"'%{name}' Value Stream deleted"
)
%
{
name:
custom_value_stream_name
})
end
end
describe
'With a group'
do
name
=
'group value stream'
before
do
select_group
(
group
)
end
it_behaves_like
'create a value stream'
,
name
it_behaves_like
'update a value stream'
,
name
it_behaves_like
'delete a value stream'
,
name
end
describe
'With a sub group'
do
name
=
'sub group value stream'
before
do
select_group
(
sub_group
)
end
it_behaves_like
'create a value stream'
,
name
it_behaves_like
'update a value stream'
,
name
it_behaves_like
'delete a value stream'
,
name
end
end
spec/support/helpers/cycle_analytics_helpers.rb
View file @
1304ef05
...
...
@@ -7,6 +7,11 @@ module CycleAnalyticsHelpers
page
.
find
(
'[data-testid="dropdown-value-streams"]'
).
click
end
def
path_nav_stage_names_without_median
# Returns the path names with the median value stripped out
page
.
all
(
'.gl-path-button'
).
collect
(
&
:text
).
map
{
|
name_with_median
|
name_with_median
.
split
(
"
\n
"
)[
0
]
}
end
def
add_custom_stage_to_form
page
.
find_button
(
s_
(
'CreateValueStreamForm|Add another stage'
)).
click
...
...
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