Commit 767854a4 authored by Andrejs Cunskis's avatar Andrejs Cunskis

Merge branch 'qa-add-testcases-to-shared-example-e2e-specs' into 'master'

Add test case links to e2e shared examples

See merge request gitlab-org/gitlab!79776
parents 9df98212 103e45dc
...@@ -21,8 +21,8 @@ module QA ...@@ -21,8 +21,8 @@ module QA
let(:tag_message) { 'Version 0.0.1' } let(:tag_message) { 'Version 0.0.1' }
let(:tag_release_notes) { 'Release It!' } let(:tag_release_notes) { 'Release It!' }
shared_examples 'successful tag creation' do |user| shared_examples 'successful tag creation' do |user, testcase|
it "can be created by #{user}" do it "can be created by #{user}", testcase: testcase do
Flow::Login.sign_in(as: send(user)) Flow::Login.sign_in(as: send(user))
create_tag_for_project(project, tag_name, tag_message, tag_release_notes) create_tag_for_project(project, tag_name, tag_message, tag_release_notes)
...@@ -36,8 +36,8 @@ module QA ...@@ -36,8 +36,8 @@ module QA
end end
end end
shared_examples 'unsuccessful tag creation' do |user| shared_examples 'unsuccessful tag creation' do |user, testcase|
it "cannot be created by an unauthorized #{user}" do it "cannot be created by an unauthorized #{user}", testcase: testcase do
Flow::Login.sign_in(as: send(user)) Flow::Login.sign_in(as: send(user))
create_tag_for_project(project, tag_name, tag_message, tag_release_notes) create_tag_for_project(project, tag_name, tag_message, tag_release_notes)
...@@ -54,8 +54,8 @@ module QA ...@@ -54,8 +54,8 @@ module QA
add_members_to_project(project) add_members_to_project(project)
end end
it_behaves_like 'successful tag creation', :developer_user it_behaves_like 'successful tag creation', :developer_user, 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347930'
it_behaves_like 'successful tag creation', :maintainer_user it_behaves_like 'successful tag creation', :maintainer_user, 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347929'
end end
context 'when protected' do context 'when protected' do
...@@ -69,8 +69,8 @@ module QA ...@@ -69,8 +69,8 @@ module QA
Page::Main::Menu.perform(&:sign_out) Page::Main::Menu.perform(&:sign_out)
end end
it_behaves_like 'unsuccessful tag creation', :developer_user it_behaves_like 'unsuccessful tag creation', :developer_user, 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347927'
it_behaves_like 'successful tag creation', :maintainer_user it_behaves_like 'successful tag creation', :maintainer_user, 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347928'
end end
def create_tag_for_project(project, name, message, release_notes) def create_tag_for_project(project, name, message, release_notes)
......
...@@ -31,8 +31,8 @@ module QA ...@@ -31,8 +31,8 @@ module QA
Flow::Login.sign_in Flow::Login.sign_in
end end
shared_examples 'milestone assigned to existing issue' do shared_examples 'milestone assigned to existing issue' do |testcase|
it 'is assigned to an existing issue' do it 'is assigned to an existing issue', testcase: testcase do
issue.visit! issue.visit!
Page::Project::Issue::Show.perform do |existing_issue| Page::Project::Issue::Show.perform do |existing_issue|
...@@ -43,8 +43,8 @@ module QA ...@@ -43,8 +43,8 @@ module QA
end end
end end
shared_examples 'milestone assigned to new issue' do shared_examples 'milestone assigned to new issue' do |testcase|
it 'is assigned to a new issue' do it 'is assigned to a new issue', testcase: testcase do
Resource::Issue.fabricate_via_browser_ui! do |new_issue| Resource::Issue.fabricate_via_browser_ui! do |new_issue|
new_issue.project = project new_issue.project = project
new_issue.milestone = milestone new_issue.milestone = milestone
...@@ -65,8 +65,8 @@ module QA ...@@ -65,8 +65,8 @@ module QA
end end
end end
it_behaves_like 'milestone assigned to existing issue' it_behaves_like 'milestone assigned to existing issue', 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347964'
it_behaves_like 'milestone assigned to new issue' it_behaves_like 'milestone assigned to new issue', 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347965'
end end
context 'Project milestone' do context 'Project milestone' do
...@@ -78,8 +78,8 @@ module QA ...@@ -78,8 +78,8 @@ module QA
end end
end end
it_behaves_like 'milestone assigned to existing issue' it_behaves_like 'milestone assigned to existing issue', 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347962'
it_behaves_like 'milestone assigned to new issue' it_behaves_like 'milestone assigned to new issue', 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347963'
end end
end end
end end
......
...@@ -18,30 +18,34 @@ module QA ...@@ -18,30 +18,34 @@ module QA
file_name: '.gitignore', file_name: '.gitignore',
name: 'Android', name: 'Android',
api_path: 'gitignores', api_path: 'gitignores',
api_key: 'Android' api_key: 'Android',
testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347659'
}, },
{ {
file_name: '.gitlab-ci.yml', file_name: '.gitlab-ci.yml',
name: 'Julia', name: 'Julia',
api_path: 'gitlab_ci_ymls', api_path: 'gitlab_ci_ymls',
api_key: 'Julia' api_key: 'Julia',
testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347658'
}, },
{ {
file_name: 'Dockerfile', file_name: 'Dockerfile',
name: 'Python', name: 'Python',
api_path: 'dockerfiles', api_path: 'dockerfiles',
api_key: 'Python' api_key: 'Python',
testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347660'
}, },
{ {
file_name: 'LICENSE', file_name: 'LICENSE',
name: 'Mozilla Public License 2.0', name: 'Mozilla Public License 2.0',
api_path: 'licenses', api_path: 'licenses',
api_key: 'mpl-2.0' api_key: 'mpl-2.0',
testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347657'
} }
] ]
templates.each do |template| templates.each do |template|
it "user adds #{template[:file_name]} via file template #{template[:name]}" do it "user adds #{template[:file_name]} via file template #{template[:name]}", testcase: template[:testcase] do
content = fetch_template_from_api(template[:api_path], template[:api_key]) content = fetch_template_from_api(template[:api_path], template[:api_key])
Flow::Login.sign_in Flow::Login.sign_in
......
...@@ -28,8 +28,8 @@ module QA ...@@ -28,8 +28,8 @@ module QA
project_snippet&.remove_via_api! project_snippet&.remove_via_api!
end end
shared_examples 'comments on snippets' do |snippet_type| shared_examples 'comments on snippets' do |snippet_type, testcase|
it "adds, edits, and deletes a comment on a #{snippet_type}" do it "adds, edits, and deletes a comment on a #{snippet_type}", testcase: testcase do
send(snippet_type) send(snippet_type)
Page::Main::Menu.perform(&:sign_out) Page::Main::Menu.perform(&:sign_out)
...@@ -49,8 +49,8 @@ module QA ...@@ -49,8 +49,8 @@ module QA
end end
end end
it_behaves_like 'comments on snippets', :personal_snippet it_behaves_like 'comments on snippets', :personal_snippet, 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347816'
it_behaves_like 'comments on snippets', :project_snippet it_behaves_like 'comments on snippets', :project_snippet, 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347817'
def create_comment def create_comment
Page::Dashboard::Snippet::Show.perform do |snippet| Page::Dashboard::Snippet::Show.perform do |snippet|
......
...@@ -28,8 +28,8 @@ module QA ...@@ -28,8 +28,8 @@ module QA
project_snippet&.remove_via_api! project_snippet&.remove_via_api!
end end
shared_examples 'adding file to snippet' do |snippet_type| shared_examples 'adding file to snippet' do |snippet_type, testcase|
it "adds second file to an existing #{snippet_type} to make it multi-file" do it "adds second file to an existing #{snippet_type} to make it multi-file", testcase: testcase do
send(snippet_type).visit! send(snippet_type).visit!
Page::Dashboard::Snippet::Show.perform(&:click_edit_button) Page::Dashboard::Snippet::Show.perform(&:click_edit_button)
...@@ -52,8 +52,8 @@ module QA ...@@ -52,8 +52,8 @@ module QA
end end
end end
it_behaves_like 'adding file to snippet', :personal_snippet it_behaves_like 'adding file to snippet', :personal_snippet, 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347845'
it_behaves_like 'adding file to snippet', :project_snippet it_behaves_like 'adding file to snippet', :project_snippet, 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347846'
end end
end end
end end
...@@ -59,8 +59,8 @@ module QA ...@@ -59,8 +59,8 @@ module QA
project_snippet&.remove_via_api! project_snippet&.remove_via_api!
end end
shared_examples 'copying snippet file contents' do |snippet_type| shared_examples 'copying snippet file contents' do |snippet_type, testcase|
it "copies file contents of a multi-file #{snippet_type} to a comment and verifies them" do it "copies file contents of a multi-file #{snippet_type} to a comment and verifies them", testcase: testcase do
send(snippet_type).visit! send(snippet_type).visit!
files.each do |files| files.each do |files|
...@@ -73,8 +73,8 @@ module QA ...@@ -73,8 +73,8 @@ module QA
end end
end end
it_behaves_like 'copying snippet file contents', :personal_snippet it_behaves_like 'copying snippet file contents', :personal_snippet, 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347849'
it_behaves_like 'copying snippet file contents', :project_snippet it_behaves_like 'copying snippet file contents', :project_snippet, 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347848'
end end
end end
end end
...@@ -36,8 +36,8 @@ module QA ...@@ -36,8 +36,8 @@ module QA
project_snippet&.remove_via_api! project_snippet&.remove_via_api!
end end
shared_examples 'deleting file from snippet' do |snippet_type| shared_examples 'deleting file from snippet' do |snippet_type, testcase|
it "deletes second file from an existing #{snippet_type} to make it single-file" do it "deletes second file from an existing #{snippet_type} to make it single-file", testcase: testcase do
send(snippet_type).visit! send(snippet_type).visit!
Page::Dashboard::Snippet::Show.perform(&:click_edit_button) Page::Dashboard::Snippet::Show.perform(&:click_edit_button)
...@@ -58,8 +58,8 @@ module QA ...@@ -58,8 +58,8 @@ module QA
end end
end end
it_behaves_like 'deleting file from snippet', :personal_snippet it_behaves_like 'deleting file from snippet', :personal_snippet, 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347728'
it_behaves_like 'deleting file from snippet', :project_snippet it_behaves_like 'deleting file from snippet', :project_snippet, 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347727'
end end
end end
end end
...@@ -56,8 +56,8 @@ module QA ...@@ -56,8 +56,8 @@ module QA
project_snippet_with_multiple_files.remove_via_api! project_snippet_with_multiple_files.remove_via_api!
end end
shared_examples 'displaying details on index page' do |snippet_type| shared_examples 'displaying details on index page' do |snippet_type, testcase|
it "shows correct details of #{snippet_type} including file number" do it "shows correct details of #{snippet_type} including file number", testcase: testcase do
send(snippet_type) send(snippet_type)
Page::Main::Menu.perform do |menu| Page::Main::Menu.perform do |menu|
menu.go_to_menu_dropdown_option(:snippets_link) menu.go_to_menu_dropdown_option(:snippets_link)
...@@ -73,10 +73,10 @@ module QA ...@@ -73,10 +73,10 @@ module QA
end end
end end
it_behaves_like 'displaying details on index page', :personal_snippet_with_single_file it_behaves_like 'displaying details on index page', :personal_snippet_with_single_file, 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347717'
it_behaves_like 'displaying details on index page', :personal_snippet_with_multiple_files it_behaves_like 'displaying details on index page', :personal_snippet_with_multiple_files, 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347720'
it_behaves_like 'displaying details on index page', :project_snippet_with_single_file it_behaves_like 'displaying details on index page', :project_snippet_with_single_file, 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347718'
it_behaves_like 'displaying details on index page', :project_snippet_with_multiple_files it_behaves_like 'displaying details on index page', :project_snippet_with_multiple_files, 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347719'
end end
end end
end end
...@@ -18,30 +18,34 @@ module QA ...@@ -18,30 +18,34 @@ module QA
file_name: '.gitignore', file_name: '.gitignore',
name: 'Android', name: 'Android',
api_path: 'gitignores', api_path: 'gitignores',
api_key: 'Android' api_key: 'Android',
testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347752'
}, },
{ {
file_name: '.gitlab-ci.yml', file_name: '.gitlab-ci.yml',
name: 'Julia', name: 'Julia',
api_path: 'gitlab_ci_ymls', api_path: 'gitlab_ci_ymls',
api_key: 'Julia' api_key: 'Julia',
testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347753'
}, },
{ {
file_name: 'Dockerfile', file_name: 'Dockerfile',
name: 'Python', name: 'Python',
api_path: 'dockerfiles', api_path: 'dockerfiles',
api_key: 'Python' api_key: 'Python',
testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347750'
}, },
{ {
file_name: 'LICENSE', file_name: 'LICENSE',
name: 'Mozilla Public License 2.0', name: 'Mozilla Public License 2.0',
api_path: 'licenses', api_path: 'licenses',
api_key: 'mpl-2.0' api_key: 'mpl-2.0',
testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347751'
} }
] ]
templates.each do |template| templates.each do |template|
it "user adds #{template[:file_name]} via file template #{template[:name]}" do it "user adds #{template[:file_name]} via file template #{template[:name]}", testcase: template[:testcase] do
content = fetch_template_from_api(template[:api_path], template[:api_key]) content = fetch_template_from_api(template[:api_path], template[:api_key])
Flow::Login.sign_in Flow::Login.sign_in
......
...@@ -33,13 +33,13 @@ module QA ...@@ -33,13 +33,13 @@ module QA
end end
keys = [ keys = [
[Runtime::Key::RSA, 8192], ['https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/348022', Runtime::Key::RSA, 8192],
[Runtime::Key::ECDSA, 521], ['https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/348021', Runtime::Key::ECDSA, 521],
[Runtime::Key::ED25519] ['https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/348020', Runtime::Key::ED25519]
] ]
keys.each do |(key_class, bits)| keys.each do |(testcase, key_class, bits)|
it "user sets up a deploy key with #{key_class}(#{bits}) to clone code using pipelines" do it "user sets up a deploy key with #{key_class}(#{bits}) to clone code using pipelines", testcase: testcase do
key = key_class.new(*bits) key = key_class.new(*bits)
Resource::DeployKey.fabricate_via_browser_ui! do |resource| Resource::DeployKey.fabricate_via_browser_ui! do |resource|
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
module QA module QA
RSpec.describe 'Configure' do RSpec.describe 'Configure' do
describe 'AutoDevOps Templates', only: { subdomain: :staging } do describe 'AutoDevOps Templates', only: { subdomain: :staging } do
using RSpec::Parameterized::TableSyntax
# specify jobs to be disabled in the pipeline. # specify jobs to be disabled in the pipeline.
# CANARY_ENABLED will allow the pipeline to be # CANARY_ENABLED will allow the pipeline to be
# blocked by a manual job, rather than fail # blocked by a manual job, rather than fail
...@@ -17,8 +19,8 @@ module QA ...@@ -17,8 +19,8 @@ module QA
] ]
end end
where(:template) do where(:case_name, :template, :testcase) do
%w[express] 'using express template' | 'express' | 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/348075'
end end
with_them do with_them do
...@@ -45,7 +47,7 @@ module QA ...@@ -45,7 +47,7 @@ module QA
Flow::Login.sign_in Flow::Login.sign_in
end end
it 'works with Auto DevOps' do it 'works with Auto DevOps', testcase: params[:testcase] do
%w[build code_quality test].each do |job| %w[build code_quality test].each do |job|
pipeline.visit! pipeline.visit!
......
...@@ -10,25 +10,29 @@ module QA ...@@ -10,25 +10,29 @@ module QA
file_name: 'Dockerfile', file_name: 'Dockerfile',
template: 'custom_dockerfile', template: 'custom_dockerfile',
file_path: 'Dockerfile/custom_dockerfile.dockerfile', file_path: 'Dockerfile/custom_dockerfile.dockerfile',
content: 'dockerfile template test' content: 'dockerfile template test',
testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347656'
}, },
{ {
file_name: '.gitignore', file_name: '.gitignore',
template: 'custom_gitignore', template: 'custom_gitignore',
file_path: 'gitignore/custom_gitignore.gitignore', file_path: 'gitignore/custom_gitignore.gitignore',
content: 'gitignore template test' content: 'gitignore template test',
testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347655'
}, },
{ {
file_name: '.gitlab-ci.yml', file_name: '.gitlab-ci.yml',
template: 'custom_gitlab-ci', template: 'custom_gitlab-ci',
file_path: 'gitlab-ci/custom_gitlab-ci.yml', file_path: 'gitlab-ci/custom_gitlab-ci.yml',
content: 'gitlab-ci.yml template test' content: 'gitlab-ci.yml template test',
testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347653'
}, },
{ {
file_name: 'LICENSE', file_name: 'LICENSE',
template: 'custom_license', template: 'custom_license',
file_path: 'LICENSE/custom_license.txt', file_path: 'LICENSE/custom_license.txt',
content: 'license template test' content: 'license template test',
testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347654'
} }
] ]
...@@ -78,7 +82,7 @@ module QA ...@@ -78,7 +82,7 @@ module QA
end end
templates.each do |template| templates.each do |template|
it "creates file via custom #{template[:file_name]} file template" do it "creates file via custom #{template[:file_name]} file template", testcase: template[:testcase] do
Flow::Login.sign_in_as_admin Flow::Login.sign_in_as_admin
set_file_template_if_not_already_set set_file_template_if_not_already_set
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment