From baf9d05a9209f401a4642bb3cf948945621e1d2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Fri, 21 Jul 2017 11:31:38 +0000 Subject: Merge branch 'fix/gb/qa/fix-new-project-selectors' into 'master' Fix new project selectors in GitLab QA Closes gitlab-qa#57 See merge request !13012 --- qa/qa.rb | 9 ++++++++- qa/qa/page/dashboard/groups.rb | 22 ++++++++++++++++++++++ qa/qa/page/group/show.rb | 11 +++++++++++ qa/qa/page/main/groups.rb | 20 -------------------- qa/qa/page/main/menu.rb | 7 ------- qa/qa/scenario/gitlab/project/create.rb | 4 ++-- 6 files changed, 43 insertions(+), 30 deletions(-) create mode 100644 qa/qa/page/dashboard/groups.rb create mode 100644 qa/qa/page/group/show.rb delete mode 100644 qa/qa/page/main/groups.rb diff --git a/qa/qa.rb b/qa/qa.rb index bdfb8237995..db9d8c42fde 100644 --- a/qa/qa.rb +++ b/qa/qa.rb @@ -48,7 +48,14 @@ module QA module Main autoload :Entry, 'qa/page/main/entry' autoload :Menu, 'qa/page/main/menu' - autoload :Groups, 'qa/page/main/groups' + end + + module Dashboard + autoload :Groups, 'qa/page/dashboard/groups' + end + + module Group + autoload :Show, 'qa/page/group/show' end module Project diff --git a/qa/qa/page/dashboard/groups.rb b/qa/qa/page/dashboard/groups.rb new file mode 100644 index 00000000000..3690f40dcfe --- /dev/null +++ b/qa/qa/page/dashboard/groups.rb @@ -0,0 +1,22 @@ +module QA + module Page + module Dashboard + class Groups < Page::Base + def prepare_test_namespace + if page.has_content?(Runtime::Namespace.name) + return click_link(Runtime::Namespace.name) + end + + click_on 'New group' + + fill_in 'group_path', with: Runtime::Namespace.name + fill_in 'group_description', + with: "QA test run at #{Runtime::Namespace.time}" + choose 'Private' + + click_button 'Create group' + end + end + end + end +end diff --git a/qa/qa/page/group/show.rb b/qa/qa/page/group/show.rb new file mode 100644 index 00000000000..296c311d7c6 --- /dev/null +++ b/qa/qa/page/group/show.rb @@ -0,0 +1,11 @@ +module QA + module Page + module Group + class Show < Page::Base + def go_to_new_project + click_link 'New Project' + end + end + end + end +end diff --git a/qa/qa/page/main/groups.rb b/qa/qa/page/main/groups.rb deleted file mode 100644 index 169c5ebc967..00000000000 --- a/qa/qa/page/main/groups.rb +++ /dev/null @@ -1,20 +0,0 @@ -module QA - module Page - module Main - class Groups < Page::Base - def prepare_test_namespace - return if page.has_content?(Runtime::Namespace.name) - - click_on 'New group' - - fill_in 'group_path', with: Runtime::Namespace.name - fill_in 'group_description', - with: "QA test run at #{Runtime::Namespace.time}" - choose 'Private' - - click_button 'Create group' - end - end - end - end -end diff --git a/qa/qa/page/main/menu.rb b/qa/qa/page/main/menu.rb index f7c2086d0dd..7ce4e9009f5 100644 --- a/qa/qa/page/main/menu.rb +++ b/qa/qa/page/main/menu.rb @@ -14,13 +14,6 @@ module QA within_user_menu { click_link 'Admin area' } end - def go_to_new_project - within_user_menu do - find('.header-new-dropdown-toggle').click - click_link('New project') - end - end - def sign_out within_user_menu do find('.header-user-dropdown-toggle').click diff --git a/qa/qa/scenario/gitlab/project/create.rb b/qa/qa/scenario/gitlab/project/create.rb index 99d0fc42a94..b860701c304 100644 --- a/qa/qa/scenario/gitlab/project/create.rb +++ b/qa/qa/scenario/gitlab/project/create.rb @@ -13,8 +13,8 @@ module QA def perform Page::Main::Menu.act { go_to_groups } - Page::Main::Groups.act { prepare_test_namespace } - Page::Main::Menu.act { go_to_new_project } + Page::Dashboard::Groups.act { prepare_test_namespace } + Page::Group::Show.act { go_to_new_project } Page::Project::New.perform do |page| page.choose_test_namespace -- cgit v1.2.1