summaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2017-10-06 15:17:25 +0200
committerRobert Speicher <rspeicher@gmail.com>2017-10-06 15:27:19 +0200
commit348c610592585ca8bb1aa3bf1287d2f0302e02e9 (patch)
tree4a9b5a6a9fb28c69eb589dcdda5826dd6e7b6101 /qa
parente67ddcb302520b25fc6f313b6e1253a80201c6b3 (diff)
downloadgitlab-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.rb1
-rw-r--r--qa/qa/page/dashboard/groups.rb16
-rw-r--r--qa/qa/page/group/new.rb24
3 files changed, 28 insertions, 13 deletions
diff --git a/qa/qa.rb b/qa/qa.rb
index a49b2b6ea42..752afc0e044 100644
--- a/qa/qa.rb
+++ b/qa/qa.rb
@@ -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