trabajo-afectivo/test/browser/manage_test.rb

221 lines
5.5 KiB
Ruby
Raw Normal View History

2013-03-06 22:15:01 +00:00
# encoding: utf-8
require 'browser_test_helper'
class ManageTest < TestCase
def test_user
2013-03-22 08:29:44 +00:00
random = 'manage-test-' + rand(999999).to_s
user_email = random + '@example.com'
# user
2013-03-06 22:15:01 +00:00
tests = [
{
:name => 'user',
:action => [
{
:execute => 'click',
2013-08-19 21:03:16 +00:00
:css => 'a[href="#manage"]',
2013-03-06 22:15:01 +00:00
},
{
:execute => 'click',
2013-08-19 21:03:16 +00:00
:css => 'a[href="#manage/users"]',
2013-03-06 22:15:01 +00:00
},
{
2014-08-15 12:33:03 +00:00
:execute => 'create_user',
:login => 'some login' + random,
:firstname => 'Manage Firstname' + random,
:lastname => 'Manage Lastname' + random,
:email => user_email,
:password => 'some-pass',
2013-03-06 22:15:01 +00:00
},
{
2013-08-27 21:05:33 +00:00
:execute => 'watch_for',
:area => 'body',
:value => random,
2013-03-06 22:15:01 +00:00
},
{
:execute => 'click',
2014-08-13 09:39:48 +00:00
:css => '.table-overview tr:last-child td',
2013-03-06 22:15:01 +00:00
},
{
:execute => 'wait',
2014-08-13 09:39:48 +00:00
:value => 2,
2013-03-06 22:15:01 +00:00
},
{
:execute => 'set',
2014-05-20 20:00:11 +00:00
:css => '.modal input[name="lastname"]',
2013-03-22 08:29:44 +00:00
:value => '2Manage Lastname' + random,
2013-03-06 22:15:01 +00:00
},
{
:execute => 'click',
2013-06-19 21:41:24 +00:00
:css => '.modal button.submit',
2013-03-06 22:15:01 +00:00
},
{
2013-08-27 21:05:33 +00:00
:execute => 'watch_for',
:area => 'body',
:value => '2Manage Lastname' + random,
2013-03-06 22:15:01 +00:00
},
{
:execute => 'wait',
:value => 1,
},
],
},
2013-03-22 08:29:44 +00:00
{
:name => 'sla',
:action => [
{
:execute => 'click',
2013-08-19 21:03:16 +00:00
:css => 'a[href="#manage"]',
2013-03-22 08:29:44 +00:00
},
{
:execute => 'click',
2013-08-19 21:03:16 +00:00
:css => 'a[href="#manage/slas"]',
2013-03-22 08:29:44 +00:00
},
{
:execute => 'wait',
:value => 2,
},
{
:execute => 'click',
:css => 'a[data-type="new"]',
},
{
:execute => 'wait',
:value => 2,
},
{
:execute => 'set',
2014-05-20 20:00:11 +00:00
:css => '.modal input[name=name]',
2013-03-22 08:29:44 +00:00
:value => 'some sla' + random,
},
{
:execute => 'set',
2014-05-20 20:00:11 +00:00
:css => '.modal input[name="first_response_time"]',
2013-03-22 08:29:44 +00:00
:value => 61,
},
{
:execute => 'click',
2013-06-19 21:41:24 +00:00
:css => '.modal button.submit',
2013-03-22 08:29:44 +00:00
},
{
2013-08-27 21:05:33 +00:00
:execute => 'watch_for',
:area => 'body',
:value => random,
2013-03-22 08:29:44 +00:00
},
2014-08-15 12:33:03 +00:00
{
:execute => 'wait',
:value => 3,
},
2013-03-22 08:29:44 +00:00
{
:execute => 'click',
2014-08-13 09:39:48 +00:00
:css => '.table-overview tr:last-child td',
2013-03-22 08:29:44 +00:00
},
{
:execute => 'wait',
2014-08-15 12:33:03 +00:00
:value => 1,
2013-03-22 08:29:44 +00:00
},
{
:execute => 'set',
2014-05-20 20:00:11 +00:00
:css => '.modal input[name=name]',
2013-03-22 08:29:44 +00:00
:value => 'some sla update ' + random,
},
{
:execute => 'set',
2014-05-20 20:00:11 +00:00
:css => '.modal input[name="first_response_time"]',
2013-03-22 08:29:44 +00:00
:value => 121,
},
{
:execute => 'click',
2013-06-19 21:41:24 +00:00
:css => '.modal button.submit',
2013-03-22 08:29:44 +00:00
},
{
2013-08-27 21:05:33 +00:00
:execute => 'watch_for',
2014-08-15 12:33:03 +00:00
:area => 'body table',
2013-08-27 21:05:33 +00:00
:value => 'some sla update ' + random,
2013-03-22 08:29:44 +00:00
},
{
:execute => 'wait',
2014-08-15 12:33:03 +00:00
:value => 4,
2013-03-22 08:29:44 +00:00
},
{
:execute => 'click',
:css => 'a[data-type="destroy"]:last-child',
},
{
:execute => 'wait',
:value => 2,
},
{
2013-09-02 19:00:08 +00:00
:execute => 'click',
:css => '.modal .submit',
2013-03-22 08:29:44 +00:00
},
{
:execute => 'wait',
2014-08-15 12:33:03 +00:00
:value => 3,
2013-03-22 08:29:44 +00:00
},
{
:execute => 'match',
:css => 'body',
:value => 'some sla update ' + random,
:match_result => false,
},
{
:execute => 'click',
:css => 'a[href="#/"]',
},
{
:execute => 'click',
2013-08-19 21:03:16 +00:00
:css => 'a[href="#manage"]',
2013-03-22 08:29:44 +00:00
},
{
:execute => 'click',
2013-08-19 21:03:16 +00:00
:css => 'a[href="#manage/slas"]',
2013-03-22 08:29:44 +00:00
},
{
:execute => 'wait',
:value => 2,
},
{
:execute => 'match',
:css => 'body',
:value => 'some sla update ' + random,
:match_result => false,
},
2013-06-19 21:41:24 +00:00
{
:execute => 'reload',
},
{
:execute => 'wait',
:value => 2,
},
{
:execute => 'click',
:css => 'a[href="#/"]',
},
{
:execute => 'click',
2013-08-19 21:03:16 +00:00
:css => 'a[href="#manage"]',
2013-06-19 21:41:24 +00:00
},
{
:execute => 'click',
2013-08-19 21:03:16 +00:00
:css => 'a[href="#manage/slas"]',
2013-06-19 21:41:24 +00:00
},
{
:execute => 'wait',
:value => 2,
},
{
:execute => 'match',
:css => 'body',
:value => 'some sla update ' + random,
:match_result => false,
},
2013-03-22 08:29:44 +00:00
],
},
2013-03-06 22:15:01 +00:00
]
browser_signle_test_with_login(tests, { :username => 'master@example.com' })
end
end