Some temp. browser test bugfixes.

This commit is contained in:
Martin Edenhofer 2014-10-12 01:35:53 +02:00
parent 3f330a2588
commit f22a87c99f
12 changed files with 218 additions and 216 deletions

View file

@ -151,8 +151,7 @@ class _taskManagerSingleton extends App.Controller
$('#content').empty() $('#content').empty()
# hide all tasks # hide all tasks
$('.content').addClass('hide') $('.content').addClass('hide').removeClass('active')
$('.content').removeClass('active')
# create div for task if not exists # create div for task if not exists
if !$("#content_permanent_#{key}")[0] if !$("#content_permanent_#{key}")[0]
@ -160,9 +159,9 @@ class _taskManagerSingleton extends App.Controller
# set task to shown and active # set task to shown and active
if @activeTask is key if @activeTask is key
$('#content_permanent_' + key).removeClass('hide') $('#content_permanent_' + key).removeClass('hide').addClass('active')
else else
$('#content_permanent_' + key).addClass('hide') $('#content_permanent_' + key).addClass('hide').removeClass('active')
# set all tasks to active false, only new/selected one to active # set all tasks to active false, only new/selected one to active
if active if active

View file

@ -5,7 +5,7 @@
<h1><%- @T( 'New Ticket' ) %></h1> <h1><%- @T( 'New Ticket' ) %></h1>
</div> </div>
<form role="form" class="form-large ticket-create"> <form role="form" class="form-large newTicket">
<div class="ticket-form-top"></div> <div class="ticket-form-top"></div>
<div class="article-form-top"></div> <div class="article-form-top"></div>

View file

@ -92,7 +92,7 @@
<div class="select-arrow icon"></div> <div class="select-arrow icon"></div>
</div> </div>
<div class="form-group"> <div class="form-group">
<input type="submit" class="btn btn--primary js-submit" value="<%- @T('Update') %>"> <button type="submit" class="btn btn--primary js-submit"><%- @T('Update') %></button>
</div> </div>
</form> </form>
</div> </div>

View file

@ -43,18 +43,12 @@ class AgentTicketActionLevel1Test < TestCase
# :value => 'note', # :value => 'note',
#}, #},
{ {
:execute => 'check', :execute => 'set_ticket_attributes',
:css => '.active [data-name="body"]', :body => 'some body 1234 äöüß',
:result => true,
},
{
:execute => 'set',
:css => '.active [data-name="body"]',
:value => 'some body 1234 äöüß',
}, },
{ {
:execute => 'click', :execute => 'click',
:css => '.active input.submit', :css => '.content.active button.js-submit',
}, },
{ {
:execute => 'wait', :execute => 'wait',
@ -97,18 +91,12 @@ class AgentTicketActionLevel1Test < TestCase
# :value => 'note', # :value => 'note',
#}, #},
{ {
:execute => 'check', :execute => 'set_ticket_attributes',
:css => '.content.active [data-name="body"]', :body => 'some body 1234 äöüß 333',
:result => true,
},
{
:execute => 'set',
:css => '.content.active [data-name="body"]',
:value => 'some body 1234 äöüß 333',
}, },
{ {
:execute => 'click', :execute => 'click',
:css => '.content.active input.submit', :css => '.content.active button.js-submit',
}, },
{ {
:execute => 'watch_for', :execute => 'watch_for',

View file

@ -82,64 +82,29 @@ class AgentTicketActionsLevel2Test < TestCase
}, },
# change title in second browser # change title in second browser
# {
# :where => :instance2,
# :execute => 'sendkey',
# :css => '.active .ticket-title-update',
# :value => 'TTT',
# },
# {
# :where => :instance2,
# :execute => 'sendkey',
# :css => '.active .ticket-title-update',
# :value => :tab,
# },
{ {
:where => :instance2, :where => :instance2,
:execute => 'js', :execute => 'set_ticket_attributes',
:value => '$(".active .ticket-title .ticket-title-update").focus()', :title => 'TTTsome level 2 <b>subject</b> 123äöü',
},
{
:where => :instance2,
:execute => 'js',
:value => '$(".active .ticket-title .ticket-title-update").html("TTTsome level 2 &lt;b&gt;subject&lt;/b&gt; 123äöü")',
},
{
:where => :instance2,
:execute => 'js',
:value => '$(".active .ticket-title .ticket-title-update").blur()',
},
{
:where => :instance2,
:execute => 'js',
:value => '$(".active .ticket-title .ticket-title-update").trigger("blur")',
},
{
:execute => 'wait',
:value => 5,
}, },
# set body in edit area # set body in edit area
{ {
:where => :instance2, :where => :instance2,
:execute => 'set', :execute => 'set_ticket_attributes',
:css => '.active [data-name="body"]', :body => 'some level 2 <b>body</b> in instance 2',
:value => 'some level 2 <b>body</b> in instance 2',
}, },
{ {
:where => :instance1, :where => :instance1,
:execute => 'set', :execute => 'set_ticket_attributes',
:css => '.active [data-name="body"]', :body => 'some level 2 <b>body</b> in instance 1',
:value => 'some level 2 <b>body</b> in instance 1',
}, },
# change task and page title in second browser # change task and page title in second browser
{ {
:where => :instance2, :where => :instance2,
:execute => 'match', :execute => 'verify_task_attributes',
:css => '.tasks .active', :title => 'TTTsome level 2 <b>subject</b> 123äöü',
:value => 'TTTsome level 2 <b>subject</b> 123äöü',
:match_result => true,
}, },
{ {
:where => :instance2, :where => :instance2,
@ -154,17 +119,13 @@ class AgentTicketActionsLevel2Test < TestCase
}, },
{ {
:where => :instance1, :where => :instance1,
:execute => 'match', :execute => 'verify_ticket_attributes',
:css => '.active .ticket-title-update', :title => 'TTTsome level 2 <b>subject</b> 123äöü',
:value => 'TTTsome level 2 <b>subject</b> 123äöü',
:match_result => true,
}, },
{ {
:where => :instance2, :where => :instance2,
:execute => 'match', :execute => 'verify_task_attributes',
:css => '.tasks .active', :title => 'TTTsome level 2 <b>subject</b> 123äöü',
:value => 'TTTsome level 2 <b>subject</b> 123äöü',
:match_result => true,
}, },
{ {
:where => :instance1, :where => :instance1,
@ -180,17 +141,13 @@ class AgentTicketActionsLevel2Test < TestCase
# verify text in input body # verify text in input body
{ {
:where => :instance1, :where => :instance1,
:execute => 'match', :execute => 'verify_ticket_attributes',
:css => '.active [data-name="body"]', :body => 'some level 2 <b>body</b> in instance 1',
:value => 'some level 2 <b>body</b> in instance 1',
:match_result => true,
}, },
{ {
:where => :instance2, :where => :instance2,
:execute => 'match', :execute => 'verify_ticket_attributes',
:css => '.active [data-name="body"]', :body => 'some level 2 <b>body</b> in instance 2',
:value => 'some level 2 <b>body</b> in instance 2',
:match_result => true,
}, },
# add new article # add new article
@ -202,14 +159,13 @@ class AgentTicketActionsLevel2Test < TestCase
#}, #},
{ {
:where => :instance1, :where => :instance1,
:execute => 'set', :execute => 'set_ticket_attributes',
:css => '.active [data-name="body"]', :body => 'some update 4711',
:value => 'some update 4711',
}, },
{ {
:where => :instance1, :where => :instance1,
:execute => 'click', :execute => 'click',
:css => '.active input.submit', :css => '.content.active button.js-submit',
}, },
{ {
:where => :instance1, :where => :instance1,
@ -221,20 +177,15 @@ class AgentTicketActionsLevel2Test < TestCase
# verify empty text in input body # verify empty text in input body
{ {
:where => :instance1, :where => :instance1,
:execute => 'match', :execute => 'verify_ticket_attributes',
:css => '.active [data-name="body"]', :body => '',
:value => '',
:match_result => true,
}, },
{ {
:where => :instance2, :where => :instance2,
:execute => 'match', :execute => 'verify_ticket_attributes',
:css => '.active [data-name="body"]', :body => 'some level 2 <b>body</b> in instance 2',
:value => 'some level 2 <b>body</b> in instance 2',
:match_result => true,
}, },
# reload instances, verify again # reload instances, verify again
{ {
:where => :instance1, :where => :instance1,
@ -252,17 +203,13 @@ class AgentTicketActionsLevel2Test < TestCase
}, },
{ {
:where => :instance1, :where => :instance1,
:execute => 'match', :execute => 'verify_ticket_attributes',
:css => '.active .ticket-title-update', :title => 'TTTsome level 2 <b>subject</b> 123äöü',
:value => 'TTTsome level 2 <b>subject</b> 123äöü',
:match_result => true,
}, },
{ {
:where => :instance2, :where => :instance2,
:execute => 'match', :execute => 'verify_task_attributes',
:css => '.tasks .active', :title => 'TTTsome level 2 <b>subject</b> 123äöü',
:value => 'TTTsome level 2 <b>subject</b> 123äöü',
:match_result => true,
}, },
{ {
:where => :instance1, :where => :instance1,
@ -294,17 +241,13 @@ class AgentTicketActionsLevel2Test < TestCase
# verify empty text in input body # verify empty text in input body
{ {
:where => :instance1, :where => :instance1,
:execute => 'match', :execute => 'verify_ticket_attributes',
:css => '.active [data-name="body"]', :body => '',
:value => '',
:match_result => true,
}, },
{ {
:where => :instance2, :where => :instance2,
:execute => 'match', :execute => 'verify_ticket_attributes',
:css => '.active [data-name="body"]', :body => 'some level 2 <b>body</b> in instance 2',
:value => 'some level 2 <b>body</b> in instance 2',
:match_result => true,
}, },
], ],

View file

@ -47,7 +47,7 @@ class AgentTicketActionsLevel3Test < TestCase
:where => :instance1, :where => :instance1,
:execute => 'match', :execute => 'match',
:css => '.active .page-header .ticket-number', :css => '.active .page-header .ticket-number',
:value => '^#(.*)$', :value => '^(.*)$',
:no_quote => true, :no_quote => true,
:match_result => true, :match_result => true,
}, },
@ -88,9 +88,8 @@ class AgentTicketActionsLevel3Test < TestCase
# change edit screen in instance 1 # change edit screen in instance 1
{ {
:where => :instance1, :where => :instance1,
:execute => 'set', :execute => 'set_ticket_attributes',
:css => '.active .ticket-edit textarea[name="body"]', :body => 'some level 3 <b>body</b> in instance 1',
:value => 'some level 3 <b>body</b> in instance 1',
}, },
{ {
:execute => 'wait', :execute => 'wait',
@ -100,9 +99,8 @@ class AgentTicketActionsLevel3Test < TestCase
# update ticket in instance 2 # update ticket in instance 2
{ {
:where => :instance2, :where => :instance2,
:execute => 'set', :execute => 'set_ticket_attributes',
:css => '.active .ticket-edit textarea[name="body"]', :body => 'some level 3 <b>body</b> in instance 2',
:value => 'some level 3 <b>body</b> in instance 2',
}, },
{ {
:execute => 'wait', :execute => 'wait',
@ -111,7 +109,7 @@ class AgentTicketActionsLevel3Test < TestCase
{ {
:where => :instance2, :where => :instance2,
:execute => 'match', :execute => 'match',
:css => '.content_permanent.active .reset-message', :css => '.content.active .js-reset',
:value => '(Discard your unsaved changes.|Verwerfen der)', :value => '(Discard your unsaved changes.|Verwerfen der)',
:no_quote => true, :no_quote => true,
:match_result => true, :match_result => true,
@ -119,7 +117,7 @@ class AgentTicketActionsLevel3Test < TestCase
{ {
:where => :instance2, :where => :instance2,
:execute => 'click', :execute => 'click',
:css => '.active .edit button[type="submit"]', :css => '.active button.js-submit',
}, },
{ {
:execute => 'wait', :execute => 'wait',
@ -128,7 +126,7 @@ class AgentTicketActionsLevel3Test < TestCase
{ {
:where => :instance2, :where => :instance2,
:execute => 'match', :execute => 'match',
:css => '.content_permanent.active .reset-message', :css => '.content.active .js-reset',
:value => '(Discard your unsaved changes.|Verwerfen der)', :value => '(Discard your unsaved changes.|Verwerfen der)',
:no_quote => true, :no_quote => true,
:match_result => false, :match_result => false,
@ -143,16 +141,14 @@ class AgentTicketActionsLevel3Test < TestCase
:match_result => true, :match_result => true,
}, },
{ {
:where => :instance1, :where => :instance1,
:execute => 'match', :execute => 'verify_ticket_attributes',
:css => '.active .ticket-edit textarea[name="body"]', :body => 'some level 3 <b>body</b> in instance 1',
:value => 'some level 3 <b>body</b> in instance 1',
:match_result => true,
}, },
{ {
:where => :instance1, :where => :instance1,
:execute => 'match', :execute => 'match',
:css => '.content_permanent.active .reset-message', :css => '.content.active .js-reset',
:value => '(Discard your unsaved changes.|Verwerfen der)', :value => '(Discard your unsaved changes.|Verwerfen der)',
:no_quote => true, :no_quote => true,
:match_result => true, :match_result => true,
@ -161,18 +157,15 @@ class AgentTicketActionsLevel3Test < TestCase
# check edit screen in instance 2 # check edit screen in instance 2
{ {
:where => :instance2, :where => :instance2,
:execute => 'match', :execute => 'verify_ticket_attributes',
:css => '.active .ticket-edit textarea[name="body"]', :bdoy => '',
:value => '^$',
:no_quote => true,
:match_result => true,
}, },
# update ticket in instance 1 # update ticket in instance 1
{ {
:where => :instance1, :where => :instance1,
:execute => 'click', :execute => 'click',
:css => '.active .edit button[type="submit"]', :css => '.active button.js-submit',
}, },
{ {
:execute => 'wait', :execute => 'wait',
@ -198,32 +191,26 @@ class AgentTicketActionsLevel3Test < TestCase
# check content and edit screen in instance 1+2 # check content and edit screen in instance 1+2
{ {
:where => :instance1, :where => :instance1,
:execute => 'match', :execute => 'verify_ticket_attributes',
:css => '.active .ticket-edit textarea[name="body"]', :body => '',
:value => '^$',
:no_quote => true,
:match_result => true,
}, },
{ {
:where => :instance1, :where => :instance1,
:execute => 'match', :execute => 'match',
:css => '.content_permanent.active .reset-message', :css => '.content.active .js-reset',
:value => '(Discard your unsaved changes.|Verwerfen der)', :value => '(Discard your unsaved changes.|Verwerfen der)',
:no_quote => true, :no_quote => true,
:match_result => false, :match_result => false,
}, },
{ {
:where => :instance2, :where => :instance2,
:execute => 'match', :execute => 'verify_ticket_attributes',
:css => '.active .ticket-edit textarea[name="body"]', :body => '',
:value => '^$',
:no_quote => true,
:match_result => true,
}, },
{ {
:where => :instance2, :where => :instance2,
:execute => 'match', :execute => 'match',
:css => '.content_permanent.active .reset-message', :css => '.content.active .js-reset',
:value => '(Discard your unsaved changes.|Verwerfen der)', :value => '(Discard your unsaved changes.|Verwerfen der)',
:no_quote => true, :no_quote => true,
:match_result => false, :match_result => false,
@ -242,32 +229,26 @@ class AgentTicketActionsLevel3Test < TestCase
# check content and edit screen in instance 1+2 # check content and edit screen in instance 1+2
{ {
:where => :instance1, :where => :instance1,
:execute => 'match', :execute => 'verify_ticket_attributes',
:css => '.active .ticket-edit textarea[name="body"]', :body => '',
:value => '^$',
:no_quote => true,
:match_result => true,
}, },
{ {
:where => :instance1, :where => :instance1,
:execute => 'match', :execute => 'match',
:css => '.content_permanent.active .reset-message', :css => '.content.active .js-reset',
:value => '(Discard your unsaved changes.|Verwerfen der)', :value => '(Discard your unsaved changes.|Verwerfen der)',
:no_quote => true, :no_quote => true,
:match_result => false, :match_result => false,
}, },
{ {
:where => :instance2, :where => :instance2,
:execute => 'match', :execute => 'verify_ticket_attributes',
:css => '.active .ticket-edit textarea[name="body"]', :body => '',
:value => '^$',
:no_quote => true,
:match_result => true,
}, },
{ {
:where => :instance2, :where => :instance2,
:execute => 'match', :execute => 'match',
:css => '.content_permanent.active .reset-message', :css => '.content.active .js-reset',
:value => '(Discard your unsaved changes.|Verwerfen der)', :value => '(Discard your unsaved changes.|Verwerfen der)',
:no_quote => true, :no_quote => true,
:match_result => false, :match_result => false,
@ -275,10 +256,9 @@ class AgentTicketActionsLevel3Test < TestCase
# change form of ticket in instance 2 # change form of ticket in instance 2
{ {
:where => :instance2, :where => :instance2,
:execute => 'set', :execute => 'set_ticket_attributes',
:css => '.active .ticket-edit textarea[name="body"]', :body => '22 some level 3 <b>body</b> in instance 2',
:value => '22 some level 3 <b>body</b> in instance 2',
}, },
{ {
:execute => 'wait', :execute => 'wait',
@ -287,7 +267,7 @@ class AgentTicketActionsLevel3Test < TestCase
{ {
:where => :instance2, :where => :instance2,
:execute => 'match', :execute => 'match',
:css => '.content_permanent.active .reset-message', :css => '.content.active .js-reset',
:value => '(Discard your unsaved changes.|Verwerfen der)', :value => '(Discard your unsaved changes.|Verwerfen der)',
:no_quote => true, :no_quote => true,
:match_result => true, :match_result => true,
@ -298,15 +278,13 @@ class AgentTicketActionsLevel3Test < TestCase
}, },
{ {
:where => :instance2, :where => :instance2,
:execute => 'match', :execute => 'verify_ticket_attributes',
:css => '.active .ticket-edit textarea[name="body"]', :body => '22 some level 3 <b>body</b> in instance 2',
:value => '22 some level 3 <b>body</b> in instance 2',
:match_result => true,
}, },
{ {
:where => :instance2, :where => :instance2,
:execute => 'match', :execute => 'match',
:css => '.content_permanent.active .reset-message', :css => '.content.active .js-reset',
:value => '(Discard your unsaved changes.|Verwerfen der)', :value => '(Discard your unsaved changes.|Verwerfen der)',
:no_quote => true, :no_quote => true,
:match_result => true, :match_result => true,
@ -314,7 +292,7 @@ class AgentTicketActionsLevel3Test < TestCase
{ {
:where => :instance2, :where => :instance2,
:execute => 'click', :execute => 'click',
:css => '.active .edit button[type="submit"]', :css => '.active button.js-submit',
}, },
{ {
:execute => 'wait', :execute => 'wait',
@ -324,7 +302,7 @@ class AgentTicketActionsLevel3Test < TestCase
:where => :instance2, :where => :instance2,
:execute => 'match', :execute => 'match',
:css => '.content_permanent.active', :css => '.content_permanent.active',
:css => '.content_permanent.active .reset-message', :css => '.content.active .js-reset',
:value => '(Discard your unsaved changes.|Verwerfen der)', :value => '(Discard your unsaved changes.|Verwerfen der)',
:no_quote => true, :no_quote => true,
:match_result => false, :match_result => false,

View file

@ -35,7 +35,7 @@ class AgentTicketActionLevel4Test < TestCase
{ {
:execute => 'click', :execute => 'click',
:css => '.active .form-actions button[type="submit"]', :css => '.content.active button.submit',
}, },
{ {
:execute => 'wait', :execute => 'wait',

View file

@ -134,8 +134,14 @@ class AgentTicketActionLevel5Test < TestCase
:match_result => true, :match_result => true,
}, },
{ {
:execute => 'click', :execute => 'sendkey',
:css => '.-sew-list-item.selected', :css => '.active .shortcut',
:value => :arrow_down,
},
{
:execute => 'sendkey',
:css => '.active .shortcut',
:value => :enter,
}, },
{ {
:execute => 'wait', :execute => 'wait',
@ -308,8 +314,15 @@ class AgentTicketActionLevel5Test < TestCase
}, },
{ {
:where => :instance2, :where => :instance2,
:execute => 'click', :execute => 'sendkey',
:css => '.-sew-list-item.selected', :css => '.active .shortcut',
:value => :arrow_down,
},
{
:where => :instance2,
:execute => 'sendkey',
:css => '.active .shortcut',
:value => :enter,
}, },
{ {
:where => :instance2, :where => :instance2,
@ -330,7 +343,7 @@ class AgentTicketActionLevel5Test < TestCase
{ {
:where => :instance2, :where => :instance2,
:execute => 'set', :execute => 'set',
:css => '.active .ticket-create input[name="customer_id_completion"]', :css => '.active .newTicket input[name="customer_id_completion"]',
:value => 'nicole', :value => 'nicole',
}, },
{ {
@ -340,13 +353,13 @@ class AgentTicketActionLevel5Test < TestCase
{ {
:where => :instance2, :where => :instance2,
:execute => 'sendkey', :execute => 'sendkey',
:css => '.active .ticket-create input[name="customer_id_completion"]', :css => '.active .newTicket input[name="customer_id_completion"]',
:value => :arrow_down, :value => :arrow_down,
}, },
{ {
:where => :instance2, :where => :instance2,
:execute => 'sendkey', :execute => 'sendkey',
:css => '.active .ticket-create input[name="customer_id_completion"]', :css => '.active .newTicket input[name="customer_id_completion"]',
:value => :tab, :value => :tab,
}, },
{ {
@ -367,8 +380,15 @@ class AgentTicketActionLevel5Test < TestCase
}, },
{ {
:where => :instance2, :where => :instance2,
:execute => 'click', :execute => 'sendkey',
:css => '.-sew-list-item.selected', :css => '.active .shortcut',
:value => :arrow_down,
},
{
:where => :instance2,
:execute => 'sendkey',
:css => '.active .shortcut',
:value => :enter,
}, },
{ {
:where => :instance2, :where => :instance2,
@ -446,8 +466,15 @@ class AgentTicketActionLevel5Test < TestCase
}, },
{ {
:where => :instance2, :where => :instance2,
:execute => 'click', :execute => 'sendkey',
:css => '.-sew-list-item.selected', :css => '.active .shortcut',
:value => :arrow_down,
},
{
:where => :instance2,
:execute => 'sendkey',
:css => '.active .shortcut',
:value => :enter,
}, },
{ {
:execute => 'wait', :execute => 'wait',
@ -547,8 +574,15 @@ class AgentTicketActionLevel5Test < TestCase
# }, # },
{ {
:where => :instance2, :where => :instance2,
:execute => 'click', :execute => 'sendkey',
:css => '.-sew-list-item.selected', :css => '.active .shortcut',
:value => :arrow_down,
},
{
:where => :instance2,
:execute => 'sendkey',
:css => '.active .shortcut',
:value => :enter,
}, },
{ {
:execute => 'wait', :execute => 'wait',

View file

@ -151,7 +151,7 @@ class AgentUserManageTest < TestCase
}, },
{ {
:execute => 'set', :execute => 'set',
:css => '.active .ticket-create input[name="customer_id_completion"]', :css => '.active .newTicket input[name="customer_id_completion"]',
:value => customer_user_email, :value => customer_user_email,
}, },
{ {
@ -160,12 +160,12 @@ class AgentUserManageTest < TestCase
}, },
{ {
:execute => 'sendkey', :execute => 'sendkey',
:css => '.active .ticket-create input[name="customer_id_completion"]', :css => '.active .newTicket input[name="customer_id_completion"]',
:value => :arrow_down, :value => :arrow_down,
}, },
{ {
:execute => 'sendkey', :execute => 'sendkey',
:css => '.active .ticket-create input[name="customer_id_completion"]', :css => '.active .newTicket input[name="customer_id_completion"]',
:value => :enter, :value => :enter,
}, },
{ {

View file

@ -21,27 +21,27 @@ class CustomerTicketCreateTest < TestCase
}, },
{ {
:execute => 'check', :execute => 'check',
:css => '.ticket-create', :css => '.newTicket',
:result => true, :result => true,
}, },
{ {
:execute => 'select', :execute => 'select',
:css => '.ticket-create select[name="group_id"]', :css => '.newTicket select[name="group_id"]',
:value => 'Users', :value => 'Users',
}, },
{ {
:execute => 'set', :execute => 'set',
:css => '.ticket-create input[name="title"]', :css => '.newTicket input[name="title"]',
:value => 'some subject 123äöü', :value => 'some subject 123äöü',
}, },
{ {
:execute => 'set', :execute => 'set',
:css => '.ticket-create [data-name="body"]', :css => '.newTicket [data-name="body"]',
:value => 'some body 123äöü', :value => 'some body 123äöü',
}, },
{ {
:execute => 'click', :execute => 'click',
:css => '.ticket-create button[type="submit"]', :css => '.newTicket button.submit',
}, },
{ {
:execute => 'wait', :execute => 'wait',
@ -74,7 +74,7 @@ class CustomerTicketCreateTest < TestCase
}, },
{ {
:execute => 'click', :execute => 'click',
:css => '.active input[type="submit"]', :css => '.active button.js-submit',
:type => 'submit', :type => 'submit',
}, },
{ {

View file

@ -32,12 +32,12 @@ class TaskbarTaskTest < TestCase
}, },
{ {
:execute => 'check', :execute => 'check',
:css => '.active .ticket-create', :css => '.active .newTicket',
:result => true, :result => true,
}, },
{ {
:execute => 'set', :execute => 'set',
:css => '.active .ticket-create input[name="title"]', :css => '.active .newTicket input[name="title"]',
:value => 'some test AAA', :value => 'some test AAA',
}, },
{ {
@ -112,7 +112,7 @@ class TaskbarTaskTest < TestCase
}, },
{ {
:execute => 'set', :execute => 'set',
:css => '.active .ticket-create input[name="title"]', :css => '.active .newTicket input[name="title"]',
:value => 'INBOUND TEST#1', :value => 'INBOUND TEST#1',
}, },
{ {
@ -121,7 +121,7 @@ class TaskbarTaskTest < TestCase
}, },
{ {
:execute => 'set', :execute => 'set',
:css => '.active .ticket-create [data-name="body"]', :css => '.active .newTicket [data-name="body"]',
:value => 'INBOUND BODY TEST#1', :value => 'INBOUND BODY TEST#1',
}, },
{ {
@ -138,7 +138,7 @@ class TaskbarTaskTest < TestCase
}, },
{ {
:execute => 'set', :execute => 'set',
:css => '.active .ticket-create input[name="title"]', :css => '.active .newTicket input[name="title"]',
:value => 'OUTBOUND TEST#1', :value => 'OUTBOUND TEST#1',
}, },
{ {
@ -147,7 +147,7 @@ class TaskbarTaskTest < TestCase
}, },
{ {
:execute => 'set', :execute => 'set',
:css => '.active .ticket-create [data-name="body"]', :css => '.active .newTicket [data-name="body"]',
:value => 'OUTBOUND BODY TEST#1', :value => 'OUTBOUND BODY TEST#1',
}, },
{ {

View file

@ -270,9 +270,9 @@ class TestCase < Test::Unit::TestCase
sleep 2 sleep 2
instance.find_element( { :css => 'a[data-type="new"]' } ).click instance.find_element( { :css => 'a[data-type="new"]' } ).click
sleep 2 sleep 2
element = instance.find_element( { :css => '.modal input[name=login]' } ) #element = instance.find_element( { :css => '.modal input[name=login]' } )
element.clear #element.clear
element.send_keys( action[:login] ) #element.send_keys( action[:login] )
element = instance.find_element( { :css => '.modal input[name=firstname]' } ) element = instance.find_element( { :css => '.modal input[name=firstname]' } )
element.clear element.clear
element.send_keys( action[:firstname] ) element.send_keys( action[:firstname] )
@ -301,42 +301,100 @@ class TestCase < Test::Unit::TestCase
} }
assert( true, "(#{test[:name]}) user creation failed" ) assert( true, "(#{test[:name]}) user creation failed" )
return return
elsif action[:execute] == 'verify_task_attributes'
if action[:title]
element = instance.find_element( { :css => '.tasks .active' } )
assert_equal( action[:title], element.text.strip )
end
return
elsif action[:execute] == 'verify_ticket_attributes'
if action[:title]
element = instance.find_element( { :css => '.content.active .page-header .ticket-title-update' } )
assert_equal( action[:title], element.text.strip )
end
if action[:body]
element = instance.find_element( { :css => '.content.active [data-name="body"]' } )
assert_equal( action[:body], element.text.strip )
end
return
elsif action[:execute] == 'set_ticket_attributes'
if action[:title]
element = instance.find_element( { :css => '.content.active .page-header .ticket-title-update' } )
instance.execute_script( '$(".content.active .page-header .ticket-title-update").focus()' )
instance.execute_script( '$(".content.active .page-header .ticket-title-update").text("' + action[:title] + '")' )
instance.execute_script( '$(".content.active .page-header .ticket-title-update").blur()' )
instance.execute_script( '$(".content.active .page-header .ticket-title-update").trigger("blur")' )
# {
# :where => :instance2,
# :execute => 'sendkey',
# :css => '.content.active .page-header .ticket-title-update',
# :value => 'TTT',
# },
# {
# :where => :instance2,
# :execute => 'sendkey',
# :css => '.content.active .page-header .ticket-title-update',
# :value => :tab,
# },
end
if action[:body]
element = instance.find_element( { :css => '.content.active [data-name="body"]' } )
element.clear
element.send_keys( action[:body] )
# check if body is filled / in case use workaround
body = element.text
puts "body '#{body}'"
if !body || body.empty? || body == '' || body == ' '
result = instance.execute_script( '$(".content.active [data-name=body]").text("' + action[:body] + '")' )
puts "r #{result.inspect}"
end
end
return
elsif action[:execute] == 'create_ticket' elsif action[:execute] == 'create_ticket'
instance.find_element( { :css => 'a[href="#new"]' } ).click instance.find_element( { :css => 'a[href="#new"]' } ).click
instance.find_element( { :css => 'a[href="#ticket/create"]' } ).click instance.find_element( { :css => 'a[href="#ticket/create"]' } ).click
element = instance.find_element( { :css => '.active .ticket-create' } ) element = instance.find_element( { :css => '.active .newTicket' } )
if !element if !element
assert( false, "(#{test[:name]}) no ticket create screen found!" ) assert( false, "(#{test[:name]}) no ticket create screen found!" )
return return
end end
sleep 2 sleep 2
element = instance.find_element( { :css => '.active .ticket-create input[name="customer_id_autocompletion"]' } ) element = instance.find_element( { :css => '.active .newTicket input[name="customer_id_completion"]' } )
element.click
element.clear element.clear
element.send_keys( 'nico*' ) element.send_keys( 'nico*' )
sleep 4 sleep 4
element = instance.find_element( { :css => '.active .ticket-create input[name="customer_id_autocompletion"]' } ) element = instance.find_element( { :css => '.active .newTicket input[name="customer_id_completion"]' } )
element.send_keys( :arrow_down ) element.send_keys( :arrow_down )
sleep 0.2 sleep 0.3
element = instance.find_element( { :css => '.active .ticket-create input[name="customer_id_autocompletion"]' } ) element = instance.find_element( { :css => '.active .newTicket input[name="customer_id_completion"]' } )
element.send_keys( :tab ) element.send_keys( :enter )
sleep 0.1 sleep 0.3
element = instance.find_element( { :css => '.active .ticket-create select[name="group_id"]' } ) element = instance.find_element( { :css => '.active .newTicket select[name="group_id"]' } )
dropdown = Selenium::WebDriver::Support::Select.new(element) dropdown = Selenium::WebDriver::Support::Select.new(element)
dropdown.select_by( :text, action[:group]) dropdown.select_by( :text, action[:group])
sleep 0.1 sleep 0.2
element = instance.find_element( { :css => '.active .ticket-create input[name="title"]' } ) element = instance.find_element( { :css => '.active .newTicket input[name="title"]' } )
element.clear element.clear
element.send_keys( action[:subject] ) element.send_keys( action[:subject] )
sleep 0.1 sleep 0.2
element = instance.find_element( { :css => '.active .ticket-create textarea[name="body"]' } ) element = instance.find_element( { :css => '.active .newTicket [data-name="body"]' } )
element.clear element.clear
element.send_keys( action[:body] ) element.send_keys( action[:body] )
# check if body is filled / in case use workaround
body = element.text
puts "body '#{body}'"
if !body || body.empty? || body == '' || body == ' '
result = instance.execute_script( '$(".content.active .newTicket [data-name=body]").text("' + action[:body] + '")' )
puts "r #{result.inspect}"
end
if action[:do_not_submit] if action[:do_not_submit]
assert( true, "(#{test[:name]}) ticket created without submit" ) assert( true, "(#{test[:name]}) ticket created without submit" )
return return
end end
sleep 0.8 sleep 0.8
instance.find_element( { :css => '.active .form-actions button[type="submit"]' } ).click instance.find_element( { :css => '.content.active button.submit' } ).click
sleep 1 sleep 1
(1..14).each {|loop| (1..14).each {|loop|
if instance.current_url =~ /#{Regexp.quote('#ticket/zoom/')}/ if instance.current_url =~ /#{Regexp.quote('#ticket/zoom/')}/
@ -452,6 +510,7 @@ class TestCase < Test::Unit::TestCase
elsif action[:css] =~ /(input|textarea)/i elsif action[:css] =~ /(input|textarea)/i
text = element.attribute('value') text = element.attribute('value')
else else
puts "'DAT ' #{element.text}"
text = element.text text = element.text
end end
if action[:value] == '###stack###' if action[:value] == '###stack###'
@ -459,6 +518,7 @@ class TestCase < Test::Unit::TestCase
end end
match = false match = false
if action[:no_quote] if action[:no_quote]
puts "aaaa #{text}/#{action[:value]}"
if text =~ /#{action[:value]}/ if text =~ /#{action[:value]}/
if $1 if $1
@stack = $1 @stack = $1