Fixed browser tests.

This commit is contained in:
Martin Edenhofer 2013-04-24 11:46:48 +02:00
parent d68d77fc19
commit 3ba55da83e
4 changed files with 22 additions and 12 deletions

View file

@ -1162,17 +1162,21 @@ class App.ControllerForm extends App.Controller
@params: (form) ->
param = {}
# create jquery object if not already exists
if typeof form isnt 'function'
form = $(form)
# find form based on sub elements
if $(form).children()[0]
form = $(form).children().parents('form')
if form.children()[0]
form = form.children().parents('form')
# find form based on parents next <form>
else if $(form).parents('form')[0]
form = $(form).parents('form')
else if form.parents('form')[0]
form = form.parents('form')
# find form based on parents next <form>, not really good!
else if $(form).parents().find('form')[0]
form = $(form).parents().find('form')
else if form.parents().find('form')[0]
form = form.parents().find('form')
else
App.Log.log 'ControllerForm', 'error', 'no form found!', form

View file

@ -64,7 +64,7 @@ class App.TicketCreate extends App.Controller
@title @article_attributes['title']
changed: =>
formCurrent = @formParam( '.ticket-create' )
formCurrent = @formParam( @el.find('.ticket-create') )
diff = difference( @formDefault, formCurrent )
return false if !diff || _.isEmpty( diff )
return true
@ -196,7 +196,7 @@ class App.TicketCreate extends App.Controller
el: @el.find('[data-id="text_module"]'),
)
@formDefault = @formParam( '.ticket-create' )
@formDefault = @formParam( @el.find('.ticket-create') )
localUserInfo: (params) =>
@userInfo( user_id: params.customer_id )

View file

@ -53,7 +53,7 @@ class App.TicketZoom extends App.Controller
# @title 'Loading...'
changed: =>
formCurrent = @formParam( '.ticket-update' )
formCurrent = @formParam( @el.find('.ticket-update') )
diff = difference( @formDefault, formCurrent )
return false if !diff || _.isEmpty( diff )
return true
@ -208,7 +208,7 @@ class App.TicketZoom extends App.Controller
# show frontend times
@frontendTimeUpdate()
@formDefault = @formParam( '.ticket-update' )
@formDefault = @formParam( @el.find('.ticket-update') )
# scroll to article if given
if @article_id && document.getElementById( 'article-' + @article_id )

View file

@ -71,7 +71,13 @@ class AgentUserManageTest < TestCase
# call new ticket screen again
{
:execute => 'click',
:css => '.taskbar a[data-type="close"]',
:css => '.taskbar span[data-type="close"]',
},
# accept task close warning
{
:execute => 'accept',
:element => :alert,
},
{
:execute => 'wait',