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
2f6106eb
Commit
2f6106eb
authored
Jan 28, 2021
by
Desiree Chevalier
Committed by
Désirée Chevalier
Jan 29, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add e2e test for custom mr template
parent
a56d6581
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
2 deletions
+51
-2
qa/qa/resource/merge_request.rb
qa/qa/resource/merge_request.rb
+4
-2
qa/qa/specs/features/browser_ui/3_create/merge_request/create_merge_request_via_template_spec.rb
...e/merge_request/create_merge_request_via_template_spec.rb
+47
-0
No files found.
qa/qa/resource/merge_request.rb
View file @
2f6106eb
...
...
@@ -19,7 +19,8 @@ module QA
:file_name
,
:file_content
attr_writer
:no_preparation
,
:wait_for_merge
:wait_for_merge
,
:template
attribute
:merge_when_pipeline_succeeds
attribute
:merge_status
...
...
@@ -73,7 +74,8 @@ module QA
Page
::
Project
::
Show
.
perform
(
&
:new_merge_request
)
Page
::
MergeRequest
::
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
)
unless
@template
new_page
.
choose_milestone
(
@milestone
)
if
@milestone
new_page
.
assign_to_me
if
@assignee
==
'me'
labels
.
each
do
|
label
|
...
...
qa/qa/specs/features/browser_ui/3_create/merge_request/create_merge_request_via_template_spec.rb
0 → 100644
View file @
2f6106eb
# frozen_string_literal: true
module
QA
RSpec
.
describe
'Create'
do
describe
'Merge request custom templates'
do
let
(
:template_name
)
{
'custom_merge_request_template'
}
let
(
:template_content
)
{
'This is a custom merge request template test'
}
let
(
:template_project
)
do
Resource
::
Project
.
fabricate_via_api!
do
|
project
|
project
.
name
=
'custom-mr-template-project'
project
.
initialize_with_readme
=
true
end
end
let
(
:merge_request_title
)
{
'One merge request to rule them all'
}
before
do
Flow
::
Login
.
sign_in
Resource
::
Repository
::
Commit
.
fabricate_via_api!
do
|
commit
|
commit
.
project
=
template_project
commit
.
commit_message
=
'Add custom merge request template'
commit
.
add_files
([
{
file_path:
".gitlab/merge_request_templates/
#{
template_name
}
.md"
,
content:
template_content
}
])
end
end
it
'creates a merge request via custom template'
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1230'
do
Resource
::
MergeRequest
.
fabricate_via_browser_ui!
do
|
merge_request
|
merge_request
.
project
=
template_project
merge_request
.
title
=
merge_request_title
merge_request
.
template
=
template_name
merge_request
.
target_new_branch
=
false
end
Page
::
MergeRequest
::
Show
.
perform
do
|
merge_request
|
expect
(
merge_request
).
to
have_title
(
merge_request_title
)
expect
(
merge_request
).
to
have_description
(
template_content
)
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