trabajo-afectivo/test/browser/manage_test.rb

106 lines
2.1 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
random = 'manage-test-' + rand(999_999).to_s
2013-03-22 08:29:44 +00:00
user_email = random + '@example.com'
2015-02-23 13:02:46 +00:00
# user management
@browser = browser_instance
login(
username: 'master@example.com',
password: 'test',
url: browser_url,
2015-02-23 13:02:46 +00:00
)
click( css: 'a[href="#manage"]' )
click( css: 'a[href="#manage/users"]' )
2015-02-23 13:02:46 +00:00
user_create(
data: {
login: 'some login' + random,
firstname: 'Manage Firstname' + random,
lastname: 'Manage Lastname' + random,
email: user_email,
password: 'some-pass',
2015-02-23 13:02:46 +00:00
}
)
click( css: '.table-overview tr:last-child td' )
2015-02-23 13:02:46 +00:00
sleep 2
set(
css: '.modal input[name="lastname"]',
value: '2Manage Lastname' + random,
2015-02-23 13:02:46 +00:00
)
click( css: '.modal button.js-submit' )
2015-02-23 13:02:46 +00:00
watch_for(
css: 'body',
value: '2Manage Lastname' + random,
2015-02-23 13:02:46 +00:00
)
# sla
sla_create(
data: {
name: 'some sla' + random,
first_response_time: 61
2015-02-23 13:02:46 +00:00
}
)
watch_for(
css: 'body',
value: random,
2015-02-23 13:02:46 +00:00
)
sleep 1
click( css: '.table-overview tr:last-child td' )
2015-02-23 13:02:46 +00:00
sleep 1
set(
css: '.modal input[name=name]',
value: 'some sla update ' + random,
2015-02-23 13:02:46 +00:00
)
set(
css: '.modal input[name="first_response_time"]',
value: 121,
2015-02-23 13:02:46 +00:00
)
click( css: '.modal button.js-submit' )
2015-02-23 13:02:46 +00:00
watch_for(
css: 'body',
value: 'some sla update ' + random,
2015-02-23 13:02:46 +00:00
)
sleep 4
2015-05-31 19:47:01 +00:00
click( css: '[data-type="destroy"]:last-child' )
2015-02-23 13:02:46 +00:00
sleep 2
click( css: '.modal button.js-submit' )
2015-02-23 13:02:46 +00:00
sleep 4
match_not(
css: 'body',
value: 'some sla update ' + random,
2015-02-23 13:02:46 +00:00
)
click( css: 'a[href="#manage"]' )
click( css: 'a[href="#manage/slas"]' )
2015-02-23 13:02:46 +00:00
sleep 2
match_not(
css: 'body',
value: 'some sla update ' + random,
2015-02-23 13:02:46 +00:00
)
2015-02-23 13:16:52 +00:00
reload()
2015-02-23 13:02:46 +00:00
sleep 2
click( css: 'a[href="#manage"]' )
click( css: 'a[href="#manage/slas"]' )
2015-02-23 13:02:46 +00:00
sleep 2
match_not(
css: 'body',
value: 'some sla update ' + random,
2015-02-23 13:02:46 +00:00
)
2013-03-06 22:15:01 +00:00
end
end