2012-12-14 10:14:48 +00:00
|
|
|
# encoding: utf-8
|
|
|
|
require 'browser_test_helper'
|
2013-02-12 00:56:23 +00:00
|
|
|
|
2013-02-23 22:54:48 +00:00
|
|
|
class CustomerTicketCreateTest < TestCase
|
|
|
|
def test_customer_ticket_create
|
2012-12-14 10:14:48 +00:00
|
|
|
tests = [
|
|
|
|
{
|
2013-02-21 21:58:55 +00:00
|
|
|
:name => 'customer ticket create',
|
2012-12-14 10:14:48 +00:00
|
|
|
:action => [
|
|
|
|
{
|
|
|
|
:execute => 'click',
|
2013-02-22 10:36:00 +00:00
|
|
|
:css => 'a[href="#customer_ticket_new"]',
|
2012-12-14 10:14:48 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'wait',
|
|
|
|
:value => 2,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'check',
|
2013-02-22 10:36:00 +00:00
|
|
|
:css => '#form_create',
|
2012-12-14 10:14:48 +00:00
|
|
|
:result => true,
|
|
|
|
},
|
2013-02-21 21:09:36 +00:00
|
|
|
{
|
|
|
|
:execute => 'wait',
|
|
|
|
:value => 2,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'select',
|
2013-02-22 10:36:00 +00:00
|
|
|
:css => '#form_create select[name="group_id"]',
|
2013-02-21 21:09:36 +00:00
|
|
|
:value => 'Users',
|
|
|
|
},
|
2012-12-14 10:14:48 +00:00
|
|
|
{
|
|
|
|
:execute => 'set',
|
2013-02-22 10:36:00 +00:00
|
|
|
:css => '#form_create input[name="subject"]',
|
2012-12-14 10:14:48 +00:00
|
|
|
:value => 'some subject 123äöü',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'set',
|
2013-02-22 10:36:00 +00:00
|
|
|
:css => '#form_create textarea[name="body"]',
|
2012-12-14 10:14:48 +00:00
|
|
|
:value => 'some body 123äöü',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'click',
|
2013-02-22 10:36:00 +00:00
|
|
|
:css => 'button[type="submit"]',
|
2012-12-14 10:14:48 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'wait',
|
2013-02-21 21:09:36 +00:00
|
|
|
:value => 5,
|
2012-12-14 10:14:48 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'check',
|
2013-02-22 10:36:00 +00:00
|
|
|
:css => '#login',
|
2012-12-14 10:14:48 +00:00
|
|
|
:result => false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'check',
|
|
|
|
:element => :url,
|
|
|
|
:result => '#ticket/zoom/',
|
|
|
|
},
|
2013-02-21 21:09:36 +00:00
|
|
|
|
|
|
|
# check ticket
|
|
|
|
{
|
|
|
|
:execute => 'match',
|
2013-02-22 10:36:00 +00:00
|
|
|
:css => 'div.article',
|
2013-02-21 21:09:36 +00:00
|
|
|
:value => 'some body 123äöü',
|
|
|
|
:match_result => true,
|
|
|
|
},
|
|
|
|
|
|
|
|
# update ticket
|
|
|
|
{
|
|
|
|
:execute => 'check',
|
2013-02-22 10:36:00 +00:00
|
|
|
:css => 'textarea[name="body"]',
|
2013-02-21 21:09:36 +00:00
|
|
|
:result => true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'set',
|
2013-02-22 10:36:00 +00:00
|
|
|
:css => 'textarea[name="body"]',
|
2013-02-21 21:09:36 +00:00
|
|
|
:value => 'some body 1234 äöüß',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'click',
|
2013-02-22 10:36:00 +00:00
|
|
|
:css => 'button',
|
2013-02-21 21:09:36 +00:00
|
|
|
:type => 'submit',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'wait',
|
|
|
|
:value => 5,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'match',
|
2013-02-22 10:36:00 +00:00
|
|
|
:css => 'body',
|
2013-02-21 21:09:36 +00:00
|
|
|
:value => 'some body 1234 äöüß',
|
|
|
|
:match_result => true,
|
|
|
|
},
|
2012-12-14 10:14:48 +00:00
|
|
|
],
|
|
|
|
},
|
|
|
|
]
|
|
|
|
browser_signle_test_with_login(tests)
|
|
|
|
end
|
2013-02-12 00:56:23 +00:00
|
|
|
end
|