diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-20 12:40:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-20 12:40:42 +0300 |
commit | ee664acb356f8123f4f6b00b73c1e1cf0866c7fb (patch) | |
tree | f8479f94a28f66654c6a4f6fb99bad6b4e86a40e /spec/features/admin/admin_runners_spec.rb | |
parent | 62f7d5c5b69180e82ae8196b7b429eeffc8e7b4f (diff) |
Add latest changes from gitlab-org/gitlab@15-5-stable-eev15.5.0-rc42
Diffstat (limited to 'spec/features/admin/admin_runners_spec.rb')
-rw-r--r-- | spec/features/admin/admin_runners_spec.rb | 64 |
1 files changed, 35 insertions, 29 deletions
diff --git a/spec/features/admin/admin_runners_spec.rb b/spec/features/admin/admin_runners_spec.rb index fe9fd01d3d5..35e57213bdb 100644 --- a/spec/features/admin/admin_runners_spec.rb +++ b/spec/features/admin/admin_runners_spec.rb @@ -66,10 +66,26 @@ RSpec.describe "Admin Runners" do it 'has all necessary texts' do expect(page).to have_text "Register an instance runner" + expect(page).to have_text "#{s_('Runners|All')} 3" expect(page).to have_text "#{s_('Runners|Online')} 1" expect(page).to have_text "#{s_('Runners|Offline')} 2" expect(page).to have_text "#{s_('Runners|Stale')} 1" end + + describe 'delete all runners in bulk' do + before do + check s_('Runners|Select all') + click_button s_('Runners|Delete selected') + + within_modal do + click_on 'Permanently delete 3 runners' + end + + wait_for_requests + end + + it_behaves_like 'shows no runners registered' + end end it 'shows a job count' do @@ -351,14 +367,15 @@ RSpec.describe "Admin Runners" do end describe 'filter by tag' do - before_all do - create(:ci_runner, :instance, description: 'runner-blue', tag_list: ['blue']) - create(:ci_runner, :instance, description: 'runner-red', tag_list: ['red']) - end + let_it_be(:runner_1) { create(:ci_runner, :instance, description: 'runner-blue', tag_list: ['blue']) } + let_it_be(:runner_2) { create(:ci_runner, :instance, description: 'runner-2-blue', tag_list: ['blue']) } + let_it_be(:runner_3) { create(:ci_runner, :instance, description: 'runner-red', tag_list: ['red']) } - it 'shows tags suggestions' do + before do visit admin_runners_path + end + it 'shows tags suggestions' do open_filtered_search_suggestions('Tags') page.within(search_bar_selector) do @@ -367,23 +384,25 @@ RSpec.describe "Admin Runners" do end end - it 'shows correct runner when tag matches' do - visit admin_runners_path + it_behaves_like 'filters by tag' do + let(:tag) { 'blue' } + let(:found_runner) { runner_1.description } + let(:missing_runner) { runner_3.description } + end - expect(page).to have_content 'runner-blue' - expect(page).to have_content 'runner-red' + context 'when tag does not match' do + before do + input_filtered_search_filter_is_only('Tags', 'green') + end - input_filtered_search_filter_is_only('Tags', 'blue') + it_behaves_like 'shows no runners found' - expect(page).to have_content 'runner-blue' - expect(page).not_to have_content 'runner-red' + it 'shows no runner' do + expect(page).not_to have_content 'runner-blue' + end end it 'shows correct runner when tag is selected and search term is entered' do - create(:ci_runner, :instance, description: 'runner-2-blue', tag_list: ['blue']) - - visit admin_runners_path - input_filtered_search_filter_is_only('Tags', 'blue') expect(page).to have_content 'runner-blue' @@ -396,19 +415,6 @@ RSpec.describe "Admin Runners" do expect(page).not_to have_content 'runner-blue' expect(page).not_to have_content 'runner-red' end - - context 'when tag does not match' do - before do - visit admin_runners_path - input_filtered_search_filter_is_only('Tags', 'green') - end - - it_behaves_like 'shows no runners found' - - it 'shows no runner' do - expect(page).not_to have_content 'runner-blue' - end - end end it 'sorts by last contact date' do |