Commit c42cbbcf authored by Sanad Liaquat's avatar Sanad Liaquat

Merge branch 'qa-shl-fix-group-project-template-spec' into 'master'

Fix group project template e2e test

Closes #198690

See merge request gitlab-org/gitlab!25973
parents e8fb1e9f 3590e3af
...@@ -24,7 +24,9 @@ module QA ...@@ -24,7 +24,9 @@ module QA
end end
def wait_for_import_success def wait_for_import_success
has_text?('The project was successfully imported.', wait: QA::Support::Repeater::DEFAULT_MAX_WAIT_TIME) wait_until(max_duration: 120, sleep_interval: 1) do
has_text?('The project was successfully imported.')
end
end end
end end
end end
......
...@@ -24,6 +24,12 @@ module QA ...@@ -24,6 +24,12 @@ module QA
end end
end end
def click_settings
within_sidebar do
click_element(:group_settings_item)
end
end
def click_contribution_analytics_item def click_contribution_analytics_item
hover_element(:analytics_link) do hover_element(:analytics_link) do
within_submenu(:analytics_sidebar_submenu) do within_submenu(:analytics_sidebar_submenu) do
......
...@@ -6,14 +6,14 @@ module QA ...@@ -6,14 +6,14 @@ module QA
describe 'Project templates' do describe 'Project templates' do
before(:all) do before(:all) do
@files = [ @files = [
{ {
name: 'file.txt', name: 'file.txt',
content: 'foo' content: 'foo'
}, },
{ {
name: 'README.md', name: 'README.md',
content: 'bar' content: 'bar'
} }
] ]
@template_container_group_name = "instance-template-container-group-#{SecureRandom.hex(8)}" @template_container_group_name = "instance-template-container-group-#{SecureRandom.hex(8)}"
...@@ -54,8 +54,8 @@ module QA ...@@ -54,8 +54,8 @@ module QA
end end
create_project_using_template(project_name: 'Project using built-in project template', create_project_using_template(project_name: 'Project using built-in project template',
namespace: Runtime::Namespace.name, namespace: Runtime::Namespace.name,
template_name: built_in) template_name: built_in)
Page::Project::Show.perform(&:wait_for_import_success) Page::Project::Show.perform(&:wait_for_import_success)
...@@ -96,8 +96,8 @@ module QA ...@@ -96,8 +96,8 @@ module QA
end end
create_project_using_template(project_name: 'Project using instance level project template', create_project_using_template(project_name: 'Project using instance level project template',
namespace: Runtime::Namespace.path, namespace: Runtime::Namespace.path,
template_name: @template_project.name) template_name: @template_project.name)
Page::Project::Show.perform(&:wait_for_import_success) Page::Project::Show.perform(&:wait_for_import_success)
@files.each do |file| @files.each do |file|
...@@ -106,19 +106,20 @@ module QA ...@@ -106,19 +106,20 @@ module QA
end end
end end
context 'group level', quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/issues/198690', type: :flaky } do context 'group level' do
before do before do
Flow::Login.sign_in Flow::Login.sign_in
Page::Main::Menu.perform(&:go_to_groups) Page::Main::Menu.perform(&:go_to_groups)
Page::Dashboard::Groups.perform { |groups| groups.click_group(Runtime::Namespace.sandbox_name) } Page::Dashboard::Groups.perform { |groups| groups.click_group(Runtime::Namespace.sandbox_name) }
Page::Project::Menu.perform(&:click_settings)
Page::Group::Menu.perform(&:click_settings)
Page::Group::Settings::General.perform do |settings| Page::Group::Settings::General.perform do |settings|
settings.choose_custom_project_template("#{@template_container_group_name}") settings.choose_custom_project_template("#{@template_container_group_name}")
end end
Page::Project::Menu.perform(&:click_settings) Page::Group::Menu.perform(&:click_settings)
Page::Group::Settings::General.perform do |settings| Page::Group::Settings::General.perform do |settings|
expect(settings.current_custom_project_template).to include @template_container_group_name expect(settings.current_custom_project_template).to include @template_container_group_name
...@@ -140,8 +141,8 @@ module QA ...@@ -140,8 +141,8 @@ module QA
end end
create_project_using_template(project_name: 'Project using group level project template', create_project_using_template(project_name: 'Project using group level project template',
namespace: Runtime::Namespace.sandbox_name, namespace: Runtime::Namespace.sandbox_name,
template_name: @template_project.name) template_name: @template_project.name)
Page::Project::Show.perform(&:wait_for_import_success) Page::Project::Show.perform(&:wait_for_import_success)
@files.each do |file| @files.each do |file|
......
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