trabajo-afectivo/test/browser/customer_ticket_create.rb

111 lines
2.7 KiB
Ruby
Raw Normal View History

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-21 21:58:55 +00:00
class CustomerTicketCreate < ActiveSupport::TestCase
test 'customer ticket create' do
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',
:element => :link,
:href => '#customer_ticket_new',
},
{
:execute => 'wait',
:value => 2,
},
{
:execute => 'check',
:element => :div,
:id => 'form_create',
:result => true,
},
{
: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',
: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/',
},
# 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