Maintenance: Track console js errors in chrome capybara tests.

This commit is contained in:
Rolf Schmidt 2022-04-04 20:26:01 +02:00
parent 74da7fa014
commit 2844b6d95d
7 changed files with 34 additions and 8 deletions

View file

@ -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,15 +231,16 @@ class App.Search extends App.Controller
@search(true)
@delay(callback, 100)
@bulkForm.releaseController() if @bulkForm
@bulkForm = new App.TicketBulkForm(
holder: localeEl
view: @view
callback: updateSearch
el: @el.find('.bulkAction')
holder: localeEl
view: @view
callback: updateSearch
noSidebar: true
)
# start bulk action observ
@el.append(@bulkForm.el)
localElement = @$('.js-content')
if localElement.find('input[name="bulk"]:checked').length isnt 0
@bulkForm.show()

View file

@ -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
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()

View file

@ -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']

View file

@ -20,4 +20,6 @@
<div class="page-content">
<div class="table-overview"></div>
</div>
</div>
<div class="bulkAction hide"></div>

View file

@ -24,3 +24,5 @@
</div>
</div>
<div class="bulkAction hide"></div>

View file

@ -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 ]

View 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