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
f29f681e
Commit
f29f681e
authored
Nov 29, 2019
by
Ezekiel Kigbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added feature specs for editing a stage
parent
7e4b8322
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
10 deletions
+41
-10
ee/spec/features/analytics/cycle_analytics/cycle_analytics_spec.rb
...eatures/analytics/cycle_analytics/cycle_analytics_spec.rb
+41
-10
No files found.
ee/spec/features/analytics/cycle_analytics/cycle_analytics_spec.rb
View file @
f29f681e
...
@@ -212,7 +212,23 @@ describe 'Group Cycle Analytics', :js do
...
@@ -212,7 +212,23 @@ describe 'Group Cycle Analytics', :js do
end
end
describe
'Customizable cycle analytics'
,
:js
do
describe
'Customizable cycle analytics'
,
:js
do
custom_stage
=
"Cool beans"
start_event_identifier
=
:merge_request_created
end_event_identifier
=
:merge_request_merged
let
(
:button_class
)
{
'.js-add-stage-button'
}
let
(
:button_class
)
{
'.js-add-stage-button'
}
let
(
:params
)
{
{
name:
custom_stage
,
start_event_identifier:
start_event_identifier
,
end_event_identifier:
end_event_identifier
}
}
let
(
:first_default_stage
)
{
page
.
find
(
'.stage-nav-item-cell'
,
text:
"Issue"
).
ancestor
(
".stage-nav-item"
)
}
let
(
:first_custom_stage
)
{
page
.
find
(
'.stage-nav-item-cell'
,
text:
custom_stage
).
ancestor
(
".stage-nav-item"
)
}
def
create_custom_stage
Analytics
::
CycleAnalytics
::
Stages
::
CreateService
.
new
(
parent:
group
,
params:
params
,
current_user:
user
).
execute
end
def
toggle_more_options
(
stage
)
stage
.
hover
stage
.
find
(
".more-actions-toggle"
).
click
end
def
select_dropdown_option
(
name
,
elem
=
"option"
,
index
=
1
)
def
select_dropdown_option
(
name
,
elem
=
"option"
,
index
=
1
)
page
.
find
(
"select[name='
#{
name
}
']"
).
all
(
elem
)[
index
].
select_option
page
.
find
(
"select[name='
#{
name
}
']"
).
all
(
elem
)[
index
].
select_option
...
@@ -317,22 +333,37 @@ describe 'Group Cycle Analytics', :js do
...
@@ -317,22 +333,37 @@ describe 'Group Cycle Analytics', :js do
end
end
end
end
context
'Stage table'
do
context
'Edit stage form'
do
custom_stage
=
"Cool beans"
stage_form_class
=
'.custom-stage-form'
let
(
:params
)
{
{
name:
custom_stage
,
start_event_identifier: :merge_request_created
,
end_event_identifier: :merge_request_merged
}
}
stage_save_button
=
'.js-save-stage'
let
(
:first_default_stage
)
{
page
.
find
(
'.stage-nav-item-cell'
,
text:
"Issue"
).
ancestor
(
".stage-nav-item"
)
}
name_field
=
"custom-stage-name"
let
(
:first_custom_stage
)
{
page
.
find
(
'.stage-nav-item-cell'
,
text:
custom_stage
).
ancestor
(
".stage-nav-item"
)
}
start_event_field
=
"custom-stage-start-event"
end_event_field
=
"custom-stage-end-event"
before
do
create_custom_stage
select_group
def
create_custom_stage
expect
(
page
).
to
have_text
custom_stage
Analytics
::
CycleAnalytics
::
Stages
::
CreateService
.
new
(
parent:
group
,
params:
params
,
current_user:
user
).
execute
toggle_more_options
(
first_custom_stage
)
click_button
"Edit stage"
end
end
def
toggle_more_options
(
stage
)
it
'prepoulates the stage data'
do
stage
.
hover
expect
(
page
.
find
(
stage_form_class
)).
to
have_text
'Editing stage'
stage
.
find
(
".more-actions-toggle"
).
click
expect
(
page
.
find_field
(
name_field
).
value
).
to
eq
custom_stage
expect
(
page
.
find_field
(
start_event_field
).
value
).
to
eq
start_event_identifier
expect
(
page
.
find_field
(
end_event_field
).
value
).
to
eq
end_event_identifier
end
end
it
'disables the submit form if there are no changes'
do
expect
(
page
.
find
(
stage_save_button
)[
:disabled
]).
to
eq
"true"
end
end
context
'Stage table'
do
context
'default stages'
do
context
'default stages'
do
before
do
before
do
select_group
select_group
...
...
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