diff --git a/app/views/admin/application_settings/metrics_and_profiling.html.haml b/app/views/admin/application_settings/metrics_and_profiling.html.haml index ed1342be1fc51ec94822a7493690d0f6bb1699ee..12b9df6719d03cd8f648c10f19d235cae5f3bad2 100644 --- a/app/views/admin/application_settings/metrics_and_profiling.html.haml +++ b/app/views/admin/application_settings/metrics_and_profiling.html.haml @@ -41,7 +41,7 @@ .settings-content = render 'performance_bar' -%section.settings.as-usage.no-animate#js-usage-settings{ class: ('expanded' if expanded_by_default?), data: { qa_selector: 'usage_statistics_settings_content' } } +%section.settings.as-usage.no-animate#js-usage-settings{ class: ('expanded' if expanded_by_default?), data: { testid: 'usage-statistics-settings-content' } } .settings-header#usage-statistics %h4.settings-title.js-settings-toggle.js-settings-toggle-trigger-only = _('Usage statistics') diff --git a/app/views/import/gitlab_projects/new.html.haml b/app/views/import/gitlab_projects/new.html.haml index 079123e989e656613d8fa60ce06fde384ccb14eb..8e51eafd84c521ed5e98a2a4d3e6b267d64d86b6 100644 --- a/app/views/import/gitlab_projects/new.html.haml +++ b/app/views/import/gitlab_projects/new.html.haml @@ -21,7 +21,7 @@ = file_field_tag :file, class: '' .row .form-actions.col-sm-12 - = render Pajamas::ButtonComponent.new(type: :submit, variant: :confirm, button_options: { class: 'gl-mr-2', data: { qa_selector: 'import_project_button' }}) do + = render Pajamas::ButtonComponent.new(type: :submit, variant: :confirm, button_options: { class: 'gl-mr-2', data: { testid: 'import-project-button' }}) do = _('Import project') = render Pajamas::ButtonComponent.new(href: new_project_path) do = _('Cancel') diff --git a/app/views/import/shared/_new_project_form.html.haml b/app/views/import/shared/_new_project_form.html.haml index 6000612a285832782cd6a878399ecb8c85199522..042d94ad1b6a9d743ae47f984dc6500272228222 100644 --- a/app/views/import/shared/_new_project_form.html.haml +++ b/app/views/import/shared/_new_project_form.html.haml @@ -1,7 +1,7 @@ .row .form-group.project-name.col-sm-12 = label_tag :name, _('Project name'), class: 'label-bold' - = text_field_tag :name, @name, placeholder: "My awesome project", class: "js-project-name form-control gl-form-input input-lg", autofocus: true, required: true, aria: { required: true }, data: { qa_selector: 'project_name_field' } + = text_field_tag :name, @name, placeholder: "My awesome project", class: "js-project-name form-control gl-form-input input-lg", autofocus: true, required: true, aria: { required: true }, data: { testid: 'project-name-field' } .form-group.col-12.col-sm-6.gl-pr-0 = label_tag :namespace_id, _('Project URL'), class: 'label-bold' .input-group.gl-flex-nowrap @@ -21,4 +21,4 @@ .gl-align-self-center.gl-pl-5 / .form-group.col-12.col-sm-6.project-path = label_tag :path, _('Project slug'), class: 'label-bold' - = text_field_tag :path, @path, placeholder: "my-awesome-project", class: "js-path-name form-control gl-form-input", required: true, aria: { required: true }, data: { qa_selector: 'project_slug_field' } + = text_field_tag :path, @path, placeholder: "my-awesome-project", class: "js-path-name form-control gl-form-input", required: true, aria: { required: true } diff --git a/app/views/projects/_import_project_pane.html.haml b/app/views/projects/_import_project_pane.html.haml index 6315c6dc52d7e0c213d2c5beaf16ed7de7192a56..3e92ef25552f36cd748214af63b76ab3338b80e0 100644 --- a/app/views/projects/_import_project_pane.html.haml +++ b/app/views/projects/_import_project_pane.html.haml @@ -17,7 +17,7 @@ = html_escape(_("Importing GitLab projects? Migrating GitLab projects when migrating groups by direct transfer is in Beta. %{link_start}Learn more.%{link_end}")) % { link_start: docs_link, link_end: '</a>'.html_safe } .import-buttons - if gitlab_project_import_enabled? - .import_gitlab_project.has-tooltip{ data: { container: 'body', qa_selector: 'gitlab_import_button' } } + .import_gitlab_project.has-tooltip{ data: { container: 'body', testid: 'gitlab-import-button' } } = render Pajamas::ButtonComponent.new(href: '#', icon: 'tanuki', button_options: { class: 'btn_import_gitlab_project js-import-project-btn', data: { href: new_import_gitlab_project_path, platform: 'gitlab_export', **tracking_attrs_data(track_label, 'click_button', 'gitlab_export') } }) do = _('GitLab export') diff --git a/qa/qa/page/admin/settings/metrics_and_profiling.rb b/qa/qa/page/admin/settings/metrics_and_profiling.rb index aa2399ba810d9200b858c1b343158e8e7a06dd8d..2e919dd171aa5722d896f387fc973e124a9bf351 100644 --- a/qa/qa/page/admin/settings/metrics_and_profiling.rb +++ b/qa/qa/page/admin/settings/metrics_and_profiling.rb @@ -9,7 +9,7 @@ class MetricsAndProfiling < Page::Base view 'app/views/admin/application_settings/metrics_and_profiling.html.haml' do element 'performance-bar-settings-content' - element :usage_statistics_settings_content + element 'usage-statistics-settings-content' end def expand_performance_bar(&block) @@ -19,7 +19,7 @@ def expand_performance_bar(&block) end def expand_usage_statistics(&block) - expand_content(:usage_statistics_settings_content) do + expand_content('usage-statistics-settings-content') do Component::UsageStatistics.perform(&block) end end diff --git a/qa/qa/page/component/import/gitlab.rb b/qa/qa/page/component/import/gitlab.rb index 1cb8a099a701b79bbacf7e33d350e06f094120ee..6c5516dd2e2fe90fa684b0e6f5e6089a0c730212 100644 --- a/qa/qa/page/component/import/gitlab.rb +++ b/qa/qa/page/component/import/gitlab.rb @@ -11,17 +11,16 @@ def self.included(base) super base.view 'app/views/import/gitlab_projects/new.html.haml' do - element :import_project_button + element 'import-project-button' end base.view 'app/views/import/shared/_new_project_form.html.haml' do - element :project_name_field - element :project_slug_field + element 'project-name-field' end end def set_imported_project_name(name) - fill_element(:project_name_field, name) + fill_element('project-name-field', name) end def attach_exported_file(path) @@ -29,7 +28,7 @@ def attach_exported_file(path) end def click_import_gitlab_project - click_element(:import_project_button) + click_element('import-project-button') wait_until(reload: false) do has_notice?("The project was successfully imported.") || has_element?('project-name-content') diff --git a/qa/qa/page/component/import/selection.rb b/qa/qa/page/component/import/selection.rb index db2ff74e0f8ab4ea62e0d67fe09568ee5c4b3869..bd3268c3b16efffc311521bfbac584794a43b66f 100644 --- a/qa/qa/page/component/import/selection.rb +++ b/qa/qa/page/component/import/selection.rb @@ -9,16 +9,16 @@ def self.included(base) super base.view 'app/views/projects/_import_project_pane.html.haml' do - element :gitlab_import_button + element 'gitlab-import-button' end end def click_gitlab retry_until(reload: true, max_attempts: 10, message: 'Waiting for import source to be enabled') do - has_element?(:gitlab_import_button) + has_element?('gitlab-import-button') end - click_element(:gitlab_import_button) + click_element('gitlab-import-button') end end end