Fixed browser tests.
This commit is contained in:
parent
d68d77fc19
commit
3ba55da83e
4 changed files with 22 additions and 12 deletions
|
@ -1162,17 +1162,21 @@ class App.ControllerForm extends App.Controller
|
||||||
@params: (form) ->
|
@params: (form) ->
|
||||||
param = {}
|
param = {}
|
||||||
|
|
||||||
|
# create jquery object if not already exists
|
||||||
|
if typeof form isnt 'function'
|
||||||
|
form = $(form)
|
||||||
|
|
||||||
# find form based on sub elements
|
# find form based on sub elements
|
||||||
if $(form).children()[0]
|
if form.children()[0]
|
||||||
form = $(form).children().parents('form')
|
form = form.children().parents('form')
|
||||||
|
|
||||||
# find form based on parents next <form>
|
# find form based on parents next <form>
|
||||||
else if $(form).parents('form')[0]
|
else if form.parents('form')[0]
|
||||||
form = $(form).parents('form')
|
form = form.parents('form')
|
||||||
|
|
||||||
# find form based on parents next <form>, not really good!
|
# find form based on parents next <form>, not really good!
|
||||||
else if $(form).parents().find('form')[0]
|
else if form.parents().find('form')[0]
|
||||||
form = $(form).parents().find('form')
|
form = form.parents().find('form')
|
||||||
else
|
else
|
||||||
App.Log.log 'ControllerForm', 'error', 'no form found!', form
|
App.Log.log 'ControllerForm', 'error', 'no form found!', form
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ class App.TicketCreate extends App.Controller
|
||||||
@title @article_attributes['title']
|
@title @article_attributes['title']
|
||||||
|
|
||||||
changed: =>
|
changed: =>
|
||||||
formCurrent = @formParam( '.ticket-create' )
|
formCurrent = @formParam( @el.find('.ticket-create') )
|
||||||
diff = difference( @formDefault, formCurrent )
|
diff = difference( @formDefault, formCurrent )
|
||||||
return false if !diff || _.isEmpty( diff )
|
return false if !diff || _.isEmpty( diff )
|
||||||
return true
|
return true
|
||||||
|
@ -196,7 +196,7 @@ class App.TicketCreate extends App.Controller
|
||||||
el: @el.find('[data-id="text_module"]'),
|
el: @el.find('[data-id="text_module"]'),
|
||||||
)
|
)
|
||||||
|
|
||||||
@formDefault = @formParam( '.ticket-create' )
|
@formDefault = @formParam( @el.find('.ticket-create') )
|
||||||
|
|
||||||
localUserInfo: (params) =>
|
localUserInfo: (params) =>
|
||||||
@userInfo( user_id: params.customer_id )
|
@userInfo( user_id: params.customer_id )
|
||||||
|
|
|
@ -53,7 +53,7 @@ class App.TicketZoom extends App.Controller
|
||||||
# @title 'Loading...'
|
# @title 'Loading...'
|
||||||
|
|
||||||
changed: =>
|
changed: =>
|
||||||
formCurrent = @formParam( '.ticket-update' )
|
formCurrent = @formParam( @el.find('.ticket-update') )
|
||||||
diff = difference( @formDefault, formCurrent )
|
diff = difference( @formDefault, formCurrent )
|
||||||
return false if !diff || _.isEmpty( diff )
|
return false if !diff || _.isEmpty( diff )
|
||||||
return true
|
return true
|
||||||
|
@ -208,7 +208,7 @@ class App.TicketZoom extends App.Controller
|
||||||
# show frontend times
|
# show frontend times
|
||||||
@frontendTimeUpdate()
|
@frontendTimeUpdate()
|
||||||
|
|
||||||
@formDefault = @formParam( '.ticket-update' )
|
@formDefault = @formParam( @el.find('.ticket-update') )
|
||||||
|
|
||||||
# scroll to article if given
|
# scroll to article if given
|
||||||
if @article_id && document.getElementById( 'article-' + @article_id )
|
if @article_id && document.getElementById( 'article-' + @article_id )
|
||||||
|
|
|
@ -71,7 +71,13 @@ class AgentUserManageTest < TestCase
|
||||||
# call new ticket screen again
|
# call new ticket screen again
|
||||||
{
|
{
|
||||||
:execute => 'click',
|
:execute => 'click',
|
||||||
:css => '.taskbar a[data-type="close"]',
|
:css => '.taskbar span[data-type="close"]',
|
||||||
|
},
|
||||||
|
|
||||||
|
# accept task close warning
|
||||||
|
{
|
||||||
|
:execute => 'accept',
|
||||||
|
:element => :alert,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
:execute => 'wait',
|
:execute => 'wait',
|
||||||
|
|
Loading…
Reference in a new issue