diff options
author | Robert Speicher <rspeicher@gmail.com> | 2017-10-06 15:17:25 +0200 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2017-10-06 15:27:19 +0200 |
commit | 348c610592585ca8bb1aa3bf1287d2f0302e02e9 (patch) | |
tree | 4a9b5a6a9fb28c69eb589dcdda5826dd6e7b6101 /qa | |
parent | e67ddcb302520b25fc6f313b6e1253a80201c6b3 (diff) | |
download | gitlab-ce-348c610592585ca8bb1aa3bf1287d2f0302e02e9.tar.gz |
Add QA::Page::Group::New to fill in the "Create group" formrs-qa-sandbox-group
Diffstat (limited to 'qa')
-rw-r--r-- | qa/qa.rb | 1 | ||||
-rw-r--r-- | qa/qa/page/dashboard/groups.rb | 16 | ||||
-rw-r--r-- | qa/qa/page/group/new.rb | 24 |
3 files changed, 28 insertions, 13 deletions
@@ -59,6 +59,7 @@ module QA end module Group + autoload :New, 'qa/page/group/new' autoload :Show, 'qa/page/group/show' end diff --git a/qa/qa/page/dashboard/groups.rb b/qa/qa/page/dashboard/groups.rb index f3338dcbc9a..1eadf605262 100644 --- a/qa/qa/page/dashboard/groups.rb +++ b/qa/qa/page/dashboard/groups.rb @@ -34,25 +34,15 @@ module QA click_link namespace.sandbox_name end - def create_group(group_name, group_description) - if page.has_content?('New Subgroup') - click_on 'New Subgroup' - else - click_on 'New group' - end - - fill_in 'group_path', with: group_name - fill_in 'group_description', with: group_description - choose 'Private' - - click_button 'Create group' + def create_group(group_name = nil, group_description = nil) + Page::Group::New.act { create_group(group_name, group_description) } end def prepare_test_namespace if has_test_namespace? go_to_test_namespace else - create_group(namespace.name, "QA test run at #{namespace.time}") + create_group end end diff --git a/qa/qa/page/group/new.rb b/qa/qa/page/group/new.rb new file mode 100644 index 00000000000..50e317f0980 --- /dev/null +++ b/qa/qa/page/group/new.rb @@ -0,0 +1,24 @@ +module QA + module Page + module Group + class New < Page::Base + def create_group(group_name = nil, group_description = nil) + if page.has_content?('New Subgroup') + click_on 'New Subgroup' + else + click_on 'New group' + end + + group_name ||= Runtime::Namespace.name + group_description ||= "QA test run at #{Runtime::Namespace.name}" + + fill_in 'group_path', with: group_name + fill_in 'group_description', with: group_description + choose 'Private' + + click_button 'Create group' + end + end + end + end +end |