diff options
author | Robert Speicher <rspeicher@gmail.com> | 2017-10-04 15:53:23 +0200 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2017-10-04 15:56:02 +0200 |
commit | c2b17da46b4b6e3d5a19f1b1188db81f99b156af (patch) | |
tree | 09461705a08f8d453e42bb85c4537e08ad051eeb /qa | |
parent | 4a0f720a502ac02423cb9db20727ba386de3e1f1 (diff) | |
download | gitlab-ce-c2b17da46b4b6e3d5a19f1b1188db81f99b156af.tar.gz |
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.
Diffstat (limited to 'qa')
-rw-r--r-- | qa/qa/page/dashboard/groups.rb | 43 | ||||
-rw-r--r-- | qa/qa/runtime/namespace.rb | 4 | ||||
-rw-r--r-- | qa/qa/scenario/gitlab/project/create.rb | 5 |
3 files changed, 45 insertions, 7 deletions
diff --git a/qa/qa/page/dashboard/groups.rb b/qa/qa/page/dashboard/groups.rb index 3690f40dcfe..3d098ac60cc 100644 --- a/qa/qa/page/dashboard/groups.rb +++ b/qa/qa/page/dashboard/groups.rb @@ -2,16 +2,47 @@ module QA module Page module Dashboard 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 - if page.has_content?(Runtime::Namespace.name) - return click_link(Runtime::Namespace.name) + namespace_name = 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 - 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 - fill_in 'group_description', - with: "QA test run at #{Runtime::Namespace.time}" + def populate_group_form(name, description) + fill_in 'group_path', with: name + fill_in 'group_description', with: description choose 'Private' click_button 'Create group' diff --git a/qa/qa/runtime/namespace.rb b/qa/qa/runtime/namespace.rb index e4910b63a14..996286430b9 100644 --- a/qa/qa/runtime/namespace.rb +++ b/qa/qa/runtime/namespace.rb @@ -10,6 +10,10 @@ module QA def name 'qa_test_' + time.strftime('%d_%m_%Y_%H-%M-%S') end + + def sandbox_name + 'gitlab-qa-sandbox' + end end end end diff --git a/qa/qa/scenario/gitlab/project/create.rb b/qa/qa/scenario/gitlab/project/create.rb index b860701c304..3b015c71da3 100644 --- a/qa/qa/scenario/gitlab/project/create.rb +++ b/qa/qa/scenario/gitlab/project/create.rb @@ -13,7 +13,10 @@ module QA def perform 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::Project::New.perform do |page| |