From 8b16a5a7b87bcf5e637a75bb897ab091aa510fa6 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 27 Aug 2013 23:26:43 +0200 Subject: [PATCH 1/6] Small test improvements. --- test/browser/aaa_getting_started_test.rb | 10 +++++----- test/browser_test_helper.rb | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/browser/aaa_getting_started_test.rb b/test/browser/aaa_getting_started_test.rb index 702d03e58..f44281558 100644 --- a/test/browser/aaa_getting_started_test.rb +++ b/test/browser/aaa_getting_started_test.rb @@ -93,16 +93,16 @@ class AaaGettingStartedTest < TestCase :execute => 'click', :css => '#form-agent button[type="submit"]', }, - { - :execute => 'check', - :element => :url, - :result => '#getting_started', - }, { :execute => 'watch_for', :area => 'body', :value => 'Invitation sent', }, + { + :execute => 'check', + :element => :url, + :result => '#getting_started', + }, { :execute => 'match', :css => 'body', diff --git a/test/browser_test_helper.rb b/test/browser_test_helper.rb index cc5f4036a..1cd5c1d16 100644 --- a/test/browser_test_helper.rb +++ b/test/browser_test_helper.rb @@ -245,14 +245,14 @@ class TestCase < Test::Unit::TestCase assert( false, "(#{test[:name]}) no login box found!" ) return elsif action[:execute] == 'watch_for' - (1..24).each { |loop| + (1..36).each { |loop| element = instance.find_element( { :css => action[:area] } ) text = element.text if text =~ /#{action[:value]}/i assert( true, "(#{test[:name]}) '#{action[:value]}' found in '#{text}'" ) return end - sleep 0.5 + sleep 0.33 } assert( false, "(#{test[:name]}) '#{action[:value]}' found in '#{text}'" ) return From e684568e61bbd3752e803516eae11391694dbc1d Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 28 Aug 2013 00:56:17 +0200 Subject: [PATCH 2/6] Do not update session for long polling. --- app/controllers/long_polling_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/long_polling_controller.rb b/app/controllers/long_polling_controller.rb index ae4590672..d1c6d583b 100644 --- a/app/controllers/long_polling_controller.rb +++ b/app/controllers/long_polling_controller.rb @@ -1,6 +1,7 @@ # Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/ class LongPollingController < ApplicationController + skip_filter :session_update # GET /api/v1/message_send def message_send From 95310601a8c008aa3cd4a2c14eb28deec194b11b Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 28 Aug 2013 08:39:24 +0200 Subject: [PATCH 3/6] Fixed syntax issue. --- test/browser_test_helper.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/test/browser_test_helper.rb b/test/browser_test_helper.rb index 1cd5c1d16..0a5f90035 100644 --- a/test/browser_test_helper.rb +++ b/test/browser_test_helper.rb @@ -245,6 +245,7 @@ class TestCase < Test::Unit::TestCase assert( false, "(#{test[:name]}) no login box found!" ) return elsif action[:execute] == 'watch_for' + text = '' (1..36).each { |loop| element = instance.find_element( { :css => action[:area] } ) text = element.text From 8a4c3388e4eb05593b320d971959077f482742eb Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 28 Aug 2013 08:40:02 +0200 Subject: [PATCH 4/6] Try to avoid "Mysql2::Error: This connection is in use by: # queue return end - sleep 2 + 8.times {|loop| + sleep 0.25 + } + #sleep 2 if count == 0 render :json => { :action => 'pong' } return From 374b4315f0568e45019d4af177d88926d791c429 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 2 Sep 2013 21:00:08 +0200 Subject: [PATCH 5/6] Moved to build in confirm dialog. --- .../_application_controller_generic.js.coffee | 25 ++++++++++++++++++- test/browser/manage_test.rb | 4 +-- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/app/controllers/_application_controller_generic.js.coffee b/app/assets/javascripts/app/controllers/_application_controller_generic.js.coffee index 530565c56..8acc101d1 100644 --- a/app/assets/javascripts/app/controllers/_application_controller_generic.js.coffee +++ b/app/assets/javascripts/app/controllers/_application_controller_generic.js.coffee @@ -167,7 +167,9 @@ class App.ControllerGenericIndex extends App.ControllerContent destroy: (e) -> item = $(e.target).item( App[ @genericObject ] ) - item.destroy() if confirm('Sure?') + new DestroyConfirm( + item: item + ) new: (e) -> e.preventDefault() @@ -176,6 +178,27 @@ class App.ControllerGenericIndex extends App.ControllerContent genericObject: @genericObject ) +class DestroyConfirm extends App.ControllerModal + constructor: -> + super + @render() + + render: -> + @html App.view('modal')( + title: 'Confirm' + message: 'Sure to delete this object?' + cancel: true + button: 'Yes' + ) + @modalShow( + backdrop: true, + keyboard: true, + ) + + submit: (e) => + @modalHide() + @item.destroy() + class App.ControllerLevel2 extends App.ControllerContent events: 'click [data-toggle="tabnav"]': 'toggle', diff --git a/test/browser/manage_test.rb b/test/browser/manage_test.rb index 682abbea6..4699a7f8d 100644 --- a/test/browser/manage_test.rb +++ b/test/browser/manage_test.rb @@ -184,8 +184,8 @@ class ManageTest < TestCase :value => 2, }, { - :execute => 'accept', - :element => :alert, + :execute => 'click', + :css => '.modal .submit', }, { :execute => 'wait', From c4a14dbf24b18ea8710d2ce14823a92c9adf9a56 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 3 Sep 2013 05:35:06 +0200 Subject: [PATCH 6/6] Increased speed of open tasks. --- app/assets/javascripts/app/lib/app_post/task_manager.js.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/app/lib/app_post/task_manager.js.coffee b/app/assets/javascripts/app/lib/app_post/task_manager.js.coffee index 264cbd403..da9aa3a32 100644 --- a/app/assets/javascripts/app/lib/app_post/task_manager.js.coffee +++ b/app/assets/javascripts/app/lib/app_post/task_manager.js.coffee @@ -379,7 +379,7 @@ class _taskManagerSingleton extends App.Controller App.Delay.set( => @add(task.key, task.callback, task.params, true) - task_count * 900 + task_count * 600 undefined 'task' )