2012-12-14 10:14:48 +00:00
|
|
|
# encoding: utf-8
|
|
|
|
require 'browser_test_helper'
|
2013-02-12 00:56:23 +00:00
|
|
|
|
2012-12-14 10:14:48 +00:00
|
|
|
class TicketCreate < ActiveSupport::TestCase
|
|
|
|
test 'ticket create' do
|
|
|
|
tests = [
|
|
|
|
{
|
|
|
|
:name => 'phone ticket',
|
|
|
|
:action => [
|
|
|
|
{
|
|
|
|
:execute => 'click',
|
|
|
|
:element => :link,
|
|
|
|
:href => '#customer_ticket_new',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'wait',
|
|
|
|
:value => 2,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'check',
|
|
|
|
:element => :div,
|
|
|
|
:id => 'form_create',
|
|
|
|
:result => true,
|
|
|
|
},
|
2013-02-21 21:09:36 +00:00
|
|
|
{
|
|
|
|
:execute => 'wait',
|
|
|
|
:value => 2,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'select',
|
|
|
|
:element => :select_list,
|
|
|
|
:name => 'group_id',
|
|
|
|
:value => 'Users',
|
|
|
|
},
|
2012-12-14 10:14:48 +00:00
|
|
|
{
|
|
|
|
:execute => 'set',
|
|
|
|
:element => :text_field,
|
|
|
|
:name => 'subject',
|
|
|
|
:value => 'some subject 123äöü',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'set',
|
|
|
|
:element => :text_field,
|
|
|
|
:name => 'body',
|
|
|
|
:value => 'some body 123äöü',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'click',
|
|
|
|
:element => :button,
|
|
|
|
:type => 'submit',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'wait',
|
2013-02-21 21:09:36 +00:00
|
|
|
:value => 5,
|
2012-12-14 10:14:48 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'check',
|
|
|
|
:element => :form,
|
|
|
|
:id => 'login',
|
|
|
|
:result => false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'check',
|
|
|
|
:element => :url,
|
|
|
|
:result => '#ticket/zoom/',
|
|
|
|
},
|
2013-02-21 21:09:36 +00:00
|
|
|
|
|
|
|
# check ticket
|
|
|
|
{
|
|
|
|
:execute => 'match',
|
|
|
|
:element => :div,
|
|
|
|
:class => 'article',
|
|
|
|
:value => 'some body 123äöü',
|
|
|
|
:match_result => true,
|
|
|
|
},
|
|
|
|
|
|
|
|
# update ticket
|
|
|
|
{
|
|
|
|
:execute => 'check',
|
|
|
|
:element => :text_field,
|
|
|
|
:name => 'body',
|
|
|
|
:result => true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'set',
|
|
|
|
:element => :text_field,
|
|
|
|
:name => 'body',
|
|
|
|
:value => 'some body 1234 äöüß',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'click',
|
|
|
|
:element => :button,
|
|
|
|
:type => 'submit',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'wait',
|
|
|
|
:value => 5,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
:execute => 'match',
|
|
|
|
:element => :body,
|
|
|
|
: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
|