123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403 |
- # encoding: utf-8
- require 'browser_test_helper'
- class AgentTicketUpdate2Test < TestCase
- def test_work_with_two_browser_on_same_ticket_edit
- 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 3 <b>subject</b> 123äöü',
- body: 'some level 3 <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 3 <b>body</b> 123äöü',
- )
- watch_for(
- browser: browser1,
- css: '.content.active .js-attributeBar .js-avatar .avatar--not-changed',
- value: 'AT', # agent1
- )
- watch_for(
- browser: browser2,
- css: '.content.active .js-attributeBar .js-avatar .avatar--not-changed',
- value: 'TA', # master
- )
- # change edit screen in instance 1
- ticket_update(
- browser: browser1,
- data: {
- body: 'some level 3 <b>body</b> in instance 1',
- },
- do_not_submit: true,
- )
- watch_for(
- browser: browser1,
- css: '.content.active .js-reset',
- value: '(Discard your unsaved changes.|Verwerfen der)',
- no_quote: true,
- )
- watch_for(
- browser: browser1,
- css: '.content.active .js-attributeBar .js-avatar .avatar--not-changed',
- value: 'AT', # agent1
- )
- watch_for(
- browser: browser2,
- css: '.content.active .js-attributeBar .js-avatar .avatar--changed',
- value: 'TA', # master
- )
- # update ticket in instance 2
- ticket_update(
- browser: browser2,
- data: {
- body: 'some level 3 <b>body</b> in instance 2',
- },
- do_not_submit: true,
- )
- watch_for(
- browser: browser2,
- css: '.content.active .js-reset',
- value: '(Discard your unsaved changes.|Verwerfen der)',
- no_quote: true,
- )
- watch_for(
- browser: browser1,
- css: '.content.active .js-attributeBar .js-avatar .avatar--changed',
- value: 'AT', # agent1
- )
- watch_for(
- browser: browser2,
- css: '.content.active .js-attributeBar .js-avatar .avatar--changed',
- value: 'TA', # master
- )
- click(
- browser: browser2,
- css: '.active .js-submit',
- )
- # discard changes should gone away
- watch_for_disappear(
- browser: browser2,
- css: '.content.active .js-reset',
- value: '(Discard your unsaved changes.|Verwerfen der)',
- no_quote: true,
- )
- ticket_verify(
- browser: browser2,
- data: {
- body: '',
- },
- )
- watch_for(
- browser: browser1,
- css: '.content.active .js-attributeBar .js-avatar .avatar--not-changed',
- value: 'AT', # agent1
- )
- watch_for(
- browser: browser2,
- css: '.content.active .js-attributeBar .js-avatar .avatar--changed',
- value: 'TA', # master
- )
- # check content and edit screen in instance 1
- watch_for(
- browser: browser2,
- css: '.active div.ticket-article',
- value: 'some level 3 <b>body</b> in instance 2',
- timeout: 1,
- )
- ticket_verify(
- browser: browser1,
- data: {
- body: 'some level 3 <b>body</b> in instance 1',
- },
- )
- # update ticket in instance 1
- click(
- browser: browser1,
- css: '.active .js-submit',
- )
- watch_for(
- browser: browser1,
- css: '.active div.ticket-article',
- value: 'some level 3 <b>body</b> in instance 2',
- )
- sleep 1
- match_not(
- browser: browser1,
- css: '.content.active .js-reset',
- value: '(Discard your unsaved changes.|Verwerfen der)',
- no_quote: true,
- )
- watch_for(
- browser: browser1,
- css: '.content.active .js-attributeBar .js-avatar .avatar--not-changed',
- value: 'AT', # agent1
- )
- watch_for(
- browser: browser2,
- css: '.content.active .js-attributeBar .js-avatar .avatar--not-changed',
- value: 'TA', # master
- )
- # check content in instance 2
- watch_for(
- browser: browser2,
- css: '.active div.ticket-article',
- value: 'some level 3 <b>body</b> in instance 1',
- )
- # check content and edit screen in instance 1+2
- ticket_verify(
- browser: browser1,
- data: {
- body: '',
- },
- )
- match_not(
- browser: browser1,
- css: '.content.active .js-reset',
- value: '(Discard your unsaved changes.|Verwerfen der)',
- no_quote: true,
- )
- ticket_verify(
- browser: browser2,
- data: {
- body: '',
- },
- )
- match_not(
- browser: browser2,
- css: '.content.active .js-reset',
- value: '(Discard your unsaved changes.|Verwerfen der)',
- no_quote: true,
- )
- watch_for(
- browser: browser1,
- css: '.content.active .js-attributeBar .js-avatar .avatar--not-changed',
- value: 'AT', # agent1
- )
- watch_for(
- browser: browser2,
- css: '.content.active .js-attributeBar .js-avatar .avatar--not-changed',
- value: 'TA', # master
- )
- # reload instances, verify again
- reload(
- browser: browser1,
- )
- reload(
- browser: browser2,
- )
- # check content and edit screen in instance 1+2
- ticket_verify(
- browser: browser1,
- data: {
- body: '',
- },
- )
- match_not(
- browser: browser1,
- css: '.content.active .js-reset',
- value: '(Discard your unsaved changes.|Verwerfen der)',
- no_quote: true,
- )
- ticket_verify(
- browser: browser2,
- data: {
- body: '',
- },
- )
- match_not(
- browser: browser2,
- css: '.content.active .js-reset',
- value: '(Discard your unsaved changes.|Verwerfen der)',
- no_quote: true,
- )
- watch_for(
- browser: browser1,
- css: '.content.active .js-attributeBar .js-avatar .avatar--not-changed',
- value: 'AT', # agent1
- )
- watch_for(
- browser: browser2,
- css: '.content.active .js-attributeBar .js-avatar .avatar--not-changed',
- value: 'TA', # master
- )
- # change form of ticket, reset, reload and verify in instance 2
- ticket_update(
- browser: browser2,
- data: {
- body: '22 some level 3 <b>body</b> in instance 2',
- },
- do_not_submit: true,
- )
- watch_for(
- browser: browser2,
- css: '.content.active .js-reset',
- value: '(Discard your unsaved changes.|Verwerfen der)',
- no_quote: true,
- )
- sleep 3
- reload(
- browser: browser2,
- )
- sleep 3
- click(
- css: '.content.active .js-reset',
- browser: browser2,
- )
- sleep 4
- ticket_verify(
- browser: browser2,
- data: {
- body: '',
- },
- )
- # change form of ticket in instance 2
- ticket_update(
- browser: browser2,
- data: {
- body: '22 some level 3 <b>body</b> in instance 2',
- },
- do_not_submit: true,
- )
- watch_for(
- browser: browser2,
- css: '.content.active .js-reset',
- value: '(Discard your unsaved changes.|Verwerfen der)',
- no_quote: true,
- )
- sleep 2
- watch_for(
- browser: browser1,
- css: '.content.active .js-attributeBar .js-avatar .avatar--changed',
- value: 'AT', # agent1
- )
- watch_for(
- browser: browser2,
- css: '.content.active .js-attributeBar .js-avatar .avatar--not-changed',
- value: 'TA', # master
- )
- reload(
- browser: browser2,
- )
- ticket_verify(
- browser: browser2,
- data: {
- body: '22 some level 3 <b>body</b> in instance 2',
- },
- )
- watch_for(
- browser: browser2,
- css: '.content.active .js-reset',
- value: '(Discard your unsaved changes.|Verwerfen der)',
- no_quote: true,
- )
- watch_for(
- browser: browser1,
- css: '.content.active .js-attributeBar .js-avatar .avatar--changed',
- value: 'AT', # agent1
- )
- watch_for(
- browser: browser2,
- css: '.content.active .js-attributeBar .js-avatar .avatar--not-changed',
- value: 'TA', # master
- )
- task_type(
- browser: browser2,
- type: 'stayOnTab',
- )
- click(
- browser: browser2,
- css: '.active .js-submit',
- )
- # discard changes should gone away
- watch_for_disappear(
- browser: browser2,
- css: '.content.active .js-reset',
- value: '(Discard your unsaved changes.|Verwerfen der)',
- no_quote: true,
- )
- watch_for(
- browser: browser1,
- css: '.content.active .js-attributeBar .js-avatar .avatar--not-changed',
- value: 'AT', # agent1
- )
- watch_for(
- browser: browser2,
- css: '.content.active .js-attributeBar .js-avatar .avatar--not-changed',
- value: 'TA', # master
- )
- # check if new article is empty
- ticket_verify(
- browser: browser2,
- data: {
- body: '',
- },
- )
- watch_for(
- browser: browser2,
- css: '.active div.ticket-article',
- value: '22 some level 3 <b>body</b> in instance 2',
- )
- end
- end
|