2017-02-05 18:24:48 +00:00
|
|
|
require 'browser_test_helper'
|
|
|
|
|
|
|
|
class AgentTicketOverviewTabTest < TestCase
|
|
|
|
def test_i
|
|
|
|
@browser = browser_instance
|
|
|
|
login(
|
|
|
|
username: 'master@example.com',
|
|
|
|
password: 'test',
|
2018-12-19 17:31:51 +00:00
|
|
|
url: browser_url,
|
2017-02-05 18:24:48 +00:00
|
|
|
)
|
|
|
|
tasks_close_all()
|
|
|
|
|
|
|
|
title = "test #{rand(9_999_999)}"
|
|
|
|
|
|
|
|
# create new ticket
|
|
|
|
ticket1 = ticket_create(
|
|
|
|
data: {
|
|
|
|
customer: 'nico',
|
2018-12-19 17:31:51 +00:00
|
|
|
group: 'Users',
|
|
|
|
title: "overview tab test #1 - #{title}",
|
|
|
|
body: "overview tab test #1 - #{title}",
|
2017-02-05 18:24:48 +00:00
|
|
|
}
|
|
|
|
)
|
|
|
|
ticket2 = ticket_create(
|
|
|
|
data: {
|
|
|
|
customer: 'nico',
|
2018-12-19 17:31:51 +00:00
|
|
|
group: 'Users',
|
|
|
|
title: "overview tab test #2 - #{title}",
|
|
|
|
body: "overview tab test #2 - #{title}",
|
2017-02-05 18:24:48 +00:00
|
|
|
}
|
|
|
|
)
|
|
|
|
ticket3 = ticket_create(
|
|
|
|
data: {
|
|
|
|
customer: 'nico',
|
2018-12-19 17:31:51 +00:00
|
|
|
group: 'Users',
|
|
|
|
title: "overview tab test #3 - #{title}",
|
|
|
|
body: "overview tab test #3 - #{title}",
|
2017-02-05 18:24:48 +00:00
|
|
|
}
|
|
|
|
)
|
|
|
|
tasks_close_all()
|
|
|
|
|
|
|
|
#click(text: 'Overviews')
|
|
|
|
# enable full overviews
|
|
|
|
#execute(
|
|
|
|
# js: '$(".content.active .sidebar").css("display", "block")',
|
|
|
|
#)
|
|
|
|
#click(text: 'Unassigned & Open')
|
|
|
|
sleep 8 # till overview is rendered
|
|
|
|
|
|
|
|
ticket_open_by_overview(
|
2018-12-19 17:31:51 +00:00
|
|
|
number: ticket1[:number],
|
|
|
|
title: "overview tab test #1 - #{title}",
|
|
|
|
link: '#ticket/view/all_unassigned',
|
2017-02-05 18:24:48 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
assert_equal(1, @browser.find_elements(css: '.tasks .task').count)
|
|
|
|
|
|
|
|
ticket_update(
|
2018-12-19 17:31:51 +00:00
|
|
|
data: {
|
2017-02-05 18:24:48 +00:00
|
|
|
body: 'some body',
|
|
|
|
state: 'closed',
|
|
|
|
},
|
|
|
|
task_type: 'closeNextInOverview', # default: stayOnTab / possible: closeTab, closeNextInOverview, stayOnTab
|
|
|
|
)
|
|
|
|
|
|
|
|
match(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.tasks .task.is-active',
|
2017-02-05 18:24:48 +00:00
|
|
|
value: "overview tab test #2 - #{title}",
|
|
|
|
)
|
|
|
|
|
|
|
|
assert_equal(1, @browser.find_elements(css: '.tasks .task').count)
|
|
|
|
|
|
|
|
ticket_update(
|
2018-12-19 17:31:51 +00:00
|
|
|
data: {
|
2017-02-05 18:24:48 +00:00
|
|
|
body: 'some body',
|
|
|
|
state: 'closed',
|
|
|
|
},
|
|
|
|
task_type: 'closeTab', # default: stayOnTab / possible: closeTab, closeNextInOverview, stayOnTab
|
|
|
|
)
|
|
|
|
|
|
|
|
assert_equal(0, @browser.find_elements(css: '.tasks .task').count)
|
|
|
|
|
|
|
|
# cleanup
|
|
|
|
tasks_close_all()
|
|
|
|
end
|
|
|
|
end
|