2021-06-01 12:20:20 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
2017-02-05 18:24:48 +00:00
|
|
|
require 'browser_test_helper'
|
|
|
|
|
|
|
|
class AgentTicketOverviewTabTest < TestCase
|
2021-06-15 06:26:52 +00:00
|
|
|
def task_count_equals(count)
|
|
|
|
|
|
|
|
retries ||= 0
|
|
|
|
assert_equal(count, @browser.find_elements(css: '.tasks .task').count)
|
|
|
|
rescue
|
|
|
|
retries += 1
|
|
|
|
if retries < 5
|
|
|
|
sleep 1
|
|
|
|
retry
|
|
|
|
end
|
|
|
|
raise e
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2017-02-05 18:24:48 +00:00
|
|
|
def test_i
|
|
|
|
@browser = browser_instance
|
|
|
|
login(
|
2021-08-17 12:10:02 +00:00
|
|
|
username: 'admin@example.com',
|
2017-02-05 18:24:48 +00:00
|
|
|
password: 'test',
|
2018-12-19 17:31:51 +00:00
|
|
|
url: browser_url,
|
2017-02-05 18:24:48 +00:00
|
|
|
)
|
2021-07-16 13:29:38 +00:00
|
|
|
tasks_close_all
|
2017-02-05 18:24:48 +00:00
|
|
|
|
2021-09-20 10:47:05 +00:00
|
|
|
title = "test #{SecureRandom.uuid}"
|
2017-02-05 18:24:48 +00:00
|
|
|
|
|
|
|
# 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
|
|
|
}
|
|
|
|
)
|
2019-06-28 11:38:49 +00:00
|
|
|
ticket_create(
|
2017-02-05 18:24:48 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
)
|
2019-06-28 11:38:49 +00:00
|
|
|
ticket_create(
|
2017-02-05 18:24:48 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
)
|
2021-07-16 13:29:38 +00:00
|
|
|
tasks_close_all
|
2017-02-05 18:24:48 +00:00
|
|
|
|
2021-07-16 13:44:10 +00:00
|
|
|
# click(text: 'Overviews')
|
2017-02-05 18:24:48 +00:00
|
|
|
# enable full overviews
|
2021-07-16 13:44:10 +00:00
|
|
|
# execute(
|
2017-02-05 18:24:48 +00:00
|
|
|
# js: '$(".content.active .sidebar").css("display", "block")',
|
2021-07-16 13:44:10 +00:00
|
|
|
# )
|
|
|
|
# click(text: 'Unassigned & Open')
|
2017-02-05 18:24:48 +00:00
|
|
|
|
|
|
|
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
|
|
|
)
|
|
|
|
|
2021-06-15 06:26:52 +00:00
|
|
|
task_count_equals(1)
|
2017-02-05 18:24:48 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
)
|
|
|
|
|
2019-11-28 06:59:22 +00:00
|
|
|
watch_for(
|
|
|
|
css: '.tasks .task.is-active',
|
|
|
|
value: "overview tab test #2 - #{title}",
|
|
|
|
timeout: 8,
|
2017-02-05 18:24:48 +00:00
|
|
|
)
|
|
|
|
|
2021-06-15 06:26:52 +00:00
|
|
|
task_count_equals(1)
|
2017-02-05 18:24:48 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
)
|
|
|
|
|
2021-06-15 06:26:52 +00:00
|
|
|
task_count_equals(0)
|
2017-02-05 18:24:48 +00:00
|
|
|
|
|
|
|
# cleanup
|
2021-07-16 13:29:38 +00:00
|
|
|
tasks_close_all
|
2017-02-05 18:24:48 +00:00
|
|
|
end
|
|
|
|
end
|