2021-06-01 12:20:20 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
2013-06-08 22:35:18 +00:00
|
|
|
require 'browser_test_helper'
|
|
|
|
|
|
|
|
class TaskbarTaskTest < TestCase
|
|
|
|
def test_persistant_task_a
|
2015-02-22 22:20:05 +00:00
|
|
|
@browser = browser_instance
|
|
|
|
login(
|
2015-04-27 13:42:53 +00:00
|
|
|
username: 'agent1@example.com',
|
|
|
|
password: 'test',
|
2018-12-19 17:31:51 +00:00
|
|
|
url: browser_url,
|
2015-02-22 22:20:05 +00:00
|
|
|
)
|
|
|
|
tasks_close_all()
|
|
|
|
|
|
|
|
# persistant task
|
2018-03-06 05:30:12 +00:00
|
|
|
click(css: 'a[href="#new"]', only_if_exists: true)
|
2016-03-23 07:24:25 +00:00
|
|
|
click(css: 'a[href="#ticket/create"]', wait: 0.8)
|
2015-02-22 22:20:05 +00:00
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .newTicket input[name="title"]',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'some test AAA',
|
2015-02-22 22:20:05 +00:00
|
|
|
)
|
2016-06-03 21:42:30 +00:00
|
|
|
sleep 4
|
2013-06-08 22:35:18 +00:00
|
|
|
end
|
2015-05-07 10:27:12 +00:00
|
|
|
|
2013-06-08 22:35:18 +00:00
|
|
|
def test_persistant_task_b
|
2015-02-22 22:20:05 +00:00
|
|
|
@browser = browser_instance
|
|
|
|
login(
|
2015-04-27 13:42:53 +00:00
|
|
|
username: 'agent1@example.com',
|
|
|
|
password: 'test',
|
2018-12-19 17:31:51 +00:00
|
|
|
url: browser_url,
|
2015-02-22 22:20:05 +00:00
|
|
|
)
|
|
|
|
sleep 3
|
|
|
|
|
|
|
|
# check if task still exists
|
2016-03-23 07:24:25 +00:00
|
|
|
click(css: '.task', wait: 0.8)
|
2015-02-22 22:20:05 +00:00
|
|
|
|
|
|
|
match(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .newTicket input[name="title"]',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'some test AAA',
|
2015-02-22 22:20:05 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
tasks_close_all()
|
|
|
|
|
2016-03-23 07:24:25 +00:00
|
|
|
exists_not(css: '.active .newTicket input[name="title"]')
|
2013-06-08 22:35:18 +00:00
|
|
|
end
|
2015-05-07 10:27:12 +00:00
|
|
|
|
2013-06-25 12:46:19 +00:00
|
|
|
def test_persistant_task_with_relogin
|
2015-02-22 22:20:05 +00:00
|
|
|
@browser = browser_instance
|
|
|
|
login(
|
2015-04-27 13:42:53 +00:00
|
|
|
username: 'agent1@example.com',
|
|
|
|
password: 'test',
|
2018-12-19 17:31:51 +00:00
|
|
|
url: browser_url,
|
2015-02-22 22:20:05 +00:00
|
|
|
)
|
|
|
|
tasks_close_all()
|
|
|
|
|
2018-03-06 05:30:12 +00:00
|
|
|
click(css: 'a[href="#new"]', only_if_exists: true)
|
2016-06-08 19:18:40 +00:00
|
|
|
click(css: 'a[href="#ticket/create"]', wait: 0.8)
|
2015-02-22 22:20:05 +00:00
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .newTicket input[name="title"]',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'INBOUND TEST#1',
|
2015-02-22 22:20:05 +00:00
|
|
|
)
|
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .newTicket [data-name="body"]',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'INBOUND BODY TEST#1',
|
2015-02-22 22:20:05 +00:00
|
|
|
)
|
2016-06-08 19:18:40 +00:00
|
|
|
sleep 2
|
2015-02-22 22:20:05 +00:00
|
|
|
|
2018-03-06 05:30:12 +00:00
|
|
|
click(css: 'a[href="#new"]', only_if_exists: true)
|
2016-06-08 19:18:40 +00:00
|
|
|
click(css: 'a[href="#ticket/create"]', wait: 0.8)
|
2015-02-22 22:20:05 +00:00
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .newTicket input[name="title"]',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'OUTBOUND TEST#1',
|
2015-02-22 22:20:05 +00:00
|
|
|
)
|
|
|
|
set(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: '.active .newTicket [data-name="body"]',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'OUTBOUND BODY TEST#1',
|
2015-02-22 22:20:05 +00:00
|
|
|
)
|
2016-10-15 01:30:14 +00:00
|
|
|
sleep 3
|
2015-02-22 22:20:05 +00:00
|
|
|
|
|
|
|
logout()
|
|
|
|
sleep 4
|
|
|
|
|
|
|
|
# relogin with master - task are not viewable
|
|
|
|
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-22 22:20:05 +00:00
|
|
|
)
|
|
|
|
sleep 3
|
|
|
|
|
|
|
|
match_not(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: 'body',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'INBOUND TEST#1',
|
2015-02-22 22:20:05 +00:00
|
|
|
)
|
|
|
|
match_not(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: 'body',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'OUTBOUND TEST#1',
|
2015-02-22 22:20:05 +00:00
|
|
|
)
|
|
|
|
logout()
|
|
|
|
sleep 2
|
|
|
|
|
|
|
|
match_not(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: 'body',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'INBOUND TEST#1',
|
2015-02-22 22:20:05 +00:00
|
|
|
)
|
|
|
|
match_not(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: 'body',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'OUTBOUND TEST#1',
|
2015-02-22 22:20:05 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# relogin with agent - task are viewable
|
|
|
|
login(
|
2015-04-27 13:42:53 +00:00
|
|
|
username: 'agent1@example.com',
|
|
|
|
password: 'test',
|
2018-12-19 17:31:51 +00:00
|
|
|
url: browser_url,
|
2015-02-22 22:20:05 +00:00
|
|
|
)
|
|
|
|
sleep 3
|
|
|
|
|
|
|
|
match(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: 'body',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'INBOUND TEST#1',
|
2015-02-22 22:20:05 +00:00
|
|
|
)
|
|
|
|
match(
|
2018-12-19 17:31:51 +00:00
|
|
|
css: 'body',
|
2015-04-27 13:42:53 +00:00
|
|
|
value: 'OUTBOUND TEST#1',
|
2015-02-22 22:20:05 +00:00
|
|
|
)
|
2013-06-25 12:46:19 +00:00
|
|
|
end
|
2015-04-27 14:15:29 +00:00
|
|
|
end
|