Maintenance: Track console js errors in chrome capybara tests.
This commit is contained in:
parent
74da7fa014
commit
2844b6d95d
7 changed files with 34 additions and 8 deletions
|
@ -150,7 +150,7 @@ class App.Search extends App.Controller
|
|||
tabModel = $(e.currentTarget).data('tab-content')
|
||||
tabs.find('.js-tab').removeClass('active')
|
||||
$(e.currentTarget).addClass('active')
|
||||
@renderTab(tabModel, @result[tabModel] || [])
|
||||
@renderTab(tabModel, @result?[tabModel] || [])
|
||||
|
||||
renderTab: (model, localList) =>
|
||||
|
||||
|
@ -231,7 +231,9 @@ class App.Search extends App.Controller
|
|||
@search(true)
|
||||
@delay(callback, 100)
|
||||
|
||||
@bulkForm.releaseController() if @bulkForm
|
||||
@bulkForm = new App.TicketBulkForm(
|
||||
el: @el.find('.bulkAction')
|
||||
holder: localeEl
|
||||
view: @view
|
||||
callback: updateSearch
|
||||
|
@ -239,7 +241,6 @@ class App.Search extends App.Controller
|
|||
)
|
||||
|
||||
# start bulk action observ
|
||||
@el.append(@bulkForm.el)
|
||||
localElement = @$('.js-content')
|
||||
if localElement.find('input[name="bulk"]:checked').length isnt 0
|
||||
@bulkForm.show()
|
||||
|
|
|
@ -1212,13 +1212,14 @@ class Table extends App.Controller
|
|||
|
||||
@renderPopovers()
|
||||
|
||||
@bulkForm.releaseController() if @bulkForm
|
||||
@bulkForm = new App.TicketBulkForm(
|
||||
el: @el.find('.bulkAction')
|
||||
holder: @el
|
||||
view: @view
|
||||
)
|
||||
|
||||
# start bulk action observ
|
||||
@el.append(@bulkForm.el)
|
||||
localElement = @$('.table-overview')
|
||||
if localElement.find('input[name="bulk"]:checked').length isnt 0
|
||||
@bulkForm.show()
|
||||
|
|
|
@ -14,6 +14,8 @@ class App.TicketBulkForm extends App.Controller
|
|||
constructor: ->
|
||||
super
|
||||
|
||||
return if !@permissionCheck('ticket.agent')
|
||||
|
||||
@configure_attributes_ticket = []
|
||||
|
||||
used_attributes = ['state_id', 'pending_time', 'priority_id', 'group_id', 'owner_id']
|
||||
|
|
|
@ -21,3 +21,5 @@
|
|||
<div class="page-content">
|
||||
<div class="table-overview"></div>
|
||||
</div>
|
||||
|
||||
<div class="bulkAction hide"></div>
|
||||
|
|
|
@ -24,3 +24,5 @@
|
|||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="bulkAction hide"></div>
|
||||
|
|
|
@ -34,6 +34,7 @@ returns
|
|||
data[ app_model_ticket ][ id ] = attributes_with_association_ids
|
||||
|
||||
app_model_user = User.to_app_model
|
||||
group.assets(data)
|
||||
|
||||
%w[created_by_id updated_by_id owner_id customer_id].each do |local_user_id|
|
||||
next if !self[ local_user_id ]
|
||||
|
|
17
spec/support/capybara/console_errors.rb
Normal file
17
spec/support/capybara/console_errors.rb
Normal file
|
@ -0,0 +1,17 @@
|
|||
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
|
||||
|
||||
RSpec.configure do |config|
|
||||
config.after(:each, type: :system) do
|
||||
next if page.driver.browser.browser != :chrome
|
||||
|
||||
errors = page.driver.browser.manage.logs.get(:browser).select { |m| m.level == 'SEVERE' && m.to_s =~ %r{EvalError|InternalError|RangeError|ReferenceError|SyntaxError|TypeError|URIError} }
|
||||
if errors.present?
|
||||
Rails.logger.error "JS ERRORS: #{errors.to_json}"
|
||||
errors.each do |error|
|
||||
puts "#{error.message}\n\n"
|
||||
end
|
||||
end
|
||||
|
||||
expect(errors.length).to eq(0)
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue