diff options
Diffstat (limited to 'qa/qa/page')
-rw-r--r-- | qa/qa/page/base.rb | 4 | ||||
-rw-r--r-- | qa/qa/page/component/confirm_modal.rb | 6 | ||||
-rw-r--r-- | qa/qa/page/component/invite_members_modal.rb | 44 | ||||
-rw-r--r-- | qa/qa/page/dashboard/welcome.rb | 4 | ||||
-rw-r--r-- | qa/qa/page/file/show.rb | 20 | ||||
-rw-r--r-- | qa/qa/page/main/login.rb | 5 | ||||
-rw-r--r-- | qa/qa/page/project/branches/show.rb | 1 | ||||
-rw-r--r-- | qa/qa/page/project/members.rb | 5 | ||||
-rw-r--r-- | qa/qa/page/project/new.rb | 1 | ||||
-rw-r--r-- | qa/qa/page/project/packages/show.rb | 2 | ||||
-rw-r--r-- | qa/qa/page/project/pipeline_editor/show.rb | 83 | ||||
-rw-r--r-- | qa/qa/page/project/secure/configuration_form.rb | 46 | ||||
-rw-r--r-- | qa/qa/page/project/settings/visibility_features_permissions.rb | 7 | ||||
-rw-r--r-- | qa/qa/page/registration/sign_up.rb | 4 | ||||
-rw-r--r-- | qa/qa/page/registration/welcome.rb | 23 | ||||
-rw-r--r-- | qa/qa/page/trials/new.rb | 18 |
16 files changed, 217 insertions, 56 deletions
diff --git a/qa/qa/page/base.rb b/qa/qa/page/base.rb index 69f58dcb8a5..526dd25ccc9 100644 --- a/qa/qa/page/base.rb +++ b/qa/qa/page/base.rb @@ -386,6 +386,10 @@ module QA end end + def current_host + URI(page.current_url).host + end + def self.path raise NotImplementedError end diff --git a/qa/qa/page/component/confirm_modal.rb b/qa/qa/page/component/confirm_modal.rb index 25eea8e0d93..a90be76c879 100644 --- a/qa/qa/page/component/confirm_modal.rb +++ b/qa/qa/page/component/confirm_modal.rb @@ -8,12 +8,6 @@ module QA def self.included(base) super - - base.view 'app/views/shared/_confirm_modal.html.haml' do - element :confirm_modal - element :confirm_input - element :confirm_button - end end def fill_confirmation_text(text) diff --git a/qa/qa/page/component/invite_members_modal.rb b/qa/qa/page/component/invite_members_modal.rb index fecd61fb410..ca6862ccb02 100644 --- a/qa/qa/page/component/invite_members_modal.rb +++ b/qa/qa/page/component/invite_members_modal.rb @@ -47,37 +47,43 @@ module QA fill_element :members_token_select_input, username Support::WaitForRequests.wait_for_requests click_button username - - # Guest option is selected by default, skipping these steps if desired option is 'Guest' - unless access_level == 'Guest' - click_element :access_level_dropdown - click_button access_level - end - - click_element :invite_button + set_access_level(access_level) end - Support::WaitForRequests.wait_for_requests - - page.refresh + send_invite end - def invite_group(group_name, group_access = Resource::Members::AccessLevel::GUEST) + def invite_group(group_name, access_level = 'Guest') open_invite_group_modal - fill_element :access_level_dropdown, with: group_access + within_element(:invite_members_modal_content) do + click_button 'Select a group' - click_button 'Select a group' - fill_element :group_select_dropdown_search_field, group_name + # Helps stabilize race condition with concurrent group API calls while searching + # TODO: Replace with `fill_element :group_select_dropdown_search_field, group_name` when this bug is resolved: https://gitlab.com/gitlab-org/gitlab/-/issues/349379 + send_keys_to_element(:group_select_dropdown_search_field, group_name) - Support::WaitForRequests.wait_for_requests + Support::WaitForRequests.wait_for_requests + click_button group_name + set_access_level(access_level) + end - click_button group_name + send_invite + end - click_element :invite_button + private - Support::WaitForRequests.wait_for_requests + def set_access_level(access_level) + # Guest option is selected by default, skipping these steps if desired option is 'Guest' + unless access_level == 'Guest' + click_element :access_level_dropdown + click_button access_level + end + end + def send_invite + click_element :invite_button + Support::WaitForRequests.wait_for_requests page.refresh end end diff --git a/qa/qa/page/dashboard/welcome.rb b/qa/qa/page/dashboard/welcome.rb index b54205780d9..6f645e168c7 100644 --- a/qa/qa/page/dashboard/welcome.rb +++ b/qa/qa/page/dashboard/welcome.rb @@ -11,6 +11,10 @@ module QA def has_welcome_title?(text) has_element?(:welcome_title_content, text: text) end + + def self.path + '/' + end end end end diff --git a/qa/qa/page/file/show.rb b/qa/qa/page/file/show.rb index 730c5a88515..e54c3e0cd07 100644 --- a/qa/qa/page/file/show.rb +++ b/qa/qa/page/file/show.rb @@ -23,8 +23,26 @@ module QA element :delete_file_button, "button_tag 'Delete file'" # rubocop:disable QA/ElementWithPattern end + view 'app/assets/javascripts/vue_shared/components/web_ide_link.vue' do + element :edit_button + end + + view 'app/assets/javascripts/vue_shared/components/actions_button.vue' do + element :action_dropdown + element :edit_menu_item, ':data-qa-selector="`${action.key}_menu_item`"' # rubocop:disable QA/ElementWithPattern + end + def click_edit - click_on 'Edit' + # TODO: remove this condition and else part once ff :consolidated_edit_button is enabled by default + if has_element?(:action_dropdown) + within_element(:action_dropdown) do + click_button(class: 'dropdown-toggle-split') + click_element(:edit_menu_item) + click_element(:edit_button) + end + else + click_on 'Edit' + end end def click_delete diff --git a/qa/qa/page/main/login.rb b/qa/qa/page/main/login.rb index 5cba9d4bce4..f004107d7bd 100644 --- a/qa/qa/page/main/login.rb +++ b/qa/qa/page/main/login.rb @@ -156,6 +156,11 @@ module QA sign_in_using_credentials(user: user) end + def redirect_to_login_page(address) + desired_host = URI(Runtime::Scenario.send("#{address}_address")).host + Runtime::Browser.visit(address, Page::Main::Login) if desired_host != current_host + end + private def sign_in_using_gitlab_credentials(user:, skip_page_validation: false) diff --git a/qa/qa/page/project/branches/show.rb b/qa/qa/page/project/branches/show.rb index afec0e27a0b..a19fcf8ec6e 100644 --- a/qa/qa/page/project/branches/show.rb +++ b/qa/qa/page/project/branches/show.rb @@ -14,7 +14,6 @@ module QA end view 'app/views/projects/branches/_branch.html.haml' do - element :remove_btn element :branch_name end diff --git a/qa/qa/page/project/members.rb b/qa/qa/page/project/members.rb index eeb589d6ca8..1102abd6646 100644 --- a/qa/qa/page/project/members.rb +++ b/qa/qa/page/project/members.rb @@ -41,6 +41,11 @@ module QA click_button 'Remove group' end end + + def has_group?(group_name) + click_element :groups_list_tab + has_element?(:group_row, text: group_name) + end end end end diff --git a/qa/qa/page/project/new.rb b/qa/qa/page/project/new.rb index 5ff52527774..42baf1f3f87 100644 --- a/qa/qa/page/project/new.rb +++ b/qa/qa/page/project/new.rb @@ -14,7 +14,6 @@ module QA view 'app/views/projects/_new_project_fields.html.haml' do element :initialize_with_readme_checkbox element :initialize_with_sast_checkbox - element :project_namespace_field, 'namespaces_options' # rubocop:disable QA/ElementWithPattern element :project_name, 'text_field :name' # rubocop:disable QA/ElementWithPattern element :project_path, 'text_field :path' # rubocop:disable QA/ElementWithPattern element :project_description, 'text_area :description' # rubocop:disable QA/ElementWithPattern diff --git a/qa/qa/page/project/packages/show.rb b/qa/qa/page/project/packages/show.rb index 4872c0bc705..5ba9ad7df40 100644 --- a/qa/qa/page/project/packages/show.rb +++ b/qa/qa/page/project/packages/show.rb @@ -5,7 +5,7 @@ module QA module Project module Packages class Show < QA::Page::Base - view 'app/assets/javascripts/packages_and_registries/package_registry/components/details/app.vue' do + view 'app/assets/javascripts/packages_and_registries/package_registry/pages/details.vue' do element :delete_button element :delete_modal_button element :package_information_content diff --git a/qa/qa/page/project/pipeline_editor/show.rb b/qa/qa/page/project/pipeline_editor/show.rb index e430884ea08..8289039d4c5 100644 --- a/qa/qa/page/project/pipeline_editor/show.rb +++ b/qa/qa/page/project/pipeline_editor/show.rb @@ -24,6 +24,27 @@ module QA element :source_editor_container, require: true end + view 'app/assets/javascripts/pipeline_editor/components/header/pipeline_status.vue' do + element :pipeline_id_content + end + + view 'app/assets/javascripts/pipeline_editor/components/commit/commit_form.vue' do + element :commit_changes_button + end + + view 'app/assets/javascripts/pipeline_editor/components/header/validation_segment.vue' do + element :validation_message_content + end + + view 'app/assets/javascripts/pipelines/components/pipeline_graph/pipeline_graph.vue' do + element :stage_container + element :job_container + end + + view 'app/assets/javascripts/pipeline_editor/components/pipeline_editor_tabs.vue' do + element :file_editor_container + end + def initialize super @@ -50,8 +71,70 @@ module QA find_element(:source_editor_container).text end + def write_to_editor(text) + find_element(:source_editor_container).fill_in(with: text) + end + + def submit_changes + click_element(:commit_changes_button) + + wait_for_requests + end + + def set_target_branch(name) + find_element(:target_branch_field).fill_in(with: name) + end + + def current_branch + find_element(:branch_selector_button).text + end + + def pipeline_id + find_element(:pipeline_id_content).text.delete!('#').to_i + end + + def ci_syntax_validate_message + find_element(:validation_message_content).text + end + + def go_to_visualize_tab + go_to_tab('Visualize') + end + + def go_to_lint_tab + go_to_tab('Lint') + end + + def go_to_view_merged_yaml_tab + go_to_tab('View merged YAML') + end + + def has_source_editor? + has_element?(:source_editor_container) + end + + def has_stage?(name) + all_elements(:stage_container, minimum: 1).any? { |item| item.text.match(/#{name}/i) } + end + + def has_job?(name) + all_elements(:job_container, minimum: 1).any? { |item| item.text.match(/#{name}/i) } + end + + def tab_alert_message + within_element(:file_editor_container) do + find('.gl-alert-body').text + end + end + private + def go_to_tab(name) + within_element(:file_editor_container) do + find('.nav-item', text: name).click + end + end + # 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 diff --git a/qa/qa/page/project/secure/configuration_form.rb b/qa/qa/page/project/secure/configuration_form.rb index 3e89a57e870..fa1fad44273 100644 --- a/qa/qa/page/project/secure/configuration_form.rb +++ b/qa/qa/page/project/secure/configuration_form.rb @@ -8,6 +8,10 @@ module QA include QA::Page::Component::Select2 include QA::Page::Settings::Common + view 'app/assets/javascripts/security_configuration/components/app.vue' do + element :security_configuration_history_link + end + view 'app/assets/javascripts/security_configuration/components/feature_card.vue' do element :dependency_scanning_status, "`${feature.type}_status`" # rubocop:disable QA/ElementWithPattern element :sast_status, "`${feature.type}_status`" # rubocop:disable QA/ElementWithPattern @@ -15,6 +19,22 @@ module QA element :dependency_scanning_mr_button, "`${feature.type}_mr_button`" # rubocop:disable QA/ElementWithPattern end + view 'app/assets/javascripts/security_configuration/components/auto_dev_ops_alert.vue' do + element :autodevops_container + end + + def has_security_configuration_history_link? + has_element?(:security_configuration_history_link) + end + + def has_no_security_configuration_history_link? + has_no_element?(:security_configuration_history_link) + end + + def click_security_configuration_history_link + click_element(:security_configuration_history_link) + end + def click_sast_enable_button click_element(:sast_enable_button) end @@ -29,11 +49,37 @@ module QA end end + def has_no_sast_status?(status_text) + within_element(:sast_status) do + has_no_text?(status_text) + end + end + def has_dependency_scanning_status?(status_text) within_element(:dependency_scanning_status) do has_text?(status_text) end end + + def has_no_dependency_scanning_status?(status_text) + within_element(:dependency_scanning_status) do + has_no_text?(status_text) + end + end + + def has_auto_devops_container? + has_element?(:autodevops_container) + end + + def has_no_auto_devops_container? + has_no_element?(:autodevops_container) + end + + def has_auto_devops_container_description? + within_element(:autodevops_container) do + has_text?('Quickly enable all continuous testing and compliance tools by enabling Auto DevOps') + end + end end end end diff --git a/qa/qa/page/project/settings/visibility_features_permissions.rb b/qa/qa/page/project/settings/visibility_features_permissions.rb index 1d6686ae360..60cea6de7f5 100644 --- a/qa/qa/page/project/settings/visibility_features_permissions.rb +++ b/qa/qa/page/project/settings/visibility_features_permissions.rb @@ -5,14 +5,9 @@ module QA module Project module Settings class VisibilityFeaturesPermissions < Page::Base - include QA::Page::Component::Select2 - - view 'app/views/projects/edit.html.haml' do - element :visibility_features_permissions_save_button - end - view 'app/assets/javascripts/pages/projects/shared/permissions/components/settings_panel.vue' do element :project_visibility_dropdown + element :visibility_features_permissions_save_button end def set_project_visibility(visibility) diff --git a/qa/qa/page/registration/sign_up.rb b/qa/qa/page/registration/sign_up.rb index 6d1b9cb3615..4fedc05c702 100644 --- a/qa/qa/page/registration/sign_up.rb +++ b/qa/qa/page/registration/sign_up.rb @@ -16,10 +16,6 @@ module QA element :new_user_username_field end - view 'app/views/registrations/welcome/show.html.haml' do - element :get_started_button - end - def fill_new_user_first_name_field(first_name) fill_element :new_user_first_name_field, first_name end diff --git a/qa/qa/page/registration/welcome.rb b/qa/qa/page/registration/welcome.rb index ff22e62b63e..660b33b4f5b 100644 --- a/qa/qa/page/registration/welcome.rb +++ b/qa/qa/page/registration/welcome.rb @@ -6,14 +6,25 @@ module QA class Welcome < Page::Base view 'app/views/registrations/welcome/show.html.haml' do element :get_started_button + element :role_dropdown end - def click_get_started_button_if_available - if has_element?(:get_started_button) - Support::Retrier.retry_until do - click_element :get_started_button - has_no_element?(:get_started_button) - end + def has_get_started_button? + has_element?(:get_started_button) + end + + def select_role(role) + select_element(:role_dropdown, role) + end + + def choose_setup_for_company_if_available + # Only implemented in EE + end + + def click_get_started_button + Support::Retrier.retry_until do + click_element :get_started_button + has_no_element?(:get_started_button) end end end diff --git a/qa/qa/page/trials/new.rb b/qa/qa/page/trials/new.rb index 268f3b71717..6e9d7fce688 100644 --- a/qa/qa/page/trials/new.rb +++ b/qa/qa/page/trials/new.rb @@ -6,17 +6,13 @@ module QA class New < Chemlab::Page path '/-/trials/new' - # TODO: Supplant with data-qa-selectors - text_field :first_name, id: 'first_name' - text_field :last_name, id: 'last_name' - text_field :company_name, id: 'company_name' - select :number_of_employees, id: 'company_size' - text_field :telephone_number, id: 'phone_number' - text_field :number_of_users, id: 'number_of_users' - - select :country, id: 'country_select' - - button :continue, value: 'Continue' + text_field :first_name + text_field :last_name + text_field :company_name + select :number_of_employees + text_field :telephone_number + select :country + button :continue end end end |