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
337cc118
Commit
337cc118
authored
Jan 21, 2021
by
Desiree Chevalier
Committed by
Désirée Chevalier
Jan 25, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add e2e test for custom issue templates
Adds an e2e test for custom issue templates
parent
41fcdee9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
7 deletions
+55
-7
app/views/shared/issuable/form/_template_selector.html.haml
app/views/shared/issuable/form/_template_selector.html.haml
+1
-1
qa/qa/page/issuable/new.rb
qa/qa/page/issuable/new.rb
+11
-0
qa/qa/resource/issue.rb
qa/qa/resource/issue.rb
+3
-2
qa/qa/specs/features/browser_ui/2_plan/issue/create_issue_spec.rb
...ecs/features/browser_ui/2_plan/issue/create_issue_spec.rb
+40
-4
No files found.
app/views/shared/issuable/form/_template_selector.html.haml
View file @
337cc118
...
...
@@ -3,7 +3,7 @@
-
return
unless
issuable
&&
issuable_templates
(
issuable
).
any?
.issuable-form-select-holder.selectbox.form-group
.js-issuable-selector-wrap
{
data:
{
issuable_type:
issuable
.
to_ability_name
}
}
.js-issuable-selector-wrap
{
data:
{
issuable_type:
issuable
.
to_ability_name
,
qa_selector:
'template_dropdown'
}
}
=
template_dropdown_tag
(
issuable
)
do
%ul
.dropdown-footer-list
%li
...
...
qa/qa/page/issuable/new.rb
View file @
337cc118
...
...
@@ -28,6 +28,10 @@ module QA
element
:assign_to_me_link
end
view
'app/views/shared/issuable/form/_template_selector.html.haml'
do
element
:template_dropdown
end
def
fill_title
(
title
)
fill_element
:issuable_form_title
,
title
end
...
...
@@ -43,6 +47,13 @@ module QA
end
end
def
choose_template
(
template_name
)
click_element
:template_dropdown
within_element
(
:template_dropdown
)
do
click_on
template_name
end
end
def
select_label
(
label
)
click_element
:issuable_label
...
...
qa/qa/resource/issue.rb
View file @
337cc118
...
...
@@ -5,7 +5,7 @@ require 'securerandom'
module
QA
module
Resource
class
Issue
<
Base
attr_writer
:description
,
:milestone
,
:weight
attr_writer
:description
,
:milestone
,
:
template
,
:
weight
attribute
:project
do
Project
.
fabricate!
do
|
resource
|
...
...
@@ -33,7 +33,8 @@ module QA
Page
::
Project
::
Issue
::
New
.
perform
do
|
new_page
|
new_page
.
fill_title
(
@title
)
new_page
.
fill_description
(
@description
)
new_page
.
choose_template
(
@template
)
if
@template
new_page
.
fill_description
(
@description
)
if
@description
new_page
.
choose_milestone
(
@milestone
)
if
@milestone
new_page
.
create_new_issue
end
...
...
qa/qa/specs/features/browser_ui/2_plan/issue/create_issue_spec.rb
View file @
337cc118
# frozen_string_literal: true
module
QA
RSpec
.
describe
'Plan'
,
:smoke
do
RSpec
.
describe
'Plan'
do
describe
'Issue creation'
do
let
(
:closed_issue
)
{
Resource
::
Issue
.
fabricate_via_api!
}
...
...
@@ -9,7 +9,7 @@ module QA
Flow
::
Login
.
sign_in
end
it
'creates an issue'
,
:reliable
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1167'
do
it
'creates an issue'
,
:
smoke
,
:
reliable
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1167'
do
issue
=
Resource
::
Issue
.
fabricate_via_browser_ui!
Page
::
Project
::
Menu
.
perform
(
&
:click_issues
)
...
...
@@ -19,7 +19,7 @@ module QA
end
end
it
'closes an issue'
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1085'
do
it
'closes an issue'
,
:smoke
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1085'
do
closed_issue
.
visit!
Page
::
Project
::
Issue
::
Show
.
perform
do
|
issue_page
|
...
...
@@ -38,7 +38,7 @@ module QA
end
end
context
'when using attachments in comments'
,
:object_storage
do
context
'when using attachments in comments'
,
:
smoke
,
:
object_storage
do
let
(
:gif_file_name
)
{
'banana_sample.gif'
}
let
(
:file_to_attach
)
do
File
.
absolute_path
(
File
.
join
(
'qa'
,
'fixtures'
,
'designs'
,
gif_file_name
))
...
...
@@ -56,6 +56,42 @@ module QA
end
end
end
context
'when using custom issue templates'
do
let
(
:template_name
)
{
'custom_issue_template'
}
let
(
:template_content
)
{
'This is a custom issue template test'
}
let
(
:template_project
)
do
Resource
::
Project
.
fabricate_via_api!
do
|
project
|
project
.
name
=
"custom-issue-template-project-
#{
SecureRandom
.
hex
(
8
)
}
"
project
.
initialize_with_readme
=
true
end
end
before
do
Resource
::
Repository
::
Commit
.
fabricate_via_api!
do
|
commit
|
commit
.
project
=
template_project
commit
.
commit_message
=
'Add custom issue template'
commit
.
add_files
([
{
file_path:
".gitlab/issue_templates/
#{
template_name
}
.md"
,
content:
template_content
}
])
end
end
it
'creates an issue via custom template'
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1229'
do
Resource
::
Issue
.
fabricate_via_browser_ui!
do
|
issue
|
issue
.
project
=
template_project
issue
.
template
=
template_name
end
Page
::
Project
::
Issue
::
Show
.
perform
do
|
issue_page
|
expect
(
issue_page
).
to
have_content
(
template_content
)
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