summaryrefslogtreecommitdiff
path: root/qa/qa/page
diff options
context:
space:
mode:
Diffstat (limited to 'qa/qa/page')
-rw-r--r--qa/qa/page/admin/settings/component/ip_limits.rb10
-rw-r--r--qa/qa/page/component/note.rb5
-rw-r--r--qa/qa/page/component/wiki_page_form.rb1
-rw-r--r--qa/qa/page/dashboard/snippet/index.rb6
-rw-r--r--qa/qa/page/group/bulk_import.rb5
-rw-r--r--qa/qa/page/group/menu.rb17
-rw-r--r--qa/qa/page/group/settings/group_deploy_tokens.rb68
-rw-r--r--qa/qa/page/group/settings/repository.rb23
-rw-r--r--qa/qa/page/main/login.rb2
-rw-r--r--qa/qa/page/main/menu.rb11
-rw-r--r--qa/qa/page/merge_request/show.rb19
-rw-r--r--qa/qa/page/project/monitor/metrics/show.rb2
-rw-r--r--qa/qa/page/project/settings/ci_cd.rb4
-rw-r--r--qa/qa/page/project/settings/deploy_tokens.rb4
-rw-r--r--qa/qa/page/view.rb2
15 files changed, 159 insertions, 20 deletions
diff --git a/qa/qa/page/admin/settings/component/ip_limits.rb b/qa/qa/page/admin/settings/component/ip_limits.rb
index 1f9bd113cab..a85b96014b3 100644
--- a/qa/qa/page/admin/settings/component/ip_limits.rb
+++ b/qa/qa/page/admin/settings/component/ip_limits.rb
@@ -7,16 +7,18 @@ module QA
module Component
class IpLimits < Page::Base
view 'app/views/admin/application_settings/_ip_limits.html.haml' do
- element :throttle_unauthenticated_checkbox
+ element :throttle_unauthenticated_api_checkbox
+ element :throttle_unauthenticated_web_checkbox
element :throttle_authenticated_api_checkbox
element :throttle_authenticated_web_checkbox
element :save_changes_button
end
def enable_throttles
- check_element(:throttle_unauthenticated_checkbox)
- check_element(:throttle_authenticated_api_checkbox)
- check_element(:throttle_authenticated_web_checkbox)
+ check_element(:throttle_unauthenticated_api_checkbox, true)
+ check_element(:throttle_unauthenticated_web_checkbox, true)
+ check_element(:throttle_authenticated_api_checkbox, true)
+ check_element(:throttle_authenticated_web_checkbox, true)
end
def save_settings
diff --git a/qa/qa/page/component/note.rb b/qa/qa/page/component/note.rb
index 67583f71bf3..7c733a231f1 100644
--- a/qa/qa/page/component/note.rb
+++ b/qa/qa/page/component/note.rb
@@ -14,8 +14,11 @@ module QA
end
base.view 'app/assets/javascripts/notes/components/comment_form.vue' do
- element :comment_button
element :comment_field
+ end
+
+ base.view 'app/assets/javascripts/notes/components/comment_type_dropdown.vue' do
+ element :comment_button
element :discussion_menu_item
end
diff --git a/qa/qa/page/component/wiki_page_form.rb b/qa/qa/page/component/wiki_page_form.rb
index 6b7452b0e0f..fd536ff1dd3 100644
--- a/qa/qa/page/component/wiki_page_form.rb
+++ b/qa/qa/page/component/wiki_page_form.rb
@@ -47,6 +47,7 @@ module QA
within_element(:try_new_editor_container) do
click_button('Use the new editor')
end
+ has_element?(:content_editor_container)
end
end
end
diff --git a/qa/qa/page/dashboard/snippet/index.rb b/qa/qa/page/dashboard/snippet/index.rb
index d8314509b1f..088fff17578 100644
--- a/qa/qa/page/dashboard/snippet/index.rb
+++ b/qa/qa/page/dashboard/snippet/index.rb
@@ -35,8 +35,10 @@ module QA
end
def has_number_of_files?(snippet_title, number)
- within_element(:snippet_link, snippet_title: snippet_title) do
- has_element?(:snippet_file_count_content, snippet_files: number)
+ retry_until(max_attempts: 5, reload: true, sleep_interval: 1) do # snippet statistics computation can take a few moments
+ within_element(:snippet_link, snippet_title: snippet_title) do
+ has_element?(:snippet_file_count_content, snippet_files: number, wait: 5)
+ end
end
end
end
diff --git a/qa/qa/page/group/bulk_import.rb b/qa/qa/page/group/bulk_import.rb
index 9ba80abf21c..b9497aeb6e5 100644
--- a/qa/qa/page/group/bulk_import.rb
+++ b/qa/qa/page/group/bulk_import.rb
@@ -7,7 +7,6 @@ module QA
view "app/assets/javascripts/import_entities/import_groups/components/import_table.vue" do
element :import_table
element :import_item
- element :import_group_button
element :import_status_indicator
end
@@ -19,6 +18,10 @@ module QA
element :target_namespace_selector_dropdown
end
+ view "app/assets/javascripts/import_entities/import_groups/components/import_actions_cell.vue" do
+ element :import_group_button
+ end
+
# Import source group in to target group
#
# @param [String] source_group_name
diff --git a/qa/qa/page/group/menu.rb b/qa/qa/page/group/menu.rb
index c997598e25a..be877e56713 100644
--- a/qa/qa/page/group/menu.rb
+++ b/qa/qa/page/group/menu.rb
@@ -68,8 +68,25 @@ module QA
end
end
+ def go_to_repository_settings
+ hover_group_settings do
+ within_submenu do
+ click_element(:sidebar_menu_item_link, menu_item: 'Repository')
+ end
+ end
+ end
+
private
+ def hover_settings
+ within_sidebar do
+ scroll_to_element(:sidebar_menu_link, menu_item: 'Settings')
+ find_element(:sidebar_menu_link, menu_item: 'Settings').hover
+
+ yield
+ end
+ end
+
def hover_issues
within_sidebar do
scroll_to_element(:sidebar_menu_link, menu_item: 'Issues')
diff --git a/qa/qa/page/group/settings/group_deploy_tokens.rb b/qa/qa/page/group/settings/group_deploy_tokens.rb
new file mode 100644
index 00000000000..65ee3fc72eb
--- /dev/null
+++ b/qa/qa/page/group/settings/group_deploy_tokens.rb
@@ -0,0 +1,68 @@
+# frozen_string_literal: true
+
+module QA
+ module Page
+ module Group
+ module Settings
+ class GroupDeployTokens < Page::Base
+ view 'app/views/shared/deploy_tokens/_form.html.haml' do
+ element :deploy_token_name_field
+ element :deploy_token_expires_at_field
+ element :deploy_token_read_repository_checkbox
+ element :deploy_token_read_package_registry_checkbox
+ element :deploy_token_read_registry_checkbox
+ element :deploy_token_write_package_registry_checkbox
+ element :create_deploy_token_button
+ end
+
+ view 'app/views/shared/deploy_tokens/_new_deploy_token.html.haml' do
+ element :created_deploy_token_container
+ element :deploy_token_user_field
+ element :deploy_token_field
+ end
+
+ def fill_token_name(name)
+ fill_element(:deploy_token_name_field, name)
+ end
+
+ def fill_token_expires_at(expires_at)
+ fill_element(:deploy_token_expires_at_field, expires_at.to_s + "\n")
+ end
+
+ def fill_scopes(read_repository: false, read_registry: false, read_package_registry: false, write_package_registry: false )
+ check_element(:deploy_token_read_repository_checkbox) if read_repository
+ check_element(:deploy_token_read_package_registry_checkbox) if read_package_registry
+ check_element(:deploy_token_read_registry_checkbox) if read_registry
+ check_element(:deploy_token_write_package_registry_checkbox) if write_package_registry
+ end
+
+ def add_token
+ click_element(:create_deploy_token_button)
+ end
+
+ def token_username
+ within_new_project_deploy_token do
+ find_element(:deploy_token_user_field).value
+ end
+ end
+
+ def token_password
+ within_new_project_deploy_token do
+ find_element(:deploy_token_field).value
+ end
+ end
+
+ private
+
+ def within_new_project_deploy_token
+ has_element?(:created_deploy_token_container, wait: QA::Support::Repeater::DEFAULT_MAX_WAIT_TIME)
+
+ within_element(:created_deploy_token_container) do
+ yield
+ end
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/page/group/settings/repository.rb b/qa/qa/page/group/settings/repository.rb
new file mode 100644
index 00000000000..2cc80ef26c6
--- /dev/null
+++ b/qa/qa/page/group/settings/repository.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+module QA
+ module Page
+ module Group
+ module Settings
+ class Repository < Page::Base
+ include QA::Page::Settings::Common
+
+ view 'app/views/shared/deploy_tokens/_index.html.haml' do
+ element :deploy_tokens_settings_content
+ end
+
+ def expand_deploy_tokens(&block)
+ expand_content(:deploy_tokens_settings_content) do
+ Settings::GroupDeployTokens.perform(&block)
+ end
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/page/main/login.rb b/qa/qa/page/main/login.rb
index 2c7ce69e4e5..c3170478733 100644
--- a/qa/qa/page/main/login.rb
+++ b/qa/qa/page/main/login.rb
@@ -53,7 +53,7 @@ module QA
set_initial_password_if_present
if Runtime::User.ldap_user? && user && user.username != Runtime::User.ldap_username
- raise 'If an LDAP user is provided, it must be used for sign-in', QA::Resource::User::InvalidUserError
+ raise QA::Resource::User::InvalidUserError, 'If an LDAP user is provided, it must be used for sign-in'
end
if Runtime::User.ldap_user?
diff --git a/qa/qa/page/main/menu.rb b/qa/qa/page/main/menu.rb
index 760741a9630..ad5cd971afc 100644
--- a/qa/qa/page/main/menu.rb
+++ b/qa/qa/page/main/menu.rb
@@ -11,6 +11,7 @@ module QA
view 'app/views/layouts/header/_default.html.haml' do
element :navbar, required: true
+ element :canary_badge_link
element :user_avatar, required: true
element :user_menu, required: true
element :stop_impersonation_link
@@ -168,6 +169,16 @@ module QA
click_element(:stop_impersonation_link)
end
+ # To verify whether the user has been directed to a canary web node
+ # @return [Boolean] result of checking existence of :canary_badge_link element
+ # @example:
+ # Menu.perform do |menu|
+ # expect(menu.canary?).to be(true)
+ # end
+ def canary?
+ has_element?(:canary_badge_link)
+ end
+
private
def within_top_menu(&block)
diff --git a/qa/qa/page/merge_request/show.rb b/qa/qa/page/merge_request/show.rb
index afe88fc0cdc..1d8d9ed6859 100644
--- a/qa/qa/page/merge_request/show.rb
+++ b/qa/qa/page/merge_request/show.rb
@@ -136,14 +136,14 @@ module QA
end
def submit_pending_reviews
+ has_element?(:submit_review_button)
within_element(:review_bar_content) do
click_element(:review_preview_dropdown)
click_element(:submit_review_button)
-
- # After clicking the button, wait for it to disappear
- # before moving on to the next part of the test
- has_no_element?(:submit_review_button)
end
+ # After clicking the button, wait for it to disappear
+ # before moving on to the next part of the test
+ has_no_element?(:submit_review_button)
end
def add_comment_to_diff(text)
@@ -287,6 +287,17 @@ module QA
raise "Rebase did not appear to be successful" unless success
end
+ def merge_immediately!
+ merge_moment_dropdown_found = has_element?(:merge_moment_dropdown, wait: 0)
+
+ if merge_moment_dropdown_found
+ click_element(:merge_moment_dropdown)
+ click_element(:merge_immediately_menu_item)
+ else
+ click_element(:merge_button)
+ end
+ end
+
def try_to_merge!
# Revisit after merge page re-architect is done https://gitlab.com/gitlab-org/gitlab/-/issues/300042
# To remove page refresh logic if possible
diff --git a/qa/qa/page/project/monitor/metrics/show.rb b/qa/qa/page/project/monitor/metrics/show.rb
index 07ceb108fa3..0129ee06cb6 100644
--- a/qa/qa/page/project/monitor/metrics/show.rb
+++ b/qa/qa/page/project/monitor/metrics/show.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'securerandom'
-
module QA
module Page
module Project
diff --git a/qa/qa/page/project/settings/ci_cd.rb b/qa/qa/page/project/settings/ci_cd.rb
index c537db34a51..6df285cdd93 100644
--- a/qa/qa/page/project/settings/ci_cd.rb
+++ b/qa/qa/page/project/settings/ci_cd.rb
@@ -4,7 +4,7 @@ module QA
module Page
module Project
module Settings
- class CICD < Page::Base
+ class CiCd < Page::Base
include QA::Page::Settings::Common
view 'app/views/projects/settings/ci_cd/show.html.haml' do
@@ -43,4 +43,4 @@ module QA
end
end
-QA::Page::Project::Settings::CICD.prepend_mod_with("Page::Project::Settings::CICD", namespace: QA)
+QA::Page::Project::Settings::CiCd.prepend_mod_with("Page::Project::Settings::CiCd", namespace: QA)
diff --git a/qa/qa/page/project/settings/deploy_tokens.rb b/qa/qa/page/project/settings/deploy_tokens.rb
index db1f6f68ec6..7b61c81154a 100644
--- a/qa/qa/page/project/settings/deploy_tokens.rb
+++ b/qa/qa/page/project/settings/deploy_tokens.rb
@@ -10,6 +10,7 @@ module QA
element :deploy_token_expires_at_field
element :deploy_token_read_repository_checkbox
element :deploy_token_read_package_registry_checkbox
+ element :deploy_token_write_package_registry_checkbox
element :deploy_token_read_registry_checkbox
element :create_deploy_token_button
end
@@ -28,9 +29,10 @@ module QA
fill_element(:deploy_token_expires_at_field, expires_at.to_s + "\n")
end
- def fill_scopes(read_repository: false, read_registry: false, read_package_registry: false)
+ def fill_scopes(read_repository: false, read_registry: false, read_package_registry: false, write_package_registry: false)
check_element(:deploy_token_read_repository_checkbox) if read_repository
check_element(:deploy_token_read_package_registry_checkbox) if read_package_registry
+ check_element(:deploy_token_write_package_registry_checkbox) if write_package_registry
check_element(:deploy_token_read_registry_checkbox) if read_registry
end
diff --git a/qa/qa/page/view.rb b/qa/qa/page/view.rb
index 613059b2d32..fa17b8fe302 100644
--- a/qa/qa/page/view.rb
+++ b/qa/qa/page/view.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require 'pathname'
-
module QA
module Page
class View