123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274 |
- require 'browser_test_helper'
- class AgentTicketUpdate3Test < TestCase
- def test_work_with_two_browser_on_same_ticket
- # work on one ticket with two browsers
- browser1 = browser_instance
- login(
- browser: browser1,
- username: 'master@example.com',
- password: 'test',
- url: browser_url,
- )
- tasks_close_all(browser: browser1)
- browser2 = browser_instance
- login(
- browser: browser2,
- username: 'agent1@example.com',
- password: 'test',
- url: browser_url,
- )
- tasks_close_all(browser: browser2)
- # create ticket
- ticket1 = ticket_create(
- browser: browser1,
- data: {
- group: 'Users',
- customer: 'nicole',
- title: 'some level 2 <b>subject</b> 123äöü',
- body: 'some level 2 <b>body</b> 123äöü',
- }
- )
- # open ticket in second browser
- ticket_open_by_search(
- browser: browser2,
- number: ticket1[:number],
- )
- watch_for(
- browser: browser2,
- css: '.active div.ticket-article',
- value: 'some level 2 <b>body</b> 123äöü',
- )
- # set body in edit area in second
- ticket_update(
- browser: browser2,
- data: {
- body: 'some level 2 <b>body</b> in instance 2',
- },
- do_not_submit: true,
- )
- # set body in edit area in first
- ticket_update(
- browser: browser1,
- data: {
- body: 'some level 2 <b>body</b> in instance 1',
- },
- do_not_submit: true,
- )
- # change title in second browser
- ticket_update(
- browser: browser2,
- data: {
- title: 'TTTsome level 2 <b>subject</b> 123äöü',
- },
- do_not_submit: true,
- )
- sleep 2
- # verify title in second and first browser
- verify_title(
- browser: browser2,
- value: 'TTTsome level 2 <b>subject<\/b> 123äöü',
- )
- ticket_verify(
- browser: browser2,
- data: {
- title: 'TTTsome level 2 <b>subject<\/b> 123äöü',
- },
- )
- verify_task(
- browser: browser2,
- data: {
- title: 'TTTsome level 2 <b>subject<\/b> 123äöü',
- modified: false,
- }
- )
- sleep 4
- verify_title(
- browser: browser1,
- value: 'TTTsome level 2 <b>subject<\/b> 123äöü',
- )
- ticket_verify(
- browser: browser1,
- data: {
- title: 'TTTsome level 2 <b>subject<\/b> 123äöü',
- },
- )
- verify_task(
- browser: browser1,
- data: {
- title: 'TTTsome level 2 <b>subject<\/b> 123äöü',
- modified: true,
- }
- )
- # verify text in input body, if still exists
- ticket_verify(
- browser: browser1,
- data: {
- body: 'some level 2 <b>body</b> in instance 1',
- },
- )
- ticket_verify(
- browser: browser2,
- data: {
- body: 'some level 2 <b>body</b> in instance 2',
- },
- )
- # set body in edit area in second
- ticket_update(
- browser: browser1,
- data: {
- body: 'some update 4711',
- },
- )
- watch_for(
- browser: browser1,
- css: '.active div.ticket-article',
- value: 'some update 4711',
- )
- verify_task(
- browser: browser1,
- data: {
- title: 'TTTsome level 2 <b>subject<\/b> 123äöü',
- modified: false,
- }
- )
- # verify if text in input body is now empty
- ticket_verify(
- browser: browser1,
- data: {
- body: '',
- },
- )
- # check if body is still in second browser
- ticket_verify(
- browser: browser2,
- data: {
- body: 'some level 2 <b>body</b> in instance 2',
- },
- )
- # verify task
- verify_task(
- browser: browser2,
- data: {
- title: 'TTTsome level 2 <b>subject<\/b> 123äöü',
- modified: true,
- }
- )
- # reload instances, verify again
- reload(
- browser: browser1,
- )
- reload(
- browser: browser2,
- )
- # wait till application become ready
- sleep 8
- verify_title(
- browser: browser2,
- value: 'TTTsome level 2 <b>subject<\/b> 123äöü',
- )
- ticket_verify(
- browser: browser2,
- data: {
- title: 'TTTsome level 2 <b>subject<\/b> 123äöü',
- },
- )
- verify_task(
- browser: browser2,
- data: {
- title: 'TTTsome level 2 <b>subject<\/b> 123äöü',
- modified: false, # modify was muted at reload ticket tab
- }
- )
- verify_title(
- browser: browser1,
- value: 'TTTsome level 2 <b>subject<\/b> 123äöü',
- )
- ticket_verify(
- browser: browser1,
- data: {
- title: 'TTTsome level 2 <b>subject<\/b> 123äöü',
- },
- )
- verify_task(
- browser: browser1,
- data: {
- title: 'TTTsome level 2 <b>subject<\/b> 123äöü',
- modified: false,
- }
- )
- # verify if update is on ticket in each browser
- watch_for(
- browser: browser1,
- css: '.active div.ticket-article',
- value: 'some update 4711',
- )
- watch_for(
- browser: browser2,
- css: '.active div.ticket-article',
- value: 'some update 4711',
- )
- # verify if text in input body is now empty
- ticket_verify(
- browser: browser1,
- data: {
- body: '',
- },
- )
- # check if body is still in second browser
- ticket_verify(
- browser: browser2,
- data: {
- body: 'some level 2 <b>body</b> in instance 2',
- },
- )
- # modify ticket again and erase modified via mouse click on .active.content
- ticket_update(
- browser: browser1,
- data: {
- body: 'some update 4711/2',
- },
- )
- sleep 4
- verify_task(
- browser: browser2,
- data: {
- title: 'TTTsome level 2 <b>subject<\/b> 123äöü',
- modified: true,
- }
- )
- click(
- browser: browser2,
- css: '.active.content',
- )
- sleep 4
- verify_task(
- browser: browser2,
- data: {
- title: 'TTTsome level 2 <b>subject<\/b> 123äöü',
- modified: false,
- }
- )
- end
- end
|