Commit 11502907 authored by Walmyr Lima e Silva Filho's avatar Walmyr Lima e Silva Filho

Merge branch 'qa-add-built-in-project-template-test-ee' into 'master'

Add built-in project template test

See merge request gitlab-org/gitlab-ee!15766
parents 994cf40b 69bac166
- Gitlab::ProjectTemplate.all.each do |template|
.template-option.d-flex.align-items-center
.template-option.d-flex.align-items-center{ data: { qa_selector: 'template_option_row' } }
.logo.append-right-10.px-1
= image_tag template.logo, size: 32, class: "btn-template-icon icon-#{template.name}"
.description
......@@ -13,5 +13,5 @@
= _("Preview")
%label.btn.btn-success.template-button.choose-template.append-bottom-0{ for: template.name }
%input{ type: "radio", autocomplete: "off", name: "project[template_name]", id: template.name, value: template.name, data: { track_label: "template_use", track_property: template.name, track_event: "click_button", track_value: "" } }
%span
%span{ data: { qa_selector: 'use_template_button' } }
= _("Use template")
......@@ -2,8 +2,7 @@
require 'securerandom'
module QA
# Failure issue: https://gitlab.com/gitlab-org/quality/staging/issues/61
context :manage, :quarantine do
context :manage do
describe 'Project templates' do
before(:all) do
@files = [
......@@ -39,7 +38,42 @@ module QA
end
end
context 'instance level' do
context 'built-in' do
before do
# Log out if already logged in
Page::Main::Menu.perform do |menu|
menu.sign_out if menu.has_personal_area?(wait: 0)
end
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_admin_credentials)
@group = Resource::Group.fabricate_via_api!
end
it 'successfully imports the project using template' do
built_in = 'Ruby on Rails'
@group.visit!
Page::Group::Show.perform(&:go_to_new_project)
Page::Project::New.perform do |page|
page.click_create_from_template_tab
expect(page).to have_text(built_in)
end
create_project_using_template(project_name: 'Project using built-in project template',
namespace: Runtime::Namespace.name,
template_name: built_in)
Page::Project::Show.perform(&:wait_for_import_success)
expect(page).to have_content("Initialized from '#{built_in}' project template")
expect(page).to have_content(".ruby-version")
end
end
# Failure issue: https://gitlab.com/gitlab-org/quality/staging/issues/61
context 'instance level', :quarantine do
before do
# Log out if already logged in
Page::Main::Menu.perform do |menu|
......
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