2013-03-06 22:15:01 +00:00
|
|
|
require 'browser_test_helper'
|
|
|
|
|
|
|
|
class ManageTest < TestCase
|
|
|
|
def test_user
|
2016-09-05 13:18:22 +00:00
|
|
|
random = "manage-test-#{rand(999_999)}"
|
2020-09-30 09:07:01 +00:00
|
|
|
user_email = "#{random}@example.com"
|
2013-03-22 08:29:44 +00:00
|
|
|
|
2015-02-23 13:02:46 +00:00
|
|
|
# user management
|
|
|
|
@browser = browser_instance
|
|
|
|
login(
|
2015-04-27 13:42:53 +00:00
|
|
|
username: 'master@example.com',
|
|
|
|
password: 'test',
|
2018-12-19 17:31:51 +00:00
|
|
|
url: browser_url,
|
2015-02-23 13:02:46 +00:00
|
|
|
)
|
|
|
|
|
2016-09-05 13:18:22 +00:00
|
|
|
click(css: 'a[href="#manage"]')
|
|
|
|
click(css: 'a[href="#manage/users"]')
|
2015-02-23 13:02:46 +00:00
|
|
|
|
|
|
|
user_create(
|
2015-04-27 13:42:53 +00:00
|
|
|
data: {
|
2018-12-19 17:31:51 +00:00
|
|
|
login: "some login#{random}",
|
2016-09-05 13:18:22 +00:00
|
|
|
firstname: "Manage Firstname#{random}",
|
2018-12-19 17:31:51 +00:00
|
|
|
lastname: "Manage Lastname#{random}",
|
|
|
|
email: user_email,
|
|
|
|
password: 'some-pass',
|
2015-02-23 13:02:46 +00:00
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2016-09-05 13:18:22 +00:00
|
|
|
click(css: '.table-overview tr:last-child td')
|
2015-02-23 13:02:46 +00:00
|
|
|
|
2018-07-25 07:27:36 +00:00
|
|
|
modal_ready()
|
2015-02-23 13:02:46 +00:00
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.modal input[name="lastname"]',
|
2016-09-05 13:18:22 +00:00
|
|
|
value: "2Manage Lastname#{random}",
|
2015-02-23 13:02:46 +00:00
|
|
|
)
|
2016-09-05 13:18:22 +00:00
|
|
|
click(css: '.modal button.js-submit')
|
2018-07-25 07:27:36 +00:00
|
|
|
modal_disappear()
|
2015-02-23 13:02:46 +00:00
|
|
|
|
|
|
|
watch_for(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: 'body',
|
2016-09-05 13:18:22 +00:00
|
|
|
value: "2Manage Lastname#{random}",
|
2015-02-23 13:02:46 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# sla
|
|
|
|
sla_create(
|
2015-04-27 13:42:53 +00:00
|
|
|
data: {
|
2018-12-19 17:31:51 +00:00
|
|
|
name: "some sla#{random}",
|
2015-09-15 13:11:00 +00:00
|
|
|
first_response_time_in_text: '1:01'
|
2015-02-23 13:02:46 +00:00
|
|
|
}
|
|
|
|
)
|
|
|
|
watch_for(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: 'body',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: random,
|
2015-02-23 13:02:46 +00:00
|
|
|
)
|
|
|
|
sleep 1
|
|
|
|
|
2016-09-05 13:18:22 +00:00
|
|
|
click(css: '.content:not(.hide) .action:last-child .js-edit')
|
2015-02-23 13:02:46 +00:00
|
|
|
|
2018-07-25 07:27:36 +00:00
|
|
|
modal_ready()
|
2015-02-23 13:02:46 +00:00
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.modal input[name=name]',
|
2016-09-05 13:18:22 +00:00
|
|
|
value: "some sla update #{random}",
|
2015-02-23 13:02:46 +00:00
|
|
|
)
|
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.modal input[name="first_response_time_in_text"]',
|
2015-09-15 13:11:00 +00:00
|
|
|
value: '2:01',
|
2015-02-23 13:02:46 +00:00
|
|
|
)
|
2016-09-05 13:18:22 +00:00
|
|
|
click(css: '.modal button.js-submit')
|
2018-07-25 07:27:36 +00:00
|
|
|
modal_disappear()
|
2015-02-23 13:02:46 +00:00
|
|
|
|
|
|
|
watch_for(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: 'body',
|
2016-09-05 13:18:22 +00:00
|
|
|
value: "some sla update #{random}",
|
2015-02-23 13:02:46 +00:00
|
|
|
)
|
|
|
|
sleep 4
|
|
|
|
|
2016-09-05 13:18:22 +00:00
|
|
|
click(css: '.content:not(.hide) .action:last-child .js-delete')
|
2015-02-23 13:02:46 +00:00
|
|
|
sleep 2
|
|
|
|
|
2016-09-05 13:18:22 +00:00
|
|
|
click(css: '.modal button.js-submit')
|
2015-02-23 13:02:46 +00:00
|
|
|
sleep 4
|
|
|
|
match_not(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: 'body',
|
2016-09-05 13:18:22 +00:00
|
|
|
value: "some sla update #{random}",
|
2015-02-23 13:02:46 +00:00
|
|
|
)
|
|
|
|
|
2016-09-05 13:18:22 +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(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: 'body',
|
2016-09-05 13:18:22 +00:00
|
|
|
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
|
|
|
|
|
2016-09-05 13:18:22 +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(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: 'body',
|
2016-09-05 13:18:22 +00:00
|
|
|
value: "some sla update #{random}",
|
2015-02-23 13:02:46 +00:00
|
|
|
)
|
2013-03-06 22:15:01 +00:00
|
|
|
end
|
|
|
|
end
|