diff options
Diffstat (limited to 'qa/qa/page')
-rw-r--r-- | qa/qa/page/dashboard/groups.rb | 67 | ||||
-rw-r--r-- | qa/qa/page/group/show.rb | 4 |
2 files changed, 42 insertions, 29 deletions
diff --git a/qa/qa/page/dashboard/groups.rb b/qa/qa/page/dashboard/groups.rb index 3d098ac60cc..e81b751082b 100644 --- a/qa/qa/page/dashboard/groups.rb +++ b/qa/qa/page/dashboard/groups.rb @@ -2,51 +2,60 @@ 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 + def filter_by_name(name) + # NOTE: The filter placeholder on the Subgroups page currently omits + # the ellipsis. + # + # See https://gitlab.com/gitlab-org/gitlab-ce/issues/38807 + if page.has_field?('Filter by name...') + fill_in 'Filter by name...', with: name + elsif page.has_field?('Filter by name') + fill_in 'Filter by name', with: name + end + end - if page.has_content?(sandbox_name) - return click_link(sandbox_name) - else - click_on 'New group' + def has_test_namespace? + filter_by_name(Runtime::Namespace.name) - populate_group_form(sandbox_name, "QA sandbox") - end + page.has_link?(Runtime::Namespace.name) end - def prepare_test_namespace - namespace_name = Runtime::Namespace.name + def has_sandbox? + filter_by_name(Runtime::Namespace.sandbox_name) - if page.has_content?('Subgroups') - click_link 'Subgroups' + page.has_link?(Runtime::Namespace.sandbox_name) + end - if page.has_content?(namespace_name) - return click_link(namespace_name) - end + def go_to_test_namespace + click_link Runtime::Namespace.name + end + + def go_to_sandbox + click_link Runtime::Namespace.sandbox_name + end - # NOTE: Inconsistent capitalization here in the UI + def create_group(group_name, group_description) + if page.has_content?('New Subgroup') click_on 'New Subgroup' else click_on 'New group' end - populate_group_form( - namespace_name, - "QA test run at #{Runtime::Namespace.time}" - ) - end - - private - - def populate_group_form(name, description) - fill_in 'group_path', with: name - fill_in 'group_description', with: description + fill_in 'group_path', with: group_name + fill_in 'group_description', with: group_description choose 'Private' click_button 'Create group' end + + def prepare_test_namespace + return click_link(Runtime::Namespace.name) if has_test_namespace? + + create_group( + Runtime::Namespace.name, + "QA test run at #{Runtime::Namespace.time}" + ) + end end end end diff --git a/qa/qa/page/group/show.rb b/qa/qa/page/group/show.rb index 296c311d7c6..6fb058fc755 100644 --- a/qa/qa/page/group/show.rb +++ b/qa/qa/page/group/show.rb @@ -2,6 +2,10 @@ module QA module Page module Group class Show < Page::Base + def go_to_subgroups + click_link 'Subgroups' + end + def go_to_new_project click_link 'New Project' end |