summaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-06 21:09:19 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-06 21:09:19 +0000
commit7915c41e4261719719e791602c8235574157164c (patch)
tree6c1fc8c4ad4e974878c879fcc2c7c8f7d56d0cee /qa
parent495c22d1245b6212b21b7379a542df73dfa77206 (diff)
downloadgitlab-ce-7915c41e4261719719e791602c8235574157164c.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa')
-rw-r--r--qa/qa.rb6
-rw-r--r--qa/qa/page/admin/menu.rb10
-rw-r--r--qa/qa/page/admin/overview/groups/edit.rb23
-rw-r--r--qa/qa/page/admin/overview/groups/index.rb32
-rw-r--r--qa/qa/page/admin/overview/groups/show.rb21
-rw-r--r--qa/qa/runtime/env.rb4
-rw-r--r--qa/spec/runtime/env_spec.rb14
7 files changed, 107 insertions, 3 deletions
diff --git a/qa/qa.rb b/qa/qa.rb
index 8fc531123e8..ed425e205e3 100644
--- a/qa/qa.rb
+++ b/qa/qa.rb
@@ -369,6 +369,12 @@ module QA
autoload :Index, 'qa/page/admin/overview/users/index'
autoload :Show, 'qa/page/admin/overview/users/show'
end
+
+ module Groups
+ autoload :Index, 'qa/page/admin/overview/groups/index'
+ autoload :Show, 'qa/page/admin/overview/groups/show'
+ autoload :Edit, 'qa/page/admin/overview/groups/edit'
+ end
end
end
diff --git a/qa/qa/page/admin/menu.rb b/qa/qa/page/admin/menu.rb
index 2d1af78046d..da716ca8e27 100644
--- a/qa/qa/page/admin/menu.rb
+++ b/qa/qa/page/admin/menu.rb
@@ -16,9 +16,7 @@ module QA
element :admin_sidebar_monitoring_submenu_content
element :admin_sidebar_overview_submenu_content
element :users_overview_link
- end
-
- view 'app/views/layouts/nav/sidebar/_admin.html.haml' do
+ element :groups_overview_link
element :integration_settings_link
end
@@ -76,6 +74,12 @@ module QA
end
end
+ def go_to_groups_overview
+ within_submenu(:admin_sidebar_overview_submenu_content) do
+ click_element :groups_overview_link
+ end
+ end
+
private
def hover_element(element)
diff --git a/qa/qa/page/admin/overview/groups/edit.rb b/qa/qa/page/admin/overview/groups/edit.rb
new file mode 100644
index 00000000000..c96e953d05b
--- /dev/null
+++ b/qa/qa/page/admin/overview/groups/edit.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+module QA
+ module Page
+ module Admin
+ module Overview
+ module Groups
+ class Edit < QA::Page::Base
+ view 'app/views/admin/groups/_form.html.haml' do
+ element :save_changes_button, required: true
+ end
+
+ def click_save_changes_button
+ click_element :save_changes_button, Groups::Show
+ end
+ end
+ end
+ end
+ end
+ end
+end
+
+QA::Page::Admin::Overview::Groups::Edit.prepend_if_ee('QA::EE::Page::Admin::Overview::Groups::Edit')
diff --git a/qa/qa/page/admin/overview/groups/index.rb b/qa/qa/page/admin/overview/groups/index.rb
new file mode 100644
index 00000000000..c9417bd01b1
--- /dev/null
+++ b/qa/qa/page/admin/overview/groups/index.rb
@@ -0,0 +1,32 @@
+# frozen_string_literal: true
+
+module QA
+ module Page
+ module Admin
+ module Overview
+ module Groups
+ class Index < QA::Page::Base
+ view 'app/views/admin/groups/index.html.haml' do
+ element :group_search_field, required: true
+ end
+
+ view 'app/views/admin/groups/_group.html.haml' do
+ element :group_row_content
+ element :group_name_link
+ end
+
+ def search_group(group_name)
+ find_element(:group_search_field).set(group_name).send_keys(:return)
+ end
+
+ def click_group(group_name)
+ within_element(:group_row_content, text: group_name) do
+ click_element(:group_name_link)
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/page/admin/overview/groups/show.rb b/qa/qa/page/admin/overview/groups/show.rb
new file mode 100644
index 00000000000..6744b0c1e70
--- /dev/null
+++ b/qa/qa/page/admin/overview/groups/show.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+module QA
+ module Page
+ module Admin
+ module Overview
+ module Groups
+ class Show < QA::Page::Base
+ view 'app/views/admin/groups/show.html.haml' do
+ element :edit_group_link, required: true
+ end
+
+ def click_edit_group_link
+ click_element :edit_group_link, Groups::Edit
+ end
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/runtime/env.rb b/qa/qa/runtime/env.rb
index d8a3fe93bc0..5c23586fb3e 100644
--- a/qa/qa/runtime/env.rb
+++ b/qa/qa/runtime/env.rb
@@ -23,6 +23,10 @@ module QA
SUPPORTED_FEATURES
end
+ def dot_com?
+ Runtime::Scenario.gitlab_address.include?(".com")
+ end
+
def additional_repository_storage
ENV['QA_ADDITIONAL_REPOSITORY_STORAGE']
end
diff --git a/qa/spec/runtime/env_spec.rb b/qa/spec/runtime/env_spec.rb
index 6b8777af9fe..f2e5eb35871 100644
--- a/qa/spec/runtime/env_spec.rb
+++ b/qa/spec/runtime/env_spec.rb
@@ -340,4 +340,18 @@ describe QA::Runtime::Env do
end
end
end
+
+ describe '.dot_com?' do
+ it 'returns true when url has .com' do
+ QA::Runtime::Scenario.define(:gitlab_address, "https://staging.gitlab.com")
+
+ expect(described_class.dot_com?).to be_truthy
+ end
+
+ it 'returns false when url does not have .com' do
+ QA::Runtime::Scenario.define(:gitlab_address, "https://gitlab.test")
+
+ expect(described_class.dot_com?).to be_falsy
+ end
+ end
end