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
6e713077
Commit
6e713077
authored
Jan 22, 2021
by
Desiree Chevalier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add default issue template e2e test
Adds an e2e test for default issue templates
parent
c77acf7f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
74 additions
and
3 deletions
+74
-3
ee/app/views/projects/settings/_default_issue_template.html.haml
...views/projects/settings/_default_issue_template.html.haml
+3
-3
qa/qa/ee.rb
qa/qa/ee.rb
+1
-0
qa/qa/ee/page/project/settings/issue_template_default.rb
qa/qa/ee/page/project/settings/issue_template_default.rb
+25
-0
qa/qa/ee/page/project/settings/main.rb
qa/qa/ee/page/project/settings/main.rb
+10
-0
qa/qa/specs/features/ee/browser_ui/2_plan/issue/default_issue_template_spec.rb
...ee/browser_ui/2_plan/issue/default_issue_template_spec.rb
+35
-0
No files found.
ee/app/views/projects/settings/_default_issue_template.html.haml
View file @
6e713077
-
if
@project
.
feature_available?
(
:issuable_default_templates
)
-
expanded
=
expanded_by_default?
%section
.settings.issues-feature.no-animate
#js-issue-settings
{
class:
[(
'expanded'
if
expanded
),
(
'hidden'
if
@project
.
project_feature
.
send
(
:issues_access_level
)
==
0
)]
}
%section
.settings.issues-feature.no-animate
#js-issue-settings
{
class:
[(
'expanded'
if
expanded
),
(
'hidden'
if
@project
.
project_feature
.
send
(
:issues_access_level
)
==
0
)]
,
data:
{
qa_selector:
'issue_template_settings_content'
}
}
.settings-header
%h4
.settings-title.js-settings-toggle.js-settings-toggle-trigger-only
=
_
(
'Default description template for issues'
)
%button
.gl-button.btn.btn-default.js-settings-toggle
{
type:
'button'
}=
expanded
?
_
(
'Collapse'
)
:
_
(
'Expand'
)
...
...
@@ -12,8 +12,8 @@
%input
{
type:
'hidden'
,
name:
'update_section'
,
value:
'js-issue-settings'
}
.row
.form-group.col-md-9
=
f
.
text_area
:issues_template
,
class:
"form-control"
,
rows:
3
,
aria:
{
labelledby:
'issue-settings-default-template-label'
}
=
f
.
text_area
:issues_template
,
class:
"form-control"
,
rows:
3
,
aria:
{
labelledby:
'issue-settings-default-template-label'
}
,
data:
{
qa_selector:
'issue_template_field'
}
.text-secondary
-
link_start
=
'<a href="%{url}" target="_blank" rel="noopener noreferrer">'
.
html_safe
%
{
url:
help_page_path
(
'user/markdown'
)
}
=
_
(
'Description parsed with %{link_start}GitLab Flavored Markdown%{link_end}.'
).
html_safe
%
{
link_start:
link_start
,
link_end:
'</a>'
.
html_safe
}
=
f
.
submit
_
(
'Save changes'
),
class:
"gl-button btn btn-success"
=
f
.
submit
_
(
'Save changes'
),
class:
"gl-button btn btn-success"
,
data:
{
qa_selector:
'save_issue_template_button'
}
qa/qa/ee.rb
View file @
6e713077
...
...
@@ -141,6 +141,7 @@ module QA
autoload
:Repository
,
'qa/ee/page/project/settings/repository'
autoload
:PushRules
,
'qa/ee/page/project/settings/push_rules'
autoload
:LicenseCompliance
,
'qa/ee/page/project/settings/license_compliance'
autoload
:IssueTemplateDefault
,
'qa/ee/page/project/settings/issue_template_default.rb'
end
module
Operations
...
...
qa/qa/ee/page/project/settings/issue_template_default.rb
0 → 100644
View file @
6e713077
# frozen_string_literal: true
module
QA
module
EE
module
Page
module
Project
module
Settings
class
IssueTemplateDefault
<
QA
::
Page
::
Base
view
'ee/app/views/projects/settings/_default_issue_template.html.haml'
do
element
:issue_template_field
element
:save_issue_template_button
end
def
set_default_issue_template
(
template
)
fill_element
(
:issue_template_field
,
template
)
click_element
(
:save_issue_template_button
)
wait_for_requests
end
end
end
end
end
end
end
qa/qa/ee/page/project/settings/main.rb
View file @
6e713077
...
...
@@ -12,12 +12,22 @@ module QA
super
base
.
class_eval
do
view
'ee/app/views/projects/settings/_default_issue_template.html.haml'
do
element
:issue_template_settings_content
end
view
'ee/app/views/projects/_merge_request_approvals_settings.html.haml'
do
element
:merge_request_approvals_settings
end
end
end
def
expand_default_description_template_for_issues
(
&
block
)
expand_content
(
:issue_template_settings_content
)
do
IssueTemplateDefault
.
perform
(
&
block
)
end
end
def
expand_merge_request_approvals_settings
(
&
block
)
expand_content
(
:merge_request_approvals_settings
)
do
MergeRequestApprovals
.
perform
(
&
block
)
...
...
qa/qa/specs/features/ee/browser_ui/2_plan/issue/default_issue_template_spec.rb
0 → 100644
View file @
6e713077
# frozen_string_literal: true
module
QA
RSpec
.
describe
'Plan'
do
describe
'Default issue templates'
do
let
(
:default_template_project
)
do
Resource
::
Project
.
fabricate_via_api!
do
|
project
|
project
.
name
=
"default-issue-template-project-
#{
SecureRandom
.
hex
(
8
)
}
"
end
end
let
(
:template
)
{
'This is a default issue template'
}
before
do
Flow
::
Login
.
sign_in
end
it
'uses default template when creating an issue'
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1231'
do
default_template_project
.
visit!
Page
::
Project
::
Menu
.
perform
(
&
:go_to_general_settings
)
Page
::
Project
::
Settings
::
Main
.
perform
(
&
:expand_default_description_template_for_issues
)
EE
::
Page
::
Project
::
Settings
::
IssueTemplateDefault
.
perform
do
|
issue_settings
|
issue_settings
.
set_default_issue_template
(
template
)
end
Resource
::
Issue
.
fabricate_via_api!
do
|
issue
|
issue
.
project
=
default_template_project
end
.
visit!
expect
(
page
).
to
have_content
(
template
)
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