Commit c2b17da4 authored by Robert Speicher's avatar Robert Speicher

Make use of a `gitlab-qa-sandbox` group if available

This will use a top-level group if it's available, or create one if it's
not, then create our `qa_test_*` groups as subgroups of the sandbox
group.
parent 4a0f720a
...@@ -2,16 +2,47 @@ module QA ...@@ -2,16 +2,47 @@ module QA
module Page module Page
module Dashboard module Dashboard
class Groups < Page::Base class Groups < Page::Base
def prepare_sandbox
sandbox_name = Runtime::Namespace.sandbox_name
fill_in 'Filter by name...', with: sandbox_name
if page.has_content?(sandbox_name)
return click_link(sandbox_name)
else
click_on 'New group'
populate_group_form(sandbox_name, "QA sandbox")
end
end
def prepare_test_namespace def prepare_test_namespace
if page.has_content?(Runtime::Namespace.name) namespace_name = Runtime::Namespace.name
return click_link(Runtime::Namespace.name)
if page.has_content?('Subgroups')
click_link 'Subgroups'
if page.has_content?(namespace_name)
return click_link(namespace_name)
end
# NOTE: Inconsistent capitalization here in the UI
click_on 'New Subgroup'
else
click_on 'New group'
end end
click_on 'New group' populate_group_form(
namespace_name,
"QA test run at #{Runtime::Namespace.time}"
)
end
private
fill_in 'group_path', with: Runtime::Namespace.name def populate_group_form(name, description)
fill_in 'group_description', fill_in 'group_path', with: name
with: "QA test run at #{Runtime::Namespace.time}" fill_in 'group_description', with: description
choose 'Private' choose 'Private'
click_button 'Create group' click_button 'Create group'
......
...@@ -10,6 +10,10 @@ module QA ...@@ -10,6 +10,10 @@ module QA
def name def name
'qa_test_' + time.strftime('%d_%m_%Y_%H-%M-%S') 'qa_test_' + time.strftime('%d_%m_%Y_%H-%M-%S')
end end
def sandbox_name
'gitlab-qa-sandbox'
end
end end
end end
end end
...@@ -13,7 +13,10 @@ module QA ...@@ -13,7 +13,10 @@ module QA
def perform def perform
Page::Main::Menu.act { go_to_groups } Page::Main::Menu.act { go_to_groups }
Page::Dashboard::Groups.act { prepare_test_namespace } Page::Dashboard::Groups.act do
prepare_sandbox
prepare_test_namespace
end
Page::Group::Show.act { go_to_new_project } Page::Group::Show.act { go_to_new_project }
Page::Project::New.perform do |page| Page::Project::New.perform do |page|
......
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