From b595cb0c1dec83de5bdee18284abe86614bed33b Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 20 Jul 2022 15:40:28 +0000 Subject: Add latest changes from gitlab-org/gitlab@15-2-stable-ee --- qa/qa/page/project/issue/show.rb | 10 +++++-- qa/qa/page/project/new.rb | 2 +- qa/qa/page/project/settings/access_tokens.rb | 2 -- qa/qa/page/project/settings/deploy_keys.rb | 10 +++---- qa/qa/page/project/settings/integrations.rb | 5 ++++ .../settings/services/pipeline_status_emails.rb | 35 ++++++++++++++++++++++ qa/qa/page/project/show.rb | 7 +++++ qa/qa/page/project/web_ide/edit.rb | 8 +++-- 8 files changed, 67 insertions(+), 12 deletions(-) create mode 100644 qa/qa/page/project/settings/services/pipeline_status_emails.rb (limited to 'qa/qa/page/project') diff --git a/qa/qa/page/project/issue/show.rb b/qa/qa/page/project/issue/show.rb index fe468de60cd..b1417d9b9db 100644 --- a/qa/qa/page/project/issue/show.rb +++ b/qa/qa/page/project/issue/show.rb @@ -5,7 +5,6 @@ module QA module Project module Issue class Show < Page::Base - include Page::Component::Issuable::Common include Page::Component::Note include Page::Component::DesignManagement include Page::Component::Issuable::Sidebar @@ -22,6 +21,10 @@ module QA element :delete_issue_button end + view 'app/assets/javascripts/issues/show/components/title.vue' do + element :title_content, required: true + end + view 'app/assets/javascripts/related_issues/components/add_issuable_form.vue' do element :add_issue_button end @@ -79,7 +82,10 @@ module QA def delete_issue click_element(:issue_actions_ellipsis_dropdown) - click_element(:delete_issue_button, Page::Modal::DeleteIssue) + + click_element(:delete_issue_button, + Page::Modal::DeleteIssue, + wait: Support::Repeater::DEFAULT_MAX_WAIT_TIME) Page::Modal::DeleteIssue.perform(&:confirm_delete_issue) diff --git a/qa/qa/page/project/new.rb b/qa/qa/page/project/new.rb index 7da763ca0e6..7864e664429 100644 --- a/qa/qa/page/project/new.rb +++ b/qa/qa/page/project/new.rb @@ -76,7 +76,7 @@ module QA end def set_visibility(visibility) - choose visibility.capitalize + find('label', text: visibility.capitalize).click end # Disable experiment for SAST at project creation https://gitlab.com/gitlab-org/gitlab/-/issues/333196 diff --git a/qa/qa/page/project/settings/access_tokens.rb b/qa/qa/page/project/settings/access_tokens.rb index 47afa26191c..69a8bdeaab8 100644 --- a/qa/qa/page/project/settings/access_tokens.rb +++ b/qa/qa/page/project/settings/access_tokens.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require 'date' - module QA module Page module Project diff --git a/qa/qa/page/project/settings/deploy_keys.rb b/qa/qa/page/project/settings/deploy_keys.rb index 467799a14fb..297d29550e3 100644 --- a/qa/qa/page/project/settings/deploy_keys.rb +++ b/qa/qa/page/project/settings/deploy_keys.rb @@ -23,7 +23,7 @@ module QA view 'app/assets/javascripts/deploy_keys/components/key.vue' do element :key_container element :key_title_content - element :key_md5_fingerprint_content + element :key_sha256_fingerprint_content end def add_key @@ -38,17 +38,17 @@ module QA fill_element(:deploy_key_field, key) end - def find_md5_fingerprint(title) + def find_sha256_fingerprint(title) within_project_deploy_keys do find_element(:key_container, text: title) - .find(element_selector_css(:key_md5_fingerprint_content)).text.delete_prefix('MD5:') + .find(element_selector_css(:key_sha256_fingerprint_content)).text end end - def has_key?(title, md5_fingerprint) + def has_key?(title, sha256_fingerprint) within_project_deploy_keys do find_element(:key_container, text: title) - .has_css?(element_selector_css(:key_md5_fingerprint_content), text: "MD5:#{md5_fingerprint}") + .has_css?(element_selector_css(:key_sha256_fingerprint_content), text: sha256_fingerprint) end end diff --git a/qa/qa/page/project/settings/integrations.rb b/qa/qa/page/project/settings/integrations.rb index 420dcb63918..0d5515aacdf 100644 --- a/qa/qa/page/project/settings/integrations.rb +++ b/qa/qa/page/project/settings/integrations.rb @@ -8,12 +8,17 @@ module QA view 'app/assets/javascripts/integrations/index/components/integrations_table.vue' do element :prometheus_link, %q(:data-qa-selector="`${item.name}_link`") # rubocop:disable QA/ElementWithPattern element :jira_link, %q(:data-qa-selector="`${item.name}_link`") # rubocop:disable QA/ElementWithPattern + element :pipelines_email_link, %q(:data-qa-selector="`${item.name}_link`") # rubocop:disable QA/ElementWithPattern end def click_on_prometheus_integration click_element :prometheus_link end + def click_pipelines_email_link + click_element :pipelines_email_link + end + def click_jira_link click_element :jira_link end diff --git a/qa/qa/page/project/settings/services/pipeline_status_emails.rb b/qa/qa/page/project/settings/services/pipeline_status_emails.rb new file mode 100644 index 00000000000..2f78577e3d5 --- /dev/null +++ b/qa/qa/page/project/settings/services/pipeline_status_emails.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module QA + module Page + module Project + module Settings + module Services + class PipelineStatusEmails < QA::Page::Base + view 'app/assets/javascripts/integrations/edit/components/integration_form.vue' do + element :recipients_div, %q(:data-qa-selector="`${field.name}_div`") # rubocop:disable QA/ElementWithPattern + element :notify_only_broken_pipelines_div, %q(:data-qa-selector="`${field.name}_div`") # rubocop:disable QA/ElementWithPattern + element :save_changes_button + end + + def set_recipients(emails) + within_element :recipients_div do + fill_in 'Recipients', with: emails.join(',') + end + end + + def toggle_notify_broken_pipelines + within_element :notify_only_broken_pipelines_div do + uncheck 'Notify only broken pipelines', allow_label_click: true + end + end + + def click_save_button + click_element(:save_changes_button) + end + end + end + end + end + end +end diff --git a/qa/qa/page/project/show.rb b/qa/qa/page/project/show.rb index 9983ee2a33d..022e08215be 100644 --- a/qa/qa/page/project/show.rb +++ b/qa/qa/page/project/show.rb @@ -44,6 +44,7 @@ module QA end view 'app/views/projects/_files.html.haml' do + element :project_buttons element :tree_holder, '.tree-holder' # rubocop:disable QA/ElementWithPattern end @@ -193,6 +194,12 @@ module QA has_element?(:badge_image_link, link_url: link_url) end end + + def has_license?(name) + within_element(:project_buttons) do + has_link?(name) + end + end end end end diff --git a/qa/qa/page/project/web_ide/edit.rb b/qa/qa/page/project/web_ide/edit.rb index 3901eff0bcb..bc6c839bfe2 100644 --- a/qa/qa/page/project/web_ide/edit.rb +++ b/qa/qa/page/project/web_ide/edit.rb @@ -192,7 +192,7 @@ module QA find_element(:commit_sha_content).text end - def commit_changes(commit_message = nil, open_merge_request: false) + def commit_changes(commit_message = nil, open_merge_request: false, wait_for_success: true) # Clicking :begin_commit_button switches from the # edit to the commit view click_element(:begin_commit_button) @@ -226,13 +226,17 @@ module QA end click_element(:commit_button) if has_element?(:commit_button) + break unless wait_for_success + # If this is the first commit, the commit SHA only appears after reloading wait_until(reload: true) do active_element?(:edit_mode_tab) && commit_sha != original_commit end end - raise "The changes do not appear to have been committed successfully." unless commit_success + if wait_for_success + raise "The changes do not appear to have been committed successfully." unless commit_success + end end end -- cgit v1.2.1