Commit 7caed114 authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Merge branch 'cngo-improve-feature-tests' into 'master'

Improve feature tests

See merge request gitlab-org/gitlab!72326
parents 97e3d4d6 1b217d87
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
%li= s_("GroupSettings|If the parent group's visibility is lower than the group current visibility, visibility levels for subgroups and projects will be changed to match the new parent group's visibility.") %li= s_("GroupSettings|If the parent group's visibility is lower than the group current visibility, visibility levels for subgroups and projects will be changed to match the new parent group's visibility.")
- if group.paid? - if group.paid?
.gl-alert.gl-alert-info.gl-mb-5{ data: { testid: 'group-to-transfer-has-linked-subscription-alert' } } .gl-alert.gl-alert-info.gl-mb-5
= sprite_icon('information-o', size: 16, css_class: 'gl-icon gl-alert-icon gl-alert-icon-no-title') = sprite_icon('information-o', size: 16, css_class: 'gl-icon gl-alert-icon gl-alert-icon-no-title')
.gl-alert-body .gl-alert-body
= html_escape(_("This group can't be transfered because it is linked to a subscription. To transfer this group, %{linkStart}link the subscription%{linkEnd} with a different group.")) % { linkStart: "<a href=\"#{help_page_path('subscriptions/index', anchor: 'change-the-linked-namespace')}\">".html_safe, linkEnd: '</a>'.html_safe } = html_escape(_("This group can't be transfered because it is linked to a subscription. To transfer this group, %{linkStart}link the subscription%{linkEnd} with a different group.")) % { linkStart: "<a href=\"#{help_page_path('subscriptions/index', anchor: 'change-the-linked-namespace')}\">".html_safe, linkEnd: '</a>'.html_safe }
......
...@@ -190,7 +190,7 @@ RSpec.describe 'Admin::AuditLogs', :js do ...@@ -190,7 +190,7 @@ RSpec.describe 'Admin::AuditLogs', :js do
click_link 'Impersonate' click_link 'Impersonate'
visit(new_project_path) visit(new_project_path)
find('[data-qa-panel-name="blank_project"]').click # rubocop:disable QA/SelectorUsage click_link 'Create blank project'
fill_in(:project_name, with: 'Gotham City') fill_in(:project_name, with: 'Gotham City')
......
...@@ -31,7 +31,7 @@ RSpec.describe 'Delete Epic', :js do ...@@ -31,7 +31,7 @@ RSpec.describe 'Delete Epic', :js do
end end
it 'deletes the issue and redirect to epic list' do it 'deletes the issue and redirect to epic list' do
find('.qa-delete-button').click # rubocop:disable QA/SelectorUsage click_button 'Delete epic'
wait_for_requests wait_for_requests
find('.js-modal-action-primary').click find('.js-modal-action-primary').click
......
...@@ -43,7 +43,7 @@ RSpec.describe 'Project' do ...@@ -43,7 +43,7 @@ RSpec.describe 'Project' do
new_path = 'example-custom-project-template' new_path = 'example-custom-project-template'
new_name = 'Example Custom Project Template' new_name = 'Example Custom Project Template'
find('[data-qa-panel-name="create_from_template"]').click # rubocop:disable QA/SelectorUsage click_link 'Create from template'
find('.project-template .custom-instance-project-templates-tab').click find('.project-template .custom-instance-project-templates-tab').click
find("label[for='#{projects.first.name}']").click find("label[for='#{projects.first.name}']").click
...@@ -68,7 +68,7 @@ RSpec.describe 'Project' do ...@@ -68,7 +68,7 @@ RSpec.describe 'Project' do
new_path = 'example-custom-project-template' new_path = 'example-custom-project-template'
new_name = 'Example Custom Project Template' new_name = 'Example Custom Project Template'
find('[data-qa-panel-name="create_from_template"]').click # rubocop:disable QA/SelectorUsage click_link 'Create from template'
find('.project-template .custom-instance-project-templates-tab').click find('.project-template .custom-instance-project-templates-tab').click
find("label[for='#{projects.first.name}']").click find("label[for='#{projects.first.name}']").click
...@@ -90,7 +90,7 @@ RSpec.describe 'Project' do ...@@ -90,7 +90,7 @@ RSpec.describe 'Project' do
new_path = 'example-custom-project-template' new_path = 'example-custom-project-template'
new_name = 'Example Custom Project Template' new_name = 'Example Custom Project Template'
find('[data-qa-panel-name="create_from_template"]').click # rubocop:disable QA/SelectorUsage click_link 'Create from template'
find('.project-template .custom-instance-project-templates-tab').click find('.project-template .custom-instance-project-templates-tab').click
find("label[for='#{projects.first.name}']").click find("label[for='#{projects.first.name}']").click
...@@ -111,7 +111,7 @@ RSpec.describe 'Project' do ...@@ -111,7 +111,7 @@ RSpec.describe 'Project' do
it 'has a working pagination', :js do it 'has a working pagination', :js do
last_project = "label[for='#{projects.last.name}']" last_project = "label[for='#{projects.last.name}']"
find('[data-qa-panel-name="create_from_template"]').click # rubocop:disable QA/SelectorUsage click_link 'Create from template'
find('.project-template .custom-instance-project-templates-tab').click find('.project-template .custom-instance-project-templates-tab').click
expect(page).to have_css('.custom-project-templates .gl-pagination') expect(page).to have_css('.custom-project-templates .gl-pagination')
......
...@@ -18,7 +18,7 @@ RSpec.describe 'New project', :js do ...@@ -18,7 +18,7 @@ RSpec.describe 'New project', :js do
it 'shows mirror repository checkbox enabled', :js do it 'shows mirror repository checkbox enabled', :js do
visit new_project_path visit new_project_path
find('[data-qa-panel-name="import_project"]').click # rubocop:disable QA/SelectorUsage click_link 'Import project'
first('.js-import-git-toggle-button').click first('.js-import-git-toggle-button').click
expect(page).to have_unchecked_field('Mirror repository', disabled: false) expect(page).to have_unchecked_field('Mirror repository', disabled: false)
...@@ -32,7 +32,7 @@ RSpec.describe 'New project', :js do ...@@ -32,7 +32,7 @@ RSpec.describe 'New project', :js do
it 'does not show mirror repository option' do it 'does not show mirror repository option' do
visit new_project_path visit new_project_path
find('[data-qa-panel-name="import_project"]').click # rubocop:disable QA/SelectorUsage click_link 'Import project'
first('.js-import-git-toggle-button').click first('.js-import-git-toggle-button').click
expect(page).not_to have_content('Mirror repository') expect(page).not_to have_content('Mirror repository')
...@@ -61,9 +61,9 @@ RSpec.describe 'New project', :js do ...@@ -61,9 +61,9 @@ RSpec.describe 'New project', :js do
it 'shows CI/CD tab and pane' do it 'shows CI/CD tab and pane' do
visit new_project_path visit new_project_path
expect(page).to have_css('[data-qa-panel-name="cicd_for_external_repo"]') # rubocop:disable QA/SelectorUsage expect(page).to have_link 'Run CI/CD for external repository'
find('[data-qa-panel-name="cicd_for_external_repo"]').click # rubocop:disable QA/SelectorUsage click_link 'Run CI/CD for external repository'
expect(page).to have_css('#ci-cd-project-pane') expect(page).to have_css('#ci-cd-project-pane')
end end
...@@ -72,7 +72,7 @@ RSpec.describe 'New project', :js do ...@@ -72,7 +72,7 @@ RSpec.describe 'New project', :js do
stub_request(:get, "http://foo.git/info/refs?service=git-upload-pack").to_return(status: 200, body: "001e# servdice=git-upload-pack") stub_request(:get, "http://foo.git/info/refs?service=git-upload-pack").to_return(status: 200, body: "001e# servdice=git-upload-pack")
visit new_project_path visit new_project_path
find('[data-qa-panel-name="import_project"]').click # rubocop:disable QA/SelectorUsage click_link 'Import project'
page.within '#import-project-pane' do page.within '#import-project-pane' do
first('.js-import-git-toggle-button').click first('.js-import-git-toggle-button').click
...@@ -95,7 +95,7 @@ RSpec.describe 'New project', :js do ...@@ -95,7 +95,7 @@ RSpec.describe 'New project', :js do
it 'creates CI/CD project from repo URL', :sidekiq_might_not_need_inline do it 'creates CI/CD project from repo URL', :sidekiq_might_not_need_inline do
visit new_project_path visit new_project_path
find('[data-qa-panel-name="cicd_for_external_repo"]').click # rubocop:disable QA/SelectorUsage click_link 'Run CI/CD for external repository'
page.within '#ci-cd-project-pane' do page.within '#ci-cd-project-pane' do
find('.js-import-git-toggle-button').click find('.js-import-git-toggle-button').click
...@@ -115,7 +115,7 @@ RSpec.describe 'New project', :js do ...@@ -115,7 +115,7 @@ RSpec.describe 'New project', :js do
it 'creates CI/CD project from GitHub' do it 'creates CI/CD project from GitHub' do
visit new_project_path visit new_project_path
find('[data-qa-panel-name="cicd_for_external_repo"]').click # rubocop:disable QA/SelectorUsage click_link 'Run CI/CD for external repository'
page.within '#ci-cd-project-pane' do page.within '#ci-cd-project-pane' do
find('.js-import-github').click find('.js-import-github').click
...@@ -152,7 +152,7 @@ RSpec.describe 'New project', :js do ...@@ -152,7 +152,7 @@ RSpec.describe 'New project', :js do
it 'stays on GitHub import page after access token failure' do it 'stays on GitHub import page after access token failure' do
visit new_project_path visit new_project_path
find('[data-qa-panel-name="cicd_for_external_repo"]').click # rubocop:disable QA/SelectorUsage click_link 'Run CI/CD for external repository'
page.within '#ci-cd-project-pane' do page.within '#ci-cd-project-pane' do
find('.js-import-github').click find('.js-import-github').click
...@@ -176,7 +176,7 @@ RSpec.describe 'New project', :js do ...@@ -176,7 +176,7 @@ RSpec.describe 'New project', :js do
it 'does not show CI/CD only tab' do it 'does not show CI/CD only tab' do
visit new_project_path visit new_project_path
expect(page).not_to have_css('[data-qa-panel-name="cicd_for_external_repo"]') # rubocop:disable QA/SelectorUsage expect(page).not_to have_text 'Run CI/CD for external repository'
end end
end end
end end
...@@ -464,7 +464,7 @@ RSpec.describe 'New project', :js do ...@@ -464,7 +464,7 @@ RSpec.describe 'New project', :js do
def visit_create_from_built_in_templates_tab def visit_create_from_built_in_templates_tab
visit new_project_path visit new_project_path
find('[data-qa-panel-name="create_from_template"]').click # rubocop:disable QA/SelectorUsage click_link 'Create from template'
end end
end end
end end
...@@ -19,7 +19,7 @@ RSpec.describe 'Project', :js do ...@@ -19,7 +19,7 @@ RSpec.describe 'Project', :js do
it "defaults to correct namespace" do it "defaults to correct namespace" do
visit new_project_path visit new_project_path
find('[data-qa-selector="create_from_template_link"]').click # rubocop:disable QA/SelectorUsage click_link 'Create from template'
find('.custom-group-project-templates-tab').click find('.custom-group-project-templates-tab').click
find("label[for=#{template.name}]").click find("label[for=#{template.name}]").click
...@@ -28,7 +28,7 @@ RSpec.describe 'Project', :js do ...@@ -28,7 +28,7 @@ RSpec.describe 'Project', :js do
it "uses supplied namespace" do it "uses supplied namespace" do
visit new_project_path(namespace_id: other_subgroup.id) visit new_project_path(namespace_id: other_subgroup.id)
find('[data-qa-selector="create_from_template_link"]').click # rubocop:disable QA/SelectorUsage click_link 'Create from template'
find('.custom-group-project-templates-tab').click find('.custom-group-project-templates-tab').click
find("label[for=#{template.name}]").click find("label[for=#{template.name}]").click
......
...@@ -9,9 +9,9 @@ RSpec.describe 'groups/settings/_transfer.html.haml' do ...@@ -9,9 +9,9 @@ RSpec.describe 'groups/settings/_transfer.html.haml' do
it 'enables the Select parent group dropdown and does not show an alert for a group' do it 'enables the Select parent group dropdown and does not show an alert for a group' do
render 'groups/settings/transfer', group: group render 'groups/settings/transfer', group: group
expect(rendered).to have_selector '[data-qa-selector="select_group_dropdown"]' # rubocop:disable QA/SelectorUsage expect(rendered).to have_button 'Select parent group'
expect(rendered).not_to have_selector '[data-qa-selector="select_group_dropdown"][disabled]' # rubocop:disable QA/SelectorUsage expect(rendered).not_to have_button 'Select parent group', disabled: true
expect(rendered).not_to have_selector '[data-testid="group-to-transfer-has-linked-subscription-alert"]' expect(rendered).not_to have_text "This group can't be transfered because it is linked to a subscription."
end end
it 'disables the Select parent group dropdown and shows an alert for a group with a paid gitlab.com plan', :saas do it 'disables the Select parent group dropdown and shows an alert for a group with a paid gitlab.com plan', :saas do
...@@ -19,8 +19,8 @@ RSpec.describe 'groups/settings/_transfer.html.haml' do ...@@ -19,8 +19,8 @@ RSpec.describe 'groups/settings/_transfer.html.haml' do
render 'groups/settings/transfer', group: group render 'groups/settings/transfer', group: group
expect(rendered).to have_selector '[data-qa-selector="select_group_dropdown"][disabled]' # rubocop:disable QA/SelectorUsage expect(rendered).to have_button 'Select parent group', disabled: true
expect(rendered).to have_selector '[data-testid="group-to-transfer-has-linked-subscription-alert"]' expect(rendered).to have_text "This group can't be transfered because it is linked to a subscription."
end end
it 'enables the Select parent group dropdown and does not show an alert for a subgroup', :saas do it 'enables the Select parent group dropdown and does not show an alert for a subgroup', :saas do
...@@ -29,9 +29,9 @@ RSpec.describe 'groups/settings/_transfer.html.haml' do ...@@ -29,9 +29,9 @@ RSpec.describe 'groups/settings/_transfer.html.haml' do
render 'groups/settings/transfer', group: subgroup render 'groups/settings/transfer', group: subgroup
expect(rendered).to have_selector '[data-qa-selector="select_group_dropdown"]' # rubocop:disable QA/SelectorUsage expect(rendered).to have_button 'Select parent group'
expect(rendered).not_to have_selector '[data-qa-selector="select_group_dropdown"][disabled]' # rubocop:disable QA/SelectorUsage expect(rendered).not_to have_button 'Select parent group', disabled: true
expect(rendered).not_to have_selector '[data-testid="group-to-transfer-has-linked-subscription-alert"]' expect(rendered).not_to have_text "This group can't be transfered because it is linked to a subscription."
end end
end end
end end
...@@ -94,7 +94,7 @@ RSpec.describe 'Admin Appearance' do ...@@ -94,7 +94,7 @@ RSpec.describe 'Admin Appearance' do
sign_in(admin) sign_in(admin)
gitlab_enable_admin_mode_sign_in(admin) gitlab_enable_admin_mode_sign_in(admin)
visit new_project_path visit new_project_path
find('[data-qa-panel-name="blank_project"]').click # rubocop:disable QA/SelectorUsage click_link 'Create blank project'
expect_custom_new_project_appearance(appearance) expect_custom_new_project_appearance(appearance)
end end
......
...@@ -21,7 +21,7 @@ RSpec.describe 'Project variables', :js do ...@@ -21,7 +21,7 @@ RSpec.describe 'Project variables', :js do
click_button('Add variable') click_button('Add variable')
page.within('#add-ci-variable') do page.within('#add-ci-variable') do
find('[data-qa-selector="ci_variable_key_field"] input').set('akey') # rubocop:disable QA/SelectorUsage fill_in 'Key', with: 'akey'
find('#ci-variable-value').set('akey_value') find('#ci-variable-value').set('akey_value')
find('[data-testid="environment-scope"]').click find('[data-testid="environment-scope"]').click
find('[data-testid="ci-environment-search"]').set('review/*') find('[data-testid="ci-environment-search"]').set('review/*')
......
...@@ -31,7 +31,7 @@ RSpec.describe 'Import/Export - project import integration test', :js do ...@@ -31,7 +31,7 @@ RSpec.describe 'Import/Export - project import integration test', :js do
it 'user imports an exported project successfully', :sidekiq_might_not_need_inline do it 'user imports an exported project successfully', :sidekiq_might_not_need_inline do
visit new_project_path visit new_project_path
click_import_project click_link 'Import project'
click_link 'GitLab export' click_link 'GitLab export'
fill_in :name, with: 'Test Project Name', visible: true fill_in :name, with: 'Test Project Name', visible: true
...@@ -50,7 +50,7 @@ RSpec.describe 'Import/Export - project import integration test', :js do ...@@ -50,7 +50,7 @@ RSpec.describe 'Import/Export - project import integration test', :js do
visit new_project_path visit new_project_path
click_import_project click_link 'Import project'
click_link 'GitLab export' click_link 'GitLab export'
fill_in :name, with: project.name, visible: true fill_in :name, with: project.name, visible: true
attach_file('file', file) attach_file('file', file)
...@@ -61,8 +61,4 @@ RSpec.describe 'Import/Export - project import integration test', :js do ...@@ -61,8 +61,4 @@ RSpec.describe 'Import/Export - project import integration test', :js do
end end
end end
end end
def click_import_project
find('[data-qa-panel-name="import_project"]').click # rubocop:disable QA/SelectorUsage
end
end end
...@@ -23,7 +23,7 @@ RSpec.describe 'New project', :js do ...@@ -23,7 +23,7 @@ RSpec.describe 'New project', :js do
) )
visit new_project_path visit new_project_path
find('[data-qa-panel-name="blank_project"]').click # rubocop:disable QA/SelectorUsage click_link 'Create blank project'
expect(page).to have_content 'Other visibility settings have been disabled by the administrator.' expect(page).to have_content 'Other visibility settings have been disabled by the administrator.'
end end
...@@ -34,7 +34,7 @@ RSpec.describe 'New project', :js do ...@@ -34,7 +34,7 @@ RSpec.describe 'New project', :js do
) )
visit new_project_path visit new_project_path
find('[data-qa-panel-name="blank_project"]').click # rubocop:disable QA/SelectorUsage click_link 'Create blank project'
expect(page).to have_content 'Visibility settings have been disabled by the administrator.' expect(page).to have_content 'Visibility settings have been disabled by the administrator.'
end end
...@@ -49,14 +49,14 @@ RSpec.describe 'New project', :js do ...@@ -49,14 +49,14 @@ RSpec.describe 'New project', :js do
it 'shows "New project" page', :js do it 'shows "New project" page', :js do
visit new_project_path visit new_project_path
find('[data-qa-panel-name="blank_project"]').click # rubocop:disable QA/SelectorUsage click_link 'Create blank project'
expect(page).to have_content('Project name') expect(page).to have_content('Project name')
expect(page).to have_content('Project URL') expect(page).to have_content('Project URL')
expect(page).to have_content('Project slug') expect(page).to have_content('Project slug')
click_link('New project') click_link('New project')
find('[data-qa-panel-name="import_project"]').click # rubocop:disable QA/SelectorUsage click_link 'Import project'
expect(page).to have_link('GitHub') expect(page).to have_link('GitHub')
expect(page).to have_link('Bitbucket') expect(page).to have_link('Bitbucket')
...@@ -69,7 +69,7 @@ RSpec.describe 'New project', :js do ...@@ -69,7 +69,7 @@ RSpec.describe 'New project', :js do
before do before do
visit new_project_path visit new_project_path
find('[data-qa-panel-name="import_project"]').click # rubocop:disable QA/SelectorUsage click_link 'Import project'
end end
it 'has Manifest file' do it 'has Manifest file' do
...@@ -83,7 +83,7 @@ RSpec.describe 'New project', :js do ...@@ -83,7 +83,7 @@ RSpec.describe 'New project', :js do
stub_application_setting(default_project_visibility: level) stub_application_setting(default_project_visibility: level)
visit new_project_path visit new_project_path
find('[data-qa-panel-name="blank_project"]').click # rubocop:disable QA/SelectorUsage click_link 'Create blank project'
page.within('#blank-project-pane') do page.within('#blank-project-pane') do
expect(find_field("project_visibility_level_#{level}")).to be_checked expect(find_field("project_visibility_level_#{level}")).to be_checked
end end
...@@ -91,7 +91,7 @@ RSpec.describe 'New project', :js do ...@@ -91,7 +91,7 @@ RSpec.describe 'New project', :js do
it "saves visibility level #{level} on validation error" do it "saves visibility level #{level} on validation error" do
visit new_project_path visit new_project_path
find('[data-qa-panel-name="blank_project"]').click # rubocop:disable QA/SelectorUsage click_link 'Create blank project'
choose(key) choose(key)
click_button('Create project') click_button('Create project')
...@@ -111,7 +111,7 @@ RSpec.describe 'New project', :js do ...@@ -111,7 +111,7 @@ RSpec.describe 'New project', :js do
context 'when admin mode is enabled', :enable_admin_mode do context 'when admin mode is enabled', :enable_admin_mode do
it 'has private selected' do it 'has private selected' do
visit new_project_path(namespace_id: group.id) visit new_project_path(namespace_id: group.id)
find('[data-qa-panel-name="blank_project"]').click # rubocop:disable QA/SelectorUsage click_link 'Create blank project'
page.within('#blank-project-pane') do page.within('#blank-project-pane') do
expect(find_field("project_visibility_level_#{Gitlab::VisibilityLevel::PRIVATE}")).to be_checked expect(find_field("project_visibility_level_#{Gitlab::VisibilityLevel::PRIVATE}")).to be_checked
...@@ -138,7 +138,7 @@ RSpec.describe 'New project', :js do ...@@ -138,7 +138,7 @@ RSpec.describe 'New project', :js do
context 'when admin mode is enabled', :enable_admin_mode do context 'when admin mode is enabled', :enable_admin_mode do
it 'has private selected' do it 'has private selected' do
visit new_project_path(namespace_id: group.id, project: { visibility_level: Gitlab::VisibilityLevel::PRIVATE }) visit new_project_path(namespace_id: group.id, project: { visibility_level: Gitlab::VisibilityLevel::PRIVATE })
find('[data-qa-panel-name="blank_project"]').click # rubocop:disable QA/SelectorUsage click_link 'Create blank project'
page.within('#blank-project-pane') do page.within('#blank-project-pane') do
expect(find_field("project_visibility_level_#{Gitlab::VisibilityLevel::PRIVATE}")).to be_checked expect(find_field("project_visibility_level_#{Gitlab::VisibilityLevel::PRIVATE}")).to be_checked
...@@ -159,7 +159,7 @@ RSpec.describe 'New project', :js do ...@@ -159,7 +159,7 @@ RSpec.describe 'New project', :js do
context 'Readme selector' do context 'Readme selector' do
it 'shows the initialize with Readme checkbox on "Blank project" tab' do it 'shows the initialize with Readme checkbox on "Blank project" tab' do
visit new_project_path visit new_project_path
find('[data-qa-panel-name="blank_project"]').click # rubocop:disable QA/SelectorUsage click_link 'Create blank project'
expect(page).to have_css('input#project_initialize_with_readme') expect(page).to have_css('input#project_initialize_with_readme')
expect(page).to have_content('Initialize repository with a README') expect(page).to have_content('Initialize repository with a README')
...@@ -167,7 +167,7 @@ RSpec.describe 'New project', :js do ...@@ -167,7 +167,7 @@ RSpec.describe 'New project', :js do
it 'does not show the initialize with Readme checkbox on "Create from template" tab' do it 'does not show the initialize with Readme checkbox on "Create from template" tab' do
visit new_project_path visit new_project_path
find('[data-qa-panel-name="create_from_template"]').click # rubocop:disable QA/SelectorUsage click_link 'Create from template'
first('.choose-template').click first('.choose-template').click
page.within '.project-fields-form' do page.within '.project-fields-form' do
...@@ -178,7 +178,7 @@ RSpec.describe 'New project', :js do ...@@ -178,7 +178,7 @@ RSpec.describe 'New project', :js do
it 'does not show the initialize with Readme checkbox on "Import project" tab' do it 'does not show the initialize with Readme checkbox on "Import project" tab' do
visit new_project_path visit new_project_path
find('[data-qa-panel-name="import_project"]').click # rubocop:disable QA/SelectorUsage click_link 'Import project'
first('.js-import-git-toggle-button').click first('.js-import-git-toggle-button').click
page.within '#import-project-pane' do page.within '#import-project-pane' do
...@@ -192,7 +192,7 @@ RSpec.describe 'New project', :js do ...@@ -192,7 +192,7 @@ RSpec.describe 'New project', :js do
context 'with user namespace' do context 'with user namespace' do
before do before do
visit new_project_path visit new_project_path
find('[data-qa-panel-name="blank_project"]').click # rubocop:disable QA/SelectorUsage click_link 'Create blank project'
end end
it 'selects the user namespace' do it 'selects the user namespace' do
...@@ -208,7 +208,7 @@ RSpec.describe 'New project', :js do ...@@ -208,7 +208,7 @@ RSpec.describe 'New project', :js do
before do before do
group.add_owner(user) group.add_owner(user)
visit new_project_path(namespace_id: group.id) visit new_project_path(namespace_id: group.id)
find('[data-qa-panel-name="blank_project"]').click # rubocop:disable QA/SelectorUsage click_link 'Create blank project'
end end
it 'selects the group namespace' do it 'selects the group namespace' do
...@@ -225,7 +225,7 @@ RSpec.describe 'New project', :js do ...@@ -225,7 +225,7 @@ RSpec.describe 'New project', :js do
before do before do
group.add_maintainer(user) group.add_maintainer(user)
visit new_project_path(namespace_id: subgroup.id) visit new_project_path(namespace_id: subgroup.id)
find('[data-qa-panel-name="blank_project"]').click # rubocop:disable QA/SelectorUsage click_link 'Create blank project'
end end
it 'selects the group namespace' do it 'selects the group namespace' do
...@@ -245,7 +245,7 @@ RSpec.describe 'New project', :js do ...@@ -245,7 +245,7 @@ RSpec.describe 'New project', :js do
internal_group.add_owner(user) internal_group.add_owner(user)
private_group.add_owner(user) private_group.add_owner(user)
visit new_project_path(namespace_id: public_group.id) visit new_project_path(namespace_id: public_group.id)
find('[data-qa-panel-name="blank_project"]').click # rubocop:disable QA/SelectorUsage click_link 'Create blank project'
end end
it 'enables the correct visibility options' do it 'enables the correct visibility options' do
...@@ -275,7 +275,7 @@ RSpec.describe 'New project', :js do ...@@ -275,7 +275,7 @@ RSpec.describe 'New project', :js do
context 'Import project options', :js do context 'Import project options', :js do
before do before do
visit new_project_path visit new_project_path
find('[data-qa-panel-name="import_project"]').click # rubocop:disable QA/SelectorUsage click_link 'Import project'
end end
context 'from git repository url, "Repo by URL"' do context 'from git repository url, "Repo by URL"' do
...@@ -351,7 +351,7 @@ RSpec.describe 'New project', :js do ...@@ -351,7 +351,7 @@ RSpec.describe 'New project', :js do
before do before do
group.add_developer(user) group.add_developer(user)
visit new_project_path(namespace_id: group.id) visit new_project_path(namespace_id: group.id)
find('[data-qa-panel-name="blank_project"]').click # rubocop:disable QA/SelectorUsage click_link 'Create blank project'
end end
it 'selects the group namespace' do it 'selects the group namespace' do
......
...@@ -14,7 +14,7 @@ RSpec.describe 'User creates a project', :js do ...@@ -14,7 +14,7 @@ RSpec.describe 'User creates a project', :js do
it 'creates a new project' do it 'creates a new project' do
visit(new_project_path) visit(new_project_path)
find('[data-qa-panel-name="blank_project"]').click # rubocop:disable QA/SelectorUsage click_link 'Create blank project'
fill_in(:project_name, with: 'Empty') fill_in(:project_name, with: 'Empty')
expect(page).to have_checked_field 'Initialize repository with a README' expect(page).to have_checked_field 'Initialize repository with a README'
...@@ -38,7 +38,7 @@ RSpec.describe 'User creates a project', :js do ...@@ -38,7 +38,7 @@ RSpec.describe 'User creates a project', :js do
visit(new_project_path) visit(new_project_path)
find('[data-qa-panel-name="blank_project"]').click # rubocop:disable QA/SelectorUsage click_link 'Create blank project'
fill_in(:project_name, with: 'With initial commits') fill_in(:project_name, with: 'With initial commits')
expect(page).to have_checked_field 'Initialize repository with a README' expect(page).to have_checked_field 'Initialize repository with a README'
...@@ -67,7 +67,7 @@ RSpec.describe 'User creates a project', :js do ...@@ -67,7 +67,7 @@ RSpec.describe 'User creates a project', :js do
it 'creates a new project' do it 'creates a new project' do
visit(new_project_path) visit(new_project_path)
find('[data-qa-panel-name="blank_project"]').click # rubocop:disable QA/SelectorUsage click_link 'Create blank project'
fill_in :project_name, with: 'A Subgroup Project' fill_in :project_name, with: 'A Subgroup Project'
fill_in :project_path, with: 'a-subgroup-project' fill_in :project_path, with: 'a-subgroup-project'
...@@ -96,7 +96,7 @@ RSpec.describe 'User creates a project', :js do ...@@ -96,7 +96,7 @@ RSpec.describe 'User creates a project', :js do
it 'creates a new project' do it 'creates a new project' do
visit(new_project_path) visit(new_project_path)
find('[data-qa-panel-name="blank_project"]').click # rubocop:disable QA/SelectorUsage click_link 'Create blank project'
fill_in :project_name, with: 'a-new-project' fill_in :project_name, with: 'a-new-project'
fill_in :project_path, with: 'a-new-project' fill_in :project_path, with: 'a-new-project'
......
...@@ -16,7 +16,7 @@ RSpec.describe 'Project' do ...@@ -16,7 +16,7 @@ RSpec.describe 'Project' do
shared_examples 'creates from template' do |template, sub_template_tab = nil| shared_examples 'creates from template' do |template, sub_template_tab = nil|
it "is created from template", :js do it "is created from template", :js do
find('[data-qa-panel-name="create_from_template"]').click # rubocop:disable QA/SelectorUsage click_link 'Create from template'
find(".project-template #{sub_template_tab}").click if sub_template_tab find(".project-template #{sub_template_tab}").click if sub_template_tab
find("label[for=#{template.name}]").click find("label[for=#{template.name}]").click
fill_in("project_name", with: template.name) fill_in("project_name", with: template.name)
......
...@@ -9,9 +9,9 @@ RSpec.describe 'groups/settings/_transfer.html.haml' do ...@@ -9,9 +9,9 @@ RSpec.describe 'groups/settings/_transfer.html.haml' do
render 'groups/settings/transfer', group: group render 'groups/settings/transfer', group: group
expect(rendered).to have_selector '[data-qa-selector="select_group_dropdown"]' # rubocop:disable QA/SelectorUsage expect(rendered).to have_button 'Select parent group'
expect(rendered).not_to have_selector '[data-qa-selector="select_group_dropdown"][disabled]' # rubocop:disable QA/SelectorUsage expect(rendered).not_to have_button 'Select parent group', disabled: true
expect(rendered).not_to have_selector '[data-testid="group-to-transfer-has-linked-subscription-alert"]' expect(rendered).not_to have_text "This group can't be transfered because it is linked to a subscription."
end end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment