trabajo-afectivo/test/browser/taskbar_task_test.rb

128 lines
2.5 KiB
Ruby
Raw Normal View History

# encoding: utf-8
require 'browser_test_helper'
class TaskbarTaskTest < TestCase
def test_persistant_task_a
2015-02-22 22:20:05 +00:00
@browser = browser_instance
login(
username: 'agent1@example.com',
password: 'test',
url: browser_url,
2015-02-22 22:20:05 +00:00
)
tasks_close_all()
# persistant task
2016-03-23 07:24:25 +00:00
click(css: 'a[href="#new"]')
click(css: 'a[href="#ticket/create"]', wait: 0.8)
2015-02-22 22:20:05 +00:00
set(
css: '.active .newTicket input[name="title"]',
value: 'some test AAA',
2015-02-22 22:20:05 +00:00
)
sleep 4
end
def test_persistant_task_b
2015-02-22 22:20:05 +00:00
@browser = browser_instance
login(
username: 'agent1@example.com',
password: 'test',
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(
css: '.active .newTicket input[name="title"]',
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"]')
end
def test_persistant_task_with_relogin
2015-02-22 22:20:05 +00:00
@browser = browser_instance
login(
username: 'agent1@example.com',
password: 'test',
url: browser_url,
2015-02-22 22:20:05 +00:00
)
tasks_close_all()
2016-03-23 07:24:25 +00:00
click(css: 'a[href="#new"]')
click(css: 'a[href="#ticket/create"]', wait: 0.8)
2015-02-22 22:20:05 +00:00
set(
css: '.active .newTicket input[name="title"]',
value: 'INBOUND TEST#1',
2015-02-22 22:20:05 +00:00
)
set(
css: '.active .newTicket [data-name="body"]',
value: 'INBOUND BODY TEST#1',
2015-02-22 22:20:05 +00:00
)
sleep 2
2015-02-22 22:20:05 +00:00
2016-03-23 07:24:25 +00:00
click(css: 'a[href="#new"]')
click(css: 'a[href="#ticket/create"]', wait: 0.8)
2015-02-22 22:20:05 +00:00
set(
css: '.active .newTicket input[name="title"]',
value: 'OUTBOUND TEST#1',
2015-02-22 22:20:05 +00:00
)
set(
css: '.active .newTicket [data-name="body"]',
value: 'OUTBOUND BODY TEST#1',
2015-02-22 22:20:05 +00:00
)
sleep 2
2015-02-22 22:20:05 +00:00
logout()
sleep 4
# relogin with master - task are not viewable
login(
username: 'master@example.com',
password: 'test',
url: browser_url,
2015-02-22 22:20:05 +00:00
)
sleep 3
match_not(
css: 'body',
value: 'INBOUND TEST#1',
2015-02-22 22:20:05 +00:00
)
match_not(
css: 'body',
value: 'OUTBOUND TEST#1',
2015-02-22 22:20:05 +00:00
)
logout()
sleep 2
match_not(
css: 'body',
value: 'INBOUND TEST#1',
2015-02-22 22:20:05 +00:00
)
match_not(
css: 'body',
value: 'OUTBOUND TEST#1',
2015-02-22 22:20:05 +00:00
)
# relogin with agent - task are viewable
login(
username: 'agent1@example.com',
password: 'test',
url: browser_url,
2015-02-22 22:20:05 +00:00
)
sleep 3
match(
css: 'body',
value: 'INBOUND TEST#1',
2015-02-22 22:20:05 +00:00
)
match(
css: 'body',
value: 'OUTBOUND TEST#1',
2015-02-22 22:20:05 +00:00
)
end
end