diff options
Diffstat (limited to 'qa/qa/page')
27 files changed, 333 insertions, 103 deletions
diff --git a/qa/qa/page/admin/overview/users/index.rb b/qa/qa/page/admin/overview/users/index.rb index 8a2c2303ff7..2ad45e4a0fa 100644 --- a/qa/qa/page/admin/overview/users/index.rb +++ b/qa/qa/page/admin/overview/users/index.rb @@ -15,10 +15,6 @@ module QA element :user_row_content end - view 'app/views/admin/users/_user_detail.html.haml' do - element :username_link - end - def search_user(username) find_element(:user_search_field).set(username).send_keys(:return) end diff --git a/qa/qa/page/admin/settings/component/snowplow.rb b/qa/qa/page/admin/settings/component/snowplow.rb new file mode 100644 index 00000000000..e05679feac3 --- /dev/null +++ b/qa/qa/page/admin/settings/component/snowplow.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +module QA + module Page + module Admin + module Settings + module Component + class Snowplow < Page::Base + include QA::Page::Settings::Common + + view 'app/views/admin/application_settings/_snowplow.html.haml' do + element :snowplow_settings_content + element :snowplow_enabled_checkbox + element :save_changes_button + end + + def enable_snowplow_tracking + expand_content(:snowplow_settings_content) do + check_snowplow_enabled_checkbox + click_save_changes_button + end + end + + def disable_snowplow_tracking + expand_content(:snowplow_settings_content) do + uncheck_snowplow_enabled_checkbox + click_save_changes_button + end + end + + private + + def check_snowplow_enabled_checkbox + check_element(:snowplow_enabled_checkbox) + end + + def uncheck_snowplow_enabled_checkbox + uncheck_element(:snowplow_enabled_checkbox) + end + + def click_save_changes_button + click_element :save_changes_button + end + end + end + end + end + end +end diff --git a/qa/qa/page/admin/settings/component/usage_statistics.rb b/qa/qa/page/admin/settings/component/usage_statistics.rb new file mode 100644 index 00000000000..0275b7ae926 --- /dev/null +++ b/qa/qa/page/admin/settings/component/usage_statistics.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module QA + module Page + module Admin + module Settings + module Component + class UsageStatistics < Page::Base + view 'app/views/admin/application_settings/_usage.html.haml' do + element :enable_usage_data_checkbox + end + + def has_disabled_usage_data_checkbox? + has_element?(:enable_usage_data_checkbox, disabled: true) + end + end + end + end + end + end +end diff --git a/qa/qa/page/admin/settings/metrics_and_profiling.rb b/qa/qa/page/admin/settings/metrics_and_profiling.rb index 41fad942fc4..7224e51e110 100644 --- a/qa/qa/page/admin/settings/metrics_and_profiling.rb +++ b/qa/qa/page/admin/settings/metrics_and_profiling.rb @@ -9,6 +9,7 @@ module QA view 'app/views/admin/application_settings/metrics_and_profiling.html.haml' do element :performance_bar_settings_content + element :usage_statistics_settings_content end def expand_performance_bar(&block) @@ -16,6 +17,12 @@ module QA Component::PerformanceBar.perform(&block) end end + + def expand_usage_statistics(&block) + expand_content(:usage_statistics_settings_content) do + Component::UsageStatistics.perform(&block) + end + end end end end diff --git a/qa/qa/page/base.rb b/qa/qa/page/base.rb index 4708063b2eb..69f58dcb8a5 100644 --- a/qa/qa/page/base.rb +++ b/qa/qa/page/base.rb @@ -443,6 +443,29 @@ module QA # Some checkboxes and radio buttons are hidden by their labels and cannot be clicked directly click_by_js ? page.execute_script("arguments[0].click();", box) : box.click end + + def feature_flag_controlled_element(feature_flag, element_when_flag_enabled, element_when_flag_disabled) + # Feature flags can change the UI elements shown, but we need admin access to get feature flag values, which + # prevents us running the tests on production. Instead we detect the UI element that should be shown when the + # feature flag is enabled and otherwise use the element that should be displayed when the feature flag is + # disabled. + + # Check both options once quickly so that the test doesn't wait unnecessarily if the UI has loaded + # We wait for requests first and wait one second for the element because it can take a moment for a Vue app to + # load and render the UI + wait_for_requests + + return element_when_flag_enabled if has_element?(element_when_flag_enabled, wait: 1) + return element_when_flag_disabled if has_element?(element_when_flag_disabled, wait: 1) + + # Check both options again, this time waiting for the default duration + return element_when_flag_enabled if has_element?(element_when_flag_enabled) + return element_when_flag_disabled if has_element?(element_when_flag_disabled) + + raise ElementNotFound, + "Could not find the expected element as #{element_when_flag_enabled} or #{element_when_flag_disabled}." \ + "The relevant feature flag is #{feature_flag}" + end end end end diff --git a/qa/qa/page/component/blob_content.rb b/qa/qa/page/component/blob_content.rb new file mode 100644 index 00000000000..4d36a6dcefe --- /dev/null +++ b/qa/qa/page/component/blob_content.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +module QA + module Page + module Component + module BlobContent + extend QA::Page::PageConcern + + def self.included(base) + super + + base.view 'app/assets/javascripts/blob/components/blob_header_filepath.vue' do + element :file_title_content + end + + base.view 'app/assets/javascripts/blob/components/blob_content.vue' do + element :blob_viewer_file_content + end + + base.view 'app/assets/javascripts/blob/components/blob_header_default_actions.vue' do + element :default_actions_container + element :copy_contents_button + end + + base.view 'app/views/projects/blob/_header_content.html.haml' do + element :file_name_content + end + + base.view 'app/views/shared/_file_highlight.html.haml' do + element :file_content + end + end + + def has_file?(name) + has_file_name?(name) + end + + def has_no_file?(name) + has_no_file_name?(name) + end + + def has_file_name?(file_name, file_number = nil) + within_file_by_number(file_name_element, file_number) { has_text?(file_name) } + end + + def has_no_file_name?(file_name) + within_element(file_name_element) do + has_no_text?(file_name) + end + end + + def has_file_content?(file_content, file_number = nil) + within_file_by_number(file_content_element, file_number) { has_text?(file_content) } + end + + def has_no_file_content?(file_content) + within_element(file_content_element) do + has_no_text?(file_content) + end + end + + def click_copy_file_contents(file_number = nil) + within_file_by_number(:default_actions_container, file_number) { click_element(:copy_contents_button) } + end + + private + + def file_content_element + feature_flag_controlled_element(:refactor_blob_viewer, :blob_viewer_file_content, :file_content) + end + + def file_name_element + feature_flag_controlled_element(:refactor_blob_viewer, :file_title_content, :file_name_content) + end + + def within_file_by_number(element, file_number) + if file_number + within_element_by_index(element, file_number - 1) { yield } + else + within_element(element) { yield } + end + end + end + end + end +end diff --git a/qa/qa/page/component/issuable/common.rb b/qa/qa/page/component/issuable/common.rb index bbab1746d7a..0d056afd7f0 100644 --- a/qa/qa/page/component/issuable/common.rb +++ b/qa/qa/page/component/issuable/common.rb @@ -10,20 +10,20 @@ module QA def self.included(base) super - base.view 'app/assets/javascripts/issue_show/components/title.vue' do + base.view 'app/assets/javascripts/issues/show/components/title.vue' do element :edit_button element :title, required: true end - base.view 'app/assets/javascripts/issue_show/components/fields/title.vue' do + base.view 'app/assets/javascripts/issues/show/components/fields/title.vue' do element :title_input end - base.view 'app/assets/javascripts/issue_show/components/fields/description.vue' do + base.view 'app/assets/javascripts/issues/show/components/fields/description.vue' do element :description_textarea end - base.view 'app/assets/javascripts/issue_show/components/edit_actions.vue' do + base.view 'app/assets/javascripts/issues/show/components/edit_actions.vue' do element :save_button element :delete_button end diff --git a/qa/qa/page/component/issuable/sidebar.rb b/qa/qa/page/component/issuable/sidebar.rb index 77962570aed..4a81230499c 100644 --- a/qa/qa/page/component/issuable/sidebar.rb +++ b/qa/qa/page/component/issuable/sidebar.rb @@ -18,7 +18,7 @@ module QA element :more_assignees_link end - base.view 'app/assets/javascripts/sidebar/components/labels/sidebar_labels.vue' do + base.view 'app/assets/javascripts/vue_shared/components/sidebar/labels_select_widget/labels_select_root.vue' do element :labels_block end @@ -124,15 +124,6 @@ module QA click_element(:more_assignees_link) end - # When the labels_widget feature flag is enabled, wait until the labels widget appears - def wait_for_labels_widget_feature_flag - Support::Retrier.retry_until(max_duration: 60, reload_page: page, retry_on_exception: true, sleep_interval: 5) do - within_element(:labels_block) do - find_element(:edit_link) - end - end - end - private def wait_assignees_block_finish_loading diff --git a/qa/qa/page/component/snippet.rb b/qa/qa/page/component/snippet.rb index ad264bd6d56..34e884f2a08 100644 --- a/qa/qa/page/component/snippet.rb +++ b/qa/qa/page/component/snippet.rb @@ -26,7 +26,7 @@ module QA end base.view 'app/assets/javascripts/blob/components/blob_content.vue' do - element :file_content + element :blob_viewer_file_content end base.view 'app/assets/javascripts/snippets/components/snippet_header.vue' do @@ -130,11 +130,11 @@ module QA def has_file_content?(file_content, file_number = nil) if file_number - within_element_by_index(:file_content, file_number - 1) do + within_element_by_index(:blob_viewer_file_content, file_number - 1) do has_text?(file_content) end else - within_element(:file_content) do + within_element(:blob_viewer_file_content) do has_text?(file_content) end end @@ -142,11 +142,11 @@ module QA def has_no_file_content?(file_content, file_number = nil) if file_number - within_element_by_index(:file_content, file_number - 1) do + within_element_by_index(:blob_viewer_file_content, file_number - 1) do has_no_text?(file_content) end else - within_element(:file_content) do + within_element(:blob_viewer_file_content) do has_no_text?(file_content) end end @@ -207,7 +207,7 @@ module QA end def has_syntax_highlighting?(language) - within_element(:file_content) do + within_element(:blob_viewer_file_content) do find('.line')['lang'].to_s == language end end diff --git a/qa/qa/page/component/wiki.rb b/qa/qa/page/component/wiki.rb index c3db1d6c885..ffd31f8d7b7 100644 --- a/qa/qa/page/component/wiki.rb +++ b/qa/qa/page/component/wiki.rb @@ -11,10 +11,13 @@ module QA base.view 'app/views/shared/wikis/show.html.haml' do element :wiki_page_title - element :wiki_page_content element :edit_page_button end + base.view 'app/views/shared/wikis/_wiki_content.html.haml' do + element :wiki_page_content + end + base.view 'app/views/shared/wikis/_main_links.html.haml' do element :new_page_button element :page_history_button diff --git a/qa/qa/page/component/wiki_page_form.rb b/qa/qa/page/component/wiki_page_form.rb index fd536ff1dd3..bc73fe0c3ab 100644 --- a/qa/qa/page/component/wiki_page_form.rb +++ b/qa/qa/page/component/wiki_page_form.rb @@ -15,6 +15,7 @@ module QA element :wiki_message_textbox element :wiki_submit_button element :try_new_editor_container + element :editing_mode_button end base.view 'app/assets/javascripts/pages/shared/wikis/components/delete_wiki_modal.vue' do @@ -36,6 +37,10 @@ module QA def click_submit click_element(:wiki_submit_button) + + wait_until(reload: false) do + has_no_element?(:wiki_title_textbox) + end end def delete_page @@ -43,11 +48,19 @@ module QA Page::Modal::DeleteWiki.perform(&:confirm_deletion) end - def use_new_editor - within_element(:try_new_editor_container) do - click_button('Use the new editor') + def use_new_editor(toggle) + # Update once the feature is released, see https://gitlab.com/gitlab-org/gitlab/-/issues/345398 + if toggle + click_element(:editing_mode_button, mode: 'Edit rich text') + else + within_element(:try_new_editor_container) do + click_button('Use the new editor') + end + end + + wait_until(reload: false) do + has_element?(:content_editor_container) end - has_element?(:content_editor_container) end end end diff --git a/qa/qa/page/dashboard/snippet/show.rb b/qa/qa/page/dashboard/snippet/show.rb index 576e287d40d..a314f523108 100644 --- a/qa/qa/page/dashboard/snippet/show.rb +++ b/qa/qa/page/dashboard/snippet/show.rb @@ -6,6 +6,7 @@ module QA module Snippet class Show < Page::Base include Page::Component::Snippet + include Page::Component::BlobContent view 'app/assets/javascripts/snippets/components/snippet_title.vue' do element :snippet_title_content, required: true diff --git a/qa/qa/page/file/shared/commit_message.rb b/qa/qa/page/file/shared/commit_message.rb index 4c25e8a480b..a3658fa11af 100644 --- a/qa/qa/page/file/shared/commit_message.rb +++ b/qa/qa/page/file/shared/commit_message.rb @@ -10,6 +10,10 @@ module QA def self.included(base) super + base.view 'app/assets/javascripts/repository/components/delete_blob_modal.vue' do + element :commit_message_field + end + base.view 'app/views/shared/_commit_message_container.html.haml' do element :commit_message_field end diff --git a/qa/qa/page/file/show.rb b/qa/qa/page/file/show.rb index cefbbbcdba0..730c5a88515 100644 --- a/qa/qa/page/file/show.rb +++ b/qa/qa/page/file/show.rb @@ -8,24 +8,21 @@ module QA include Project::SubMenus::Settings include Project::SubMenus::Common include Layout::Flash + include Page::Component::BlobContent + + view 'app/assets/javascripts/repository/components/blob_button_group.vue' do + element :lock_button + end view 'app/helpers/blob_helper.rb' do element :edit_button, "_('Edit')" # rubocop:disable QA/ElementWithPattern element :delete_button, '_("Delete")' # rubocop:disable QA/ElementWithPattern end - view 'app/views/projects/blob/_header_content.html.haml' do - element :file_name_content - end - view 'app/views/projects/blob/_remove.html.haml' do element :delete_file_button, "button_tag 'Delete file'" # rubocop:disable QA/ElementWithPattern end - view 'app/views/shared/_file_highlight.html.haml' do - element :file_content - end - def click_edit click_on 'Edit' end @@ -37,26 +34,6 @@ module QA def click_delete_file click_on 'Delete file' end - - def has_file?(name) - has_element?(:file_name_content, text: name) - end - - def has_no_file?(name) - has_no_element?(:file_name_content, text: name) - end - - def has_file_content?(file_content, file_number = nil) - if file_number - within_element_by_index(:file_content, file_number - 1) do - has_text?(file_content) - end - else - within_element(:file_content) do - has_text?(file_content) - end - end - end end end end diff --git a/qa/qa/page/main/terms.rb b/qa/qa/page/main/terms.rb index a0de267fb31..024510c33cf 100644 --- a/qa/qa/page/main/terms.rb +++ b/qa/qa/page/main/terms.rb @@ -8,7 +8,7 @@ module QA element :user_avatar, required: true end - view 'app/views/users/terms/index.html.haml' do + view 'app/assets/javascripts/terms/components/app.vue' do element :terms_content, required: true element :accept_terms_button diff --git a/qa/qa/page/project/infrastructure/kubernetes/add_existing.rb b/qa/qa/page/project/infrastructure/kubernetes/add_existing.rb index 689c2a31c4f..2fc65cf0afe 100644 --- a/qa/qa/page/project/infrastructure/kubernetes/add_existing.rb +++ b/qa/qa/page/project/infrastructure/kubernetes/add_existing.rb @@ -20,7 +20,7 @@ module QA end def set_api_url(api_url) - fill_in 'cluster_platform_kubernetes_attributes_api_url', with: QA::Runtime::Env.cluster_api_url || api_url + fill_in 'cluster_platform_kubernetes_attributes_api_url', with: api_url end def set_ca_certificate(ca_certificate) diff --git a/qa/qa/page/project/issue/index.rb b/qa/qa/page/project/issue/index.rb index fc46f7a2936..0d495fc661e 100644 --- a/qa/qa/page/project/issue/index.rb +++ b/qa/qa/page/project/issue/index.rb @@ -5,12 +5,12 @@ module QA module Project module Issue class Index < Page::Base - view 'app/assets/javascripts/issues_list/components/issuable.vue' do - element :issue_container - element :issue_link + view 'app/assets/javascripts/vue_shared/issuable/list/components/issuable_list_root.vue' do + element :issuable_container + element :issuable_search_container end - view 'app/assets/javascripts/vue_shared/components/issue/issue_assignees.vue' do + view 'app/assets/javascripts/issuable/components/issue_assignees.vue' do element :assignee_link element :avatar_counter_content end @@ -25,8 +25,8 @@ module QA element :import_issues_dropdown end - view 'app/views/shared/issuable/_nav.html.haml' do - element :closed_issues_link + view 'app/assets/javascripts/vue_shared/issuable/list/components/issuable_tabs.vue' do + element :closed_issuables_tab, ':data-qa-selector="`${tab.name}_issuables_tab`"' # rubocop:disable QA/ElementWithPattern end def avatar_counter @@ -37,8 +37,8 @@ module QA click_link(title) end - def click_closed_issues_link - click_element :closed_issues_link + def click_closed_issues_tab + click_element(:closed_issuables_tab) end def click_export_as_csv_button @@ -73,11 +73,17 @@ module QA end def has_issue?(issue) - has_element? :issue_container, issue_title: issue.title + has_element? :issuable_container, issuable_title: issue.title end def has_no_issue?(issue) - has_no_element? :issue_container, issue_title: issue.title + has_no_element? :issuable_container, issuable_title: issue.title + end + + def wait_for_vue_issues_list_ff + Support::Retrier.retry_until(max_duration: 60, reload_page: page, retry_on_exception: true, sleep_interval: 5) do + find_element(:closed_issuables_tab) + end end end end diff --git a/qa/qa/page/project/issue/show.rb b/qa/qa/page/project/issue/show.rb index 3b033830420..b37210f4d3f 100644 --- a/qa/qa/page/project/issue/show.rb +++ b/qa/qa/page/project/issue/show.rb @@ -11,11 +11,11 @@ module QA include Page::Component::Issuable::Sidebar prepend Mobile::Page::Project::Issue::Show if Runtime::Env.mobile_layout? - view 'app/assets/javascripts/vue_shared/components/issue/related_issuable_item.vue' do + view 'app/assets/javascripts/issuable/components/related_issuable_item.vue' do element :remove_related_issue_button end - view 'app/assets/javascripts/issue_show/components/header_actions.vue' do + view 'app/assets/javascripts/issues/show/components/header_actions.vue' do element :close_issue_button element :reopen_issue_button end diff --git a/qa/qa/page/project/packages/index.rb b/qa/qa/page/project/packages/index.rb index 7794677b9b5..86a86c05c12 100644 --- a/qa/qa/page/project/packages/index.rb +++ b/qa/qa/page/project/packages/index.rb @@ -5,7 +5,7 @@ module QA module Project module Packages class Index < QA::Page::Base - view 'app/assets/javascripts/packages/shared/components/package_list_row.vue' do + view 'app/assets/javascripts/packages_and_registries/package_registry/components/list/package_list_row.vue' do element :package_row element :package_link end @@ -15,7 +15,7 @@ module QA end def has_package?(name) - has_element?(:package_link, text: name) + has_element?(:package_link, text: name, wait: 20) end def has_no_package?(name) diff --git a/qa/qa/page/project/pipeline/show.rb b/qa/qa/page/project/pipeline/show.rb index d45eeac46f6..83a49ae6361 100644 --- a/qa/qa/page/project/pipeline/show.rb +++ b/qa/qa/page/project/pipeline/show.rb @@ -77,7 +77,10 @@ module QA end def click_job(job_name) - click_element(:job_link, Project::Job::Show, text: job_name) + # Retry due to transient bug https://gitlab.com/gitlab-org/gitlab/-/issues/347126 + QA::Support::Retrier.retry_on_exception do + click_element(:job_link, Project::Job::Show, text: job_name) + end end def child_pipelines diff --git a/qa/qa/page/project/pipeline_editor/show.rb b/qa/qa/page/project/pipeline_editor/show.rb index 38c87c8daa1..e430884ea08 100644 --- a/qa/qa/page/project/pipeline_editor/show.rb +++ b/qa/qa/page/project/pipeline_editor/show.rb @@ -6,37 +6,59 @@ module QA module PipelineEditor class Show < QA::Page::Base view 'app/assets/javascripts/pipeline_editor/components/file_nav/branch_switcher.vue' do - element :branch_selector_button - element :menu_branch_button + element :branch_selector_button, require: true + element :branch_menu_item_button + element :branch_menu_container end view 'app/assets/javascripts/pipeline_editor/components/commit/commit_form.vue' do - element :target_branch_field + element :target_branch_field, require: true end - def has_branch_selector_button? - has_element? :branch_selector_button + view 'app/assets/javascripts/pipeline_editor/components/drawer/pipeline_editor_drawer.vue' do + element :toggle_sidebar_collapse_button + element :drawer_content end - def click_branch_selector_button - wait_until(reload: false) do - has_element?(:branch_selector_button) - end - click_element(:branch_selector_button, skip_finished_loading_check: true) + view 'app/assets/javascripts/vue_shared/components/source_editor.vue' do + element :source_editor_container, require: true end - def select_branch_from_dropdown(branch_to_switch_to) - wait_until(reload: false) do - has_element?(:menu_branch_button) - end - click_element(:menu_branch_button, text: branch_to_switch_to, skip_finished_loading_check: true) + def initialize + super + + wait_for_requests + close_toggle_sidebar + end + + def open_branch_selector_dropdown + click_element(:branch_selector_button) + end + + def select_branch_from_dropdown(branch_name) + wait_for_animated_element(:branch_menu_container) + click_element(:branch_menu_item_button, text: branch_name) + + wait_for_requests end def target_branch_name - wait_until(reload: false) do - has_element?(:target_branch_field) - end - find_element(:target_branch_field, skip_finished_loading_check: true).value + find_element(:target_branch_field).value + end + + def editing_content + find_element(:source_editor_container).text + end + + private + + # If the page thinks user has never opened pipeline editor before + # It will expand pipeline editor sidebar by default + # Collapse the sidebar if it is expanded + def close_toggle_sidebar + return unless has_element?(:drawer_content) + + click_element(:toggle_sidebar_collapse_button) end end end diff --git a/qa/qa/page/project/settings/advanced.rb b/qa/qa/page/project/settings/advanced.rb index 0ba856e8a6e..da1f16f4cfc 100644 --- a/qa/qa/page/project/settings/advanced.rb +++ b/qa/qa/page/project/settings/advanced.rb @@ -5,7 +5,6 @@ module QA module Project module Settings class Advanced < Page::Base - include Component::Select2 include Component::ConfirmModal view 'app/views/projects/edit.html.haml' do @@ -13,8 +12,10 @@ module QA element :change_path_button end - view 'app/views/projects/_transfer.html.haml' do - element :transfer_button + view "app/assets/javascripts/vue_shared/components/namespace_select/namespace_select.vue" do + element :namespaces_list + element :namespaces_list_groups + element :namespaces_list_item end view 'app/views/projects/settings/_archive.html.haml' do @@ -42,16 +43,22 @@ module QA click_element :change_path_button end + def select_namespace(item) + click_element :namespaces_list + + within_element(:namespaces_list) do + find_element(:namespaces_list_item, text: item).click + end + end + def transfer_project!(project_name, namespace) QA::Runtime::Logger.info "Transferring project: #{project_name} to namespace: #{namespace}" click_element_coordinates(:archive_project_content) - expand_select_list - # Workaround for a failure to search when there are no spaces around the / # https://gitlab.com/gitlab-org/gitlab/-/issues/218965 - search_and_select(namespace.gsub(%r{([^\s])/([^\s])}, '\1 / \2')) + select_namespace(namespace.gsub(%r{([^\s])/([^\s])}, '\1 / \2')) click_element(:transfer_button) fill_confirmation_text(project_name) diff --git a/qa/qa/page/project/settings/services/jira.rb b/qa/qa/page/project/settings/services/jira.rb index 0a56aaa758e..827508e488c 100644 --- a/qa/qa/page/project/settings/services/jira.rb +++ b/qa/qa/page/project/settings/services/jira.rb @@ -23,6 +23,11 @@ module QA element :save_changes_button end + view 'app/assets/javascripts/integrations/edit/components/jira_issues_fields.vue' do + element :service_jira_issues_enabled_checkbox + element :service_jira_project_key_field + end + def setup_service_with(url:) QA::Runtime::Logger.info "Setting up JIRA" @@ -34,12 +39,22 @@ module QA use_custom_transitions set_transition_ids('11,21,31,41') + yield self if block_given? + click_save_changes_button wait_until(reload: false) do has_element?(:save_changes_button, wait: 1) ? !find_element(:save_changes_button).disabled? : true end end + def enable_jira_issues + check_element(:service_jira_issues_enabled_checkbox, true) + end + + def set_jira_project_key(key) + fill_element(:service_jira_project_key_field, key) + end + private def set_jira_server_url(url) diff --git a/qa/qa/page/project/show.rb b/qa/qa/page/project/show.rb index 65a1f726a8a..8074b6f833b 100644 --- a/qa/qa/page/project/show.rb +++ b/qa/qa/page/project/show.rb @@ -45,10 +45,6 @@ module QA element :tree_holder, '.tree-holder' # rubocop:disable QA/ElementWithPattern end - view 'app/views/projects/buttons/_dropdown.html.haml' do - element :create_new_dropdown - end - view 'app/views/projects/buttons/_fork.html.haml' do element :fork_label, "%span= s_('ProjectOverview|Fork')" # rubocop:disable QA/ElementWithPattern element :fork_link, "link_to new_project_fork_path(@project)" # rubocop:disable QA/ElementWithPattern diff --git a/qa/qa/page/project/snippet/index.rb b/qa/qa/page/project/snippet/index.rb index fc677f96769..704698dc9d8 100644 --- a/qa/qa/page/project/snippet/index.rb +++ b/qa/qa/page/project/snippet/index.rb @@ -6,6 +6,7 @@ module QA module Snippet class Index < Page::Base include Page::Component::Snippet + include Page::Component::BlobContent view 'app/views/shared/snippets/_snippet.html.haml' do element :snippet_link diff --git a/qa/qa/page/project/snippet/show.rb b/qa/qa/page/project/snippet/show.rb index f66fa2cbe51..89723baf424 100644 --- a/qa/qa/page/project/snippet/show.rb +++ b/qa/qa/page/project/snippet/show.rb @@ -6,6 +6,7 @@ module QA module Snippet class Show < Page::Base include Page::Component::Snippet + include Page::Component::BlobContent view 'app/views/projects/notes/_actions.html.haml' do element :edit_comment_button diff --git a/qa/qa/page/project/sub_menus/issues.rb b/qa/qa/page/project/sub_menus/issues.rb index 1df93d1118b..48cdf9791f8 100644 --- a/qa/qa/page/project/sub_menus/issues.rb +++ b/qa/qa/page/project/sub_menus/issues.rb @@ -51,6 +51,14 @@ module QA end end + def go_to_jira_issues + hover_issues do + within_submenu do + click_element(:sidebar_menu_item_link, menu_item: 'Jira issues') + end + end + end + private def hover_issues |