Browse Source

Maintenance: Drop unneeded waits to stabilize capybara tests.

Martin Gruner 3 years ago
parent
commit
e8259758b8

+ 1 - 2
spec/support/capybara/common_actions.rb

@@ -164,8 +164,7 @@ module CommonActions
       route = Regexp.new(Regexp.quote("/##{route}"))
     end
 
-    # wait 1 sec by default because Firefox is slow
-    options.reverse_merge!(wait: 1, url: true)
+    options.reverse_merge!(url: true)
 
     have_current_path(route, **options)
   end

+ 7 - 7
spec/system/basic/authentication_spec.rb

@@ -34,7 +34,7 @@ RSpec.describe 'Authentication', type: :system do
     expect(cookie[:expires]).to be_truthy
 
     logout
-    expect_current_route 'login', wait: 10
+    expect_current_route 'login'
 
     # Check that cookies has no longer a expire date after logout.
     cookie = cookie('^_zammad.+?')
@@ -43,12 +43,12 @@ RSpec.describe 'Authentication', type: :system do
 
   it 'Logout' do
     logout
-    expect_current_route 'login', wait: 10
+    expect_current_route 'login'
   end
 
   it 'will unset user attributes after logout' do
     logout
-    expect_current_route 'login', wait: 10
+    expect_current_route 'login'
 
     visit '/#signup'
 
@@ -59,20 +59,20 @@ RSpec.describe 'Authentication', type: :system do
   it 'Login and redirect to requested url', authenticated_as: false do
     visit 'ticket/zoom/1'
 
-    expect_current_route 'login', wait: 10
+    expect_current_route 'login'
 
     login(
       username: 'admin@example.com',
       password: 'test',
     )
 
-    expect_current_route 'ticket/zoom/1', wait: 10
+    expect_current_route 'ticket/zoom/1'
   end
 
   it 'Login and redirect to requested url via external authentication', authenticated_as: false do
     visit 'ticket/zoom/1'
 
-    expect_current_route 'login', wait: 10
+    expect_current_route 'login'
 
     # simulate jump to external ressource
     visit 'https://www.zammad.org'
@@ -87,7 +87,7 @@ RSpec.describe 'Authentication', type: :system do
     # jump back and check if origin requested url is shown
     visit ''
 
-    expect_current_route 'ticket/zoom/1', wait: 10
+    expect_current_route 'ticket/zoom/1'
 
     expect(current_login).to eq('admin@example.com')
   end

+ 3 - 3
spec/system/chat_spec.rb

@@ -51,7 +51,7 @@ RSpec.describe 'Chat Handling', type: :system do
 
       expect(page).to have_css('.zammad-chat', visible: :all)
       expect(page).to have_css('.zammad-chat-is-hidden', visible: :all)
-      expect(page).to have_no_css('.open-zammad-chat:not([style*="display: none"]', visible: :all, wait: 20)
+      expect(page).to have_no_css('.open-zammad-chat:not([style*="display: none"]', visible: :all)
     end
   end
 
@@ -196,7 +196,7 @@ RSpec.describe 'Chat Handling', type: :system do
       # No customer action, hide the widget.
       expect(page).to have_css('.zammad-chat')
 
-      expect(page).to have_no_css('.zammad-chat', wait: 20)
+      expect(page).to have_no_css('.zammad-chat')
 
       refresh
 
@@ -204,7 +204,7 @@ RSpec.describe 'Chat Handling', type: :system do
       open_chat_dialog
 
       check_content('.zammad-chat-modal-text', %r{(waiting|Warte)})
-      check_content('.zammad-chat-modal-text', %r{(takes longer|dauert länger)}, wait: 20)
+      check_content('.zammad-chat-modal-text', %r{(takes longer|dauert länger)})
 
       refresh
 

+ 7 - 7
spec/system/dashboard_spec.rb

@@ -51,8 +51,8 @@ RSpec.describe 'Dashboard', type: :system do
       end
 
       it 'does logout user' do
-        expect(page).to have_text('Due to inactivity, you will be automatically logged out within the next 30 seconds.', wait: 20)
-        expect(page).to have_text('Due to inactivity, you have been automatically logged out.', wait: 20)
+        expect(page).to have_text('Due to inactivity, you will be automatically logged out within the next 30 seconds.')
+        expect(page).to have_text('Due to inactivity, you have been automatically logged out.')
       end
 
       it 'does not logout user', authenticated_as: :admin do
@@ -65,7 +65,7 @@ RSpec.describe 'Dashboard', type: :system do
       it 'does logout user' do
         expect(page).to have_no_text('Due to inactivity, you have been automatically logged out.')
         Setting.set('session_timeout', { default: '1' })
-        expect(page).to have_text('Due to inactivity, you have been automatically logged out.', wait: 20)
+        expect(page).to have_text('Due to inactivity, you have been automatically logged out.')
       end
     end
 
@@ -76,7 +76,7 @@ RSpec.describe 'Dashboard', type: :system do
       end
 
       it 'does logout user' do
-        expect(page).to have_text('Due to inactivity, you have been automatically logged out.', wait: 20)
+        expect(page).to have_text('Due to inactivity, you have been automatically logged out.')
       end
     end
 
@@ -87,7 +87,7 @@ RSpec.describe 'Dashboard', type: :system do
       end
 
       it 'does logout user' do
-        expect(page).to have_text('Due to inactivity, you have been automatically logged out.', wait: 20)
+        expect(page).to have_text('Due to inactivity, you have been automatically logged out.')
       end
     end
 
@@ -98,7 +98,7 @@ RSpec.describe 'Dashboard', type: :system do
       end
 
       it 'does logout user' do
-        expect(page).to have_text('Due to inactivity, you have been automatically logged out.', wait: 20)
+        expect(page).to have_text('Due to inactivity, you have been automatically logged out.')
       end
     end
 
@@ -112,7 +112,7 @@ RSpec.describe 'Dashboard', type: :system do
         # backend tests for the reset
         session = ActiveRecord::SessionStore::Session.all.detect { |s| s.data['user_id'] == admin.id }
         SessionTimeoutJob::Session.new(session).frontend_timeout
-        expect(page).to have_text('Due to inactivity, you have been automatically logged out.', wait: 20)
+        expect(page).to have_text('Due to inactivity, you have been automatically logged out.')
       end
     end
 

+ 16 - 16
spec/system/data_privacy_spec.rb

@@ -22,15 +22,15 @@ RSpec.describe 'Data Privacy', type: :system, searchindex: true, authenticated_a
       click '.js-new'
 
       find(:css, '.js-input').send_keys(customer.firstname)
-      expect(page).to have_css('.searchableSelect-option-text', wait: 5)
+      expect(page).to have_css('.searchableSelect-option-text')
       click '.searchableSelect-option-text'
       fill_in 'Are you sure?', with: 'DELETE'
-      expect(page).to have_no_text('DELETE ORGANIZATION?', wait: 5)
+      expect(page).to have_no_text('DELETE ORGANIZATION?')
       click '.js-submit'
 
-      expect(page).to have_text('in process', wait: 5)
+      expect(page).to have_text('in process')
       DataPrivacyTaskJob.perform_now
-      expect(page).to have_text('completed', wait: 5)
+      expect(page).to have_text('completed')
     end
 
     context 'when customer is the single user of the organization' do
@@ -49,15 +49,15 @@ RSpec.describe 'Data Privacy', type: :system, searchindex: true, authenticated_a
         click '.js-new'
 
         find(:css, '.js-input').send_keys(customer.firstname)
-        expect(page).to have_css('.searchableSelect-option-text', wait: 5)
+        expect(page).to have_css('.searchableSelect-option-text')
         click '.searchableSelect-option-text'
         fill_in 'Are you sure?', with: 'DELETE'
-        expect(page).to have_text('DELETE ORGANIZATION?', wait: 5)
+        expect(page).to have_text('DELETE ORGANIZATION?')
         click '.js-submit'
 
-        expect(page).to have_text('in process', wait: 5)
+        expect(page).to have_text('in process')
         DataPrivacyTaskJob.perform_now
-        expect(page).to have_text('completed', wait: 5)
+        expect(page).to have_text('completed')
       end
 
       it 'deletes customer by email' do
@@ -65,15 +65,15 @@ RSpec.describe 'Data Privacy', type: :system, searchindex: true, authenticated_a
         click '.js-new'
 
         find(:css, '.js-input').send_keys(customer.email)
-        expect(page).to have_css('.searchableSelect-option-text', wait: 5)
+        expect(page).to have_css('.searchableSelect-option-text')
         click '.searchableSelect-option-text'
         fill_in 'Are you sure?', with: 'DELETE'
-        expect(page).to have_text('DELETE ORGANIZATION?', wait: 5)
+        expect(page).to have_text('DELETE ORGANIZATION?')
         click '.js-submit'
 
-        expect(page).to have_text('in process', wait: 5)
+        expect(page).to have_text('in process')
         DataPrivacyTaskJob.perform_now
-        expect(page).to have_text('completed', wait: 5)
+        expect(page).to have_text('completed')
       end
     end
   end
@@ -88,9 +88,9 @@ RSpec.describe 'Data Privacy', type: :system, searchindex: true, authenticated_a
       fill_in 'Are you sure?', with: 'DELETE'
       click '.js-submit'
 
-      expect(page).to have_text('in process', wait: 5)
+      expect(page).to have_text('in process')
       DataPrivacyTaskJob.perform_now
-      expect(page).to have_text('completed', wait: 5)
+      expect(page).to have_text('completed')
     end
   end
 
@@ -105,9 +105,9 @@ RSpec.describe 'Data Privacy', type: :system, searchindex: true, authenticated_a
       fill_in 'Are you sure?', with: 'DELETE'
       click '.js-submit'
 
-      expect(page).to have_text('in process', wait: 5)
+      expect(page).to have_text('in process')
       DataPrivacyTaskJob.perform_now
-      expect(page).to have_text('completed', wait: 5)
+      expect(page).to have_text('completed')
     end
   end
 end

+ 82 - 82
spec/system/examples/core_workflow_examples.rb

@@ -46,7 +46,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_selector("input[name='#{field_name}']", wait: 10)
+        expect(page).to have_selector("input[name='#{field_name}']")
       end
     end
 
@@ -64,7 +64,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_selector(".form-group[data-attribute-name='#{field_name}'].is-hidden", visible: :hidden, wait: 10)
+        expect(page).to have_selector(".form-group[data-attribute-name='#{field_name}'].is-hidden", visible: :hidden)
       end
     end
 
@@ -82,7 +82,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_selector(".form-group[data-attribute-name='#{field_name}'].is-removed", visible: :hidden, wait: 10)
+        expect(page).to have_selector(".form-group[data-attribute-name='#{field_name}'].is-removed", visible: :hidden)
       end
     end
 
@@ -100,7 +100,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page.find("div[data-attribute-name='#{field_name}'] div.formGroup-label label")).to have_no_text('*', wait: 10)
+        expect(page.find("div[data-attribute-name='#{field_name}'] div.formGroup-label label")).to have_no_text('*')
       end
     end
 
@@ -118,7 +118,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page.find("div[data-attribute-name='#{field_name}'] div.formGroup-label label")).to have_text('*', wait: 10)
+        expect(page.find("div[data-attribute-name='#{field_name}'] div.formGroup-label label")).to have_text('*')
       end
     end
 
@@ -136,7 +136,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_no_selector("div[data-attribute-name='#{field_name}'].is-readonly", wait: 10)
+        expect(page).to have_no_selector("div[data-attribute-name='#{field_name}'].is-readonly")
       end
     end
 
@@ -154,7 +154,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_selector("div[data-attribute-name='#{field_name}'].is-readonly", wait: 10)
+        expect(page).to have_selector("div[data-attribute-name='#{field_name}'].is-readonly")
       end
     end
 
@@ -172,7 +172,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_field(field_name, with: '4cddb2twza', wait: 10)
+        expect(page).to have_field(field_name, with: '4cddb2twza')
       end
     end
 
@@ -191,7 +191,7 @@ RSpec.shared_examples 'core workflow' do
 
         it 'does perform' do
           before_it.call
-          expect(page).to have_field(field_name, with: '9999', wait: 10)
+          expect(page).to have_field(field_name, with: '9999')
         end
       end
 
@@ -217,7 +217,7 @@ RSpec.shared_examples 'core workflow' do
 
         it 'does perform' do
           before_it.call
-          expect(page).to have_no_field(field_name, with: '9999', wait: 10)
+          expect(page).to have_no_field(field_name, with: '9999')
         end
       end
     end
@@ -244,7 +244,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_selector("textarea[name='#{field_name}']", wait: 10)
+        expect(page).to have_selector("textarea[name='#{field_name}']")
       end
     end
 
@@ -262,7 +262,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_selector(".form-group[data-attribute-name='#{field_name}'].is-hidden", visible: :hidden, wait: 10)
+        expect(page).to have_selector(".form-group[data-attribute-name='#{field_name}'].is-hidden", visible: :hidden)
       end
     end
 
@@ -280,7 +280,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_selector(".form-group[data-attribute-name='#{field_name}'].is-removed", visible: :hidden, wait: 10)
+        expect(page).to have_selector(".form-group[data-attribute-name='#{field_name}'].is-removed", visible: :hidden)
       end
     end
 
@@ -298,7 +298,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page.find("div[data-attribute-name='#{field_name}'] div.formGroup-label label")).to have_no_text('*', wait: 10)
+        expect(page.find("div[data-attribute-name='#{field_name}'] div.formGroup-label label")).to have_no_text('*')
       end
     end
 
@@ -316,7 +316,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page.find("div[data-attribute-name='#{field_name}'] div.formGroup-label label")).to have_text('*', wait: 10)
+        expect(page.find("div[data-attribute-name='#{field_name}'] div.formGroup-label label")).to have_text('*')
       end
     end
 
@@ -334,7 +334,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_no_selector("div[data-attribute-name='#{field_name}'].is-readonly", wait: 10)
+        expect(page).to have_no_selector("div[data-attribute-name='#{field_name}'].is-readonly")
       end
     end
 
@@ -352,7 +352,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_selector("div[data-attribute-name='#{field_name}'].is-readonly", wait: 10)
+        expect(page).to have_selector("div[data-attribute-name='#{field_name}'].is-readonly")
       end
     end
 
@@ -370,7 +370,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_field(field_name, with: '4cddb2twza', wait: 10)
+        expect(page).to have_field(field_name, with: '4cddb2twza')
       end
     end
 
@@ -389,7 +389,7 @@ RSpec.shared_examples 'core workflow' do
 
         it 'does perform' do
           before_it.call
-          expect(page).to have_field(field_name, with: '9999', wait: 10)
+          expect(page).to have_field(field_name, with: '9999')
         end
       end
 
@@ -415,7 +415,7 @@ RSpec.shared_examples 'core workflow' do
 
         it 'does perform' do
           before_it.call
-          expect(page).to have_no_field(field_name, with: '9999', wait: 10)
+          expect(page).to have_no_field(field_name, with: '9999')
         end
       end
     end
@@ -442,7 +442,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_selector("select[name='#{field_name}']", wait: 10)
+        expect(page).to have_selector("select[name='#{field_name}']")
       end
     end
 
@@ -460,7 +460,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_selector(".form-group[data-attribute-name='#{field_name}'].is-hidden", visible: :hidden, wait: 10)
+        expect(page).to have_selector(".form-group[data-attribute-name='#{field_name}'].is-hidden", visible: :hidden)
       end
     end
 
@@ -478,7 +478,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_selector(".form-group[data-attribute-name='#{field_name}'].is-removed", visible: :hidden, wait: 10)
+        expect(page).to have_selector(".form-group[data-attribute-name='#{field_name}'].is-removed", visible: :hidden)
       end
     end
 
@@ -496,7 +496,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page.find("div[data-attribute-name='#{field_name}'] div.formGroup-label label")).to have_no_text('*', wait: 10)
+        expect(page.find("div[data-attribute-name='#{field_name}'] div.formGroup-label label")).to have_no_text('*')
       end
     end
 
@@ -514,7 +514,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page.find("div[data-attribute-name='#{field_name}'] div.formGroup-label label")).to have_text('*', wait: 10)
+        expect(page.find("div[data-attribute-name='#{field_name}'] div.formGroup-label label")).to have_text('*')
       end
     end
 
@@ -532,7 +532,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_no_selector("div[data-attribute-name='#{field_name}'].is-readonly", wait: 10)
+        expect(page).to have_no_selector("div[data-attribute-name='#{field_name}'].is-readonly")
       end
     end
 
@@ -550,7 +550,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_selector("div[data-attribute-name='#{field_name}'].is-readonly", wait: 10)
+        expect(page).to have_selector("div[data-attribute-name='#{field_name}'].is-readonly")
       end
     end
 
@@ -568,9 +568,9 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_selector("select[name='#{field_name}'] option[value='key_1']", wait: 10)
-        expect(page).to have_no_selector("select[name='#{field_name}'] option[value='key_2']", wait: 10)
-        expect(page).to have_selector("select[name='#{field_name}'] option[value='key_3']", wait: 10)
+        expect(page).to have_selector("select[name='#{field_name}'] option[value='key_1']")
+        expect(page).to have_no_selector("select[name='#{field_name}'] option[value='key_2']")
+        expect(page).to have_selector("select[name='#{field_name}'] option[value='key_3']")
       end
     end
 
@@ -588,7 +588,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_selector("select[name='#{field_name}'] option[value='key_3'][selected]", wait: 10)
+        expect(page).to have_selector("select[name='#{field_name}'] option[value='key_3'][selected]")
       end
     end
 
@@ -614,7 +614,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_selector("select[name='#{field_name}'] option[value='key_3'][selected]", wait: 10)
+        expect(page).to have_selector("select[name='#{field_name}'] option[value='key_3'][selected]")
       end
     end
   end
@@ -640,7 +640,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_selector("select[name='#{field_name}']", wait: 10)
+        expect(page).to have_selector("select[name='#{field_name}']")
       end
     end
 
@@ -658,7 +658,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_selector(".form-group[data-attribute-name='#{field_name}'].is-hidden", visible: :hidden, wait: 10)
+        expect(page).to have_selector(".form-group[data-attribute-name='#{field_name}'].is-hidden", visible: :hidden)
       end
     end
 
@@ -676,7 +676,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_selector(".form-group[data-attribute-name='#{field_name}'].is-removed", visible: :hidden, wait: 10)
+        expect(page).to have_selector(".form-group[data-attribute-name='#{field_name}'].is-removed", visible: :hidden)
       end
     end
 
@@ -694,7 +694,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page.find("div[data-attribute-name='#{field_name}'] div.formGroup-label label")).to have_no_text('*', wait: 10)
+        expect(page.find("div[data-attribute-name='#{field_name}'] div.formGroup-label label")).to have_no_text('*')
       end
     end
 
@@ -712,7 +712,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page.find("div[data-attribute-name='#{field_name}'] div.formGroup-label label")).to have_text('*', wait: 10)
+        expect(page.find("div[data-attribute-name='#{field_name}'] div.formGroup-label label")).to have_text('*')
       end
     end
 
@@ -730,7 +730,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_no_selector("div[data-attribute-name='#{field_name}'].is-readonly", wait: 10)
+        expect(page).to have_no_selector("div[data-attribute-name='#{field_name}'].is-readonly")
       end
     end
 
@@ -748,7 +748,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_selector("div[data-attribute-name='#{field_name}'].is-readonly", wait: 10)
+        expect(page).to have_selector("div[data-attribute-name='#{field_name}'].is-readonly")
       end
     end
 
@@ -766,9 +766,9 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_selector("select[name='#{field_name}'] option[value='key_1']", wait: 10)
-        expect(page).to have_no_selector("select[name='#{field_name}'] option[value='key_2']", wait: 10)
-        expect(page).to have_selector("select[name='#{field_name}'] option[value='key_3']", wait: 10)
+        expect(page).to have_selector("select[name='#{field_name}'] option[value='key_1']")
+        expect(page).to have_no_selector("select[name='#{field_name}'] option[value='key_2']")
+        expect(page).to have_selector("select[name='#{field_name}'] option[value='key_3']")
       end
     end
 
@@ -786,7 +786,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        wait(5).until { page.find("select[name='#{field_name}']").value == ['key_3'] }
+        wait.until { page.find("select[name='#{field_name}']").value == ['key_3'] }
         expect(page.find("select[name='#{field_name}']").value).to eq(['key_3'])
       end
     end
@@ -813,7 +813,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        wait(5).until { page.find("select[name='#{field_name}']").value == ['key_3'] }
+        wait.until { page.find("select[name='#{field_name}']").value == ['key_3'] }
         expect(page.find("select[name='#{field_name}']").value).to eq(['key_3'])
       end
     end
@@ -840,7 +840,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_selector("select[name='#{field_name}']", wait: 10)
+        expect(page).to have_selector("select[name='#{field_name}']")
       end
     end
 
@@ -858,7 +858,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_selector(".form-group[data-attribute-name='#{field_name}'].is-hidden", visible: :hidden, wait: 10)
+        expect(page).to have_selector(".form-group[data-attribute-name='#{field_name}'].is-hidden", visible: :hidden)
       end
     end
 
@@ -876,7 +876,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_selector(".form-group[data-attribute-name='#{field_name}'].is-removed", visible: :hidden, wait: 10)
+        expect(page).to have_selector(".form-group[data-attribute-name='#{field_name}'].is-removed", visible: :hidden)
       end
     end
 
@@ -894,7 +894,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page.find("div[data-attribute-name='#{field_name}'] div.formGroup-label label")).to have_no_text('*', wait: 10)
+        expect(page.find("div[data-attribute-name='#{field_name}'] div.formGroup-label label")).to have_no_text('*')
       end
     end
 
@@ -912,7 +912,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page.find("div[data-attribute-name='#{field_name}'] div.formGroup-label label")).to have_text('*', wait: 10)
+        expect(page.find("div[data-attribute-name='#{field_name}'] div.formGroup-label label")).to have_text('*')
       end
     end
 
@@ -930,8 +930,8 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_selector("select[name='#{field_name}'] option[value='false']", wait: 10)
-        expect(page).to have_no_selector("select[name='#{field_name}'] option[value='true']", wait: 10)
+        expect(page).to have_selector("select[name='#{field_name}'] option[value='false']")
+        expect(page).to have_no_selector("select[name='#{field_name}'] option[value='true']")
       end
     end
 
@@ -949,7 +949,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_selector("select[name='#{field_name}'] option[value='true'][selected]", wait: 10)
+        expect(page).to have_selector("select[name='#{field_name}'] option[value='true'][selected]")
       end
     end
 
@@ -975,7 +975,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_selector("select[name='#{field_name}'] option[value='false'][selected]", wait: 10)
+        expect(page).to have_selector("select[name='#{field_name}'] option[value='false'][selected]")
       end
     end
   end
@@ -1001,7 +1001,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_selector("input[name='#{field_name}']", visible: :all, wait: 10)
+        expect(page).to have_selector("input[name='#{field_name}']", visible: :all)
       end
     end
 
@@ -1019,7 +1019,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_selector(".form-group[data-attribute-name='#{field_name}'].is-hidden", visible: :all, wait: 10)
+        expect(page).to have_selector(".form-group[data-attribute-name='#{field_name}'].is-hidden", visible: :all)
       end
     end
 
@@ -1037,7 +1037,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_selector(".form-group[data-attribute-name='#{field_name}'].is-removed", visible: :hidden, wait: 10)
+        expect(page).to have_selector(".form-group[data-attribute-name='#{field_name}'].is-removed", visible: :hidden)
       end
     end
 
@@ -1055,7 +1055,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page.find("div[data-attribute-name='#{field_name}'] div.formGroup-label label")).to have_no_text('*', wait: 10)
+        expect(page.find("div[data-attribute-name='#{field_name}'] div.formGroup-label label")).to have_no_text('*')
       end
     end
 
@@ -1073,7 +1073,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page.find("div[data-attribute-name='#{field_name}'] div.formGroup-label label")).to have_text('*', wait: 10)
+        expect(page.find("div[data-attribute-name='#{field_name}'] div.formGroup-label label")).to have_text('*')
       end
     end
 
@@ -1091,7 +1091,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_no_selector("div[data-attribute-name='#{field_name}'].is-readonly", wait: 10)
+        expect(page).to have_no_selector("div[data-attribute-name='#{field_name}'].is-readonly")
       end
     end
 
@@ -1109,7 +1109,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_selector("div[data-attribute-name='#{field_name}'].is-readonly", wait: 10)
+        expect(page).to have_selector("div[data-attribute-name='#{field_name}'].is-readonly")
       end
     end
 
@@ -1127,11 +1127,11 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_selector('span.searchableSelect-option-text', text: 'Incident', visible: :all, wait: 10)
-        expect(page).to have_selector('span.searchableSelect-option-text', text: 'Hardware', visible: :all, wait: 10)
-        expect(page).to have_selector('span.searchableSelect-option-text', text: 'Monitor', visible: :all, wait: 10)
-        expect(page).to have_no_selector('span.searchableSelect-option-text', text: 'Mouse', visible: :all, wait: 10)
-        expect(page).to have_no_selector('span.searchableSelect-option-text', text: 'Softwareproblem', visible: :all, wait: 10)
+        expect(page).to have_selector('span.searchableSelect-option-text', text: 'Incident', visible: :all)
+        expect(page).to have_selector('span.searchableSelect-option-text', text: 'Hardware', visible: :all)
+        expect(page).to have_selector('span.searchableSelect-option-text', text: 'Monitor', visible: :all)
+        expect(page).to have_no_selector('span.searchableSelect-option-text', text: 'Mouse', visible: :all)
+        expect(page).to have_no_selector('span.searchableSelect-option-text', text: 'Softwareproblem', visible: :all)
       end
     end
 
@@ -1149,7 +1149,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_selector("input[name='#{field_name}'][value='Incident::Hardware::Monitor']", visible: :all, wait: 10)
+        expect(page).to have_selector("input[name='#{field_name}'][value='Incident::Hardware::Monitor']", visible: :all)
       end
     end
 
@@ -1175,7 +1175,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_selector("input[name='#{field_name}'][value='Incident']", visible: :all, wait: 10)
+        expect(page).to have_selector("input[name='#{field_name}'][value='Incident']", visible: :all)
       end
     end
   end
@@ -1201,7 +1201,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_selector(".form-group[data-attribute-name='#{field_name}']", wait: 10)
+        expect(page).to have_selector(".form-group[data-attribute-name='#{field_name}']")
       end
     end
 
@@ -1219,7 +1219,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_selector(".form-group[data-attribute-name='#{field_name}'].is-hidden", visible: :hidden, wait: 10)
+        expect(page).to have_selector(".form-group[data-attribute-name='#{field_name}'].is-hidden", visible: :hidden)
       end
     end
 
@@ -1237,7 +1237,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_selector(".form-group[data-attribute-name='#{field_name}'].is-removed", visible: :hidden, wait: 10)
+        expect(page).to have_selector(".form-group[data-attribute-name='#{field_name}'].is-removed", visible: :hidden)
       end
     end
 
@@ -1255,7 +1255,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page.find("div[data-attribute-name='#{field_name}'] div.formGroup-label label")).to have_no_text('*', wait: 10)
+        expect(page.find("div[data-attribute-name='#{field_name}'] div.formGroup-label label")).to have_no_text('*')
       end
     end
 
@@ -1273,7 +1273,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page.find("div[data-attribute-name='#{field_name}'] div.formGroup-label label")).to have_text('*', wait: 10)
+        expect(page.find("div[data-attribute-name='#{field_name}'] div.formGroup-label label")).to have_text('*')
       end
     end
 
@@ -1291,7 +1291,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_no_selector("div[data-attribute-name='#{field_name}'].is-readonly", wait: 10)
+        expect(page).to have_no_selector("div[data-attribute-name='#{field_name}'].is-readonly")
       end
     end
 
@@ -1309,7 +1309,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_selector("div[data-attribute-name='#{field_name}'].is-readonly", wait: 10)
+        expect(page).to have_selector("div[data-attribute-name='#{field_name}'].is-readonly")
       end
     end
   end
@@ -1335,7 +1335,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_selector(".form-group[data-attribute-name='#{field_name}']", wait: 10)
+        expect(page).to have_selector(".form-group[data-attribute-name='#{field_name}']")
       end
     end
 
@@ -1353,7 +1353,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_selector(".form-group[data-attribute-name='#{field_name}'].is-hidden", visible: :hidden, wait: 10)
+        expect(page).to have_selector(".form-group[data-attribute-name='#{field_name}'].is-hidden", visible: :hidden)
       end
     end
 
@@ -1371,7 +1371,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_selector(".form-group[data-attribute-name='#{field_name}'].is-removed", visible: :hidden, wait: 10)
+        expect(page).to have_selector(".form-group[data-attribute-name='#{field_name}'].is-removed", visible: :hidden)
       end
     end
 
@@ -1389,7 +1389,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page.find("div[data-attribute-name='#{field_name}'] div.formGroup-label label")).to have_no_text('*', wait: 10)
+        expect(page.find("div[data-attribute-name='#{field_name}'] div.formGroup-label label")).to have_no_text('*')
       end
     end
 
@@ -1407,7 +1407,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page.find("div[data-attribute-name='#{field_name}'] div.formGroup-label label")).to have_text('*', wait: 10)
+        expect(page.find("div[data-attribute-name='#{field_name}'] div.formGroup-label label")).to have_text('*')
       end
     end
 
@@ -1425,7 +1425,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_no_selector("div[data-attribute-name='#{field_name}'].is-readonly", wait: 10)
+        expect(page).to have_no_selector("div[data-attribute-name='#{field_name}'].is-readonly")
       end
     end
 
@@ -1443,7 +1443,7 @@ RSpec.shared_examples 'core workflow' do
 
       it 'does perform' do
         before_it.call
-        expect(page).to have_selector("div[data-attribute-name='#{field_name}'].is-readonly", wait: 10)
+        expect(page).to have_selector("div[data-attribute-name='#{field_name}'].is-readonly")
       end
     end
   end
@@ -1476,7 +1476,7 @@ RSpec.shared_examples 'core workflow' do
 
     it 'does not display hidden fields as mandatory' do
       before_it.call
-      expect(page.find("input[name='#{field_name}']", visible: :hidden, wait: 10)[:required]).not_to eq('true')
+      expect(page.find("input[name='#{field_name}']", visible: :hidden)[:required]).not_to eq('true')
     end
   end
 end

+ 11 - 11
spec/system/examples/pagination_examples.rb

@@ -10,38 +10,38 @@ RSpec.shared_examples 'pagination' do |model:, klass:, path:, sort_by: :name|
 
   it 'does paginate', authenticated_as: :authenticate do
     visit path
-    expect(page).to have_css('.js-pager', wait: 10)
+    expect(page).to have_css('.js-pager')
 
     class_page1 = klass.order(sort_by => :asc, id: :asc).offset(50).first
-    expect(page).to have_text(class_page1.name, wait: 10)
+    expect(page).to have_text(class_page1.name)
     expect(page).to have_css('.js-page.is-selected', text: '1')
 
-    page.first('.js-page', text: '2', wait: 10).click
+    page.first('.js-page', text: '2').click
 
     class_page2 = klass.order(sort_by => :asc, id: :asc).offset(175).first
-    expect(page).to have_text(class_page2.name, wait: 10)
+    expect(page).to have_text(class_page2.name)
     expect(page).to have_css('.js-page.is-selected', text: '2')
 
-    page.first('.js-page', text: '3', wait: 10).click
+    page.first('.js-page', text: '3').click
 
     class_page3 = klass.order(sort_by => :asc, id: :asc).offset(325).first
-    expect(page).to have_text(class_page3.name, wait: 10)
+    expect(page).to have_text(class_page3.name)
     expect(page).to have_css('.js-page.is-selected', text: '3')
 
-    page.first('.js-page', text: '4', wait: 10).click
+    page.first('.js-page', text: '4').click
 
     class_page4 = klass.order(sort_by => :asc, id: :asc).offset(475).first
-    expect(page).to have_text(class_page4.name, wait: 10)
+    expect(page).to have_text(class_page4.name)
     expect(page).to have_css('.js-page.is-selected', text: '4')
 
-    page.first('.js-page', text: '1', wait: 10).click
+    page.first('.js-page', text: '1').click
 
     page.first('.js-tableHead[data-column-key=name]').click
-    expect(page).to have_text(class_page1.name, wait: 10)
+    expect(page).to have_text(class_page1.name)
     expect(page).to have_css('.js-page.is-selected', text: '1')
 
     page.first('.js-tableHead[data-column-key=name]').click
     class_last = klass.order(sort_by => :desc).first
-    expect(page).to have_text(class_last.name, wait: 10)
+    expect(page).to have_text(class_last.name)
   end
 end

+ 1 - 1
spec/system/keyboard_shortcuts_spec.rb

@@ -85,7 +85,7 @@ RSpec.describe 'Keyboard Shortcuts', type: :system do
     context 'for list of shortcuts' do
       before do
         send_keys([*hot_keys, 'h'])
-        wait(5).until_exists { find :active_modal_content }
+        wait.until_exists { find :active_modal_content }
       end
 
       it 'shows list of shortcuts' do

+ 1 - 1
spec/system/manage/trigger_spec.rb

@@ -197,7 +197,7 @@ RSpec.describe 'Manage > Trigger', type: :system do
       it 'updates the ticket with the trigger condition' do
         wait.until { ticket.multiselect_previously_changed? && ticket.articles.present? }
         expect(ticket.articles).not_to be_empty
-        expect(page).to have_text 'Test body note', wait: 5
+        expect(page).to have_text 'Test body note'
       end
     end
 

+ 2 - 2
spec/system/manage/users_spec.rb

@@ -42,12 +42,12 @@ RSpec.describe 'Manage > Users', type: :system do
       visit 'manage/users'
 
       within(:active_content) do
-        row = find("tr[data-id=\"#{user.id}\"]", wait: 10)
+        row = find("tr[data-id=\"#{user.id}\"]")
         row.find('.js-action').click
         row.find('.js-switchTo').click
       end
 
-      expect(page).to have_text("Zammad looks like this for \"#{user.firstname} #{user.lastname}\"", wait: 10)
+      expect(page).to have_text("Zammad looks like this for \"#{user.firstname} #{user.lastname}\"")
     end
   end
 

Some files were not shown because too many files changed in this diff