From 8f7452e34ba2eaac04f39929037b1ad18cc35453 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 7 Jun 2016 23:38:29 +0200 Subject: [PATCH] Added browser tests to verify tag and link changes on second browser. --- .../agent_ticket_actions_level8_test.rb | 97 ++++++++++++++++++- 1 file changed, 96 insertions(+), 1 deletion(-) diff --git a/test/browser/agent_ticket_actions_level8_test.rb b/test/browser/agent_ticket_actions_level8_test.rb index c185abde0..4f850c09b 100644 --- a/test/browser/agent_ticket_actions_level8_test.rb +++ b/test/browser/agent_ticket_actions_level8_test.rb @@ -93,6 +93,19 @@ class AgentTicketActionLevel8Test < TestCase }, ) + # verify changes in second browser + browser2 = browser_instance + login( + browser: browser2, + username: 'master@example.com', + password: 'test', + url: browser_url, + ) + ticket_open_by_search( + browser: browser2, + number: ticket3[:number], + ) + # set tag #1 click( css: '.content.active .js-newTagLabel', @@ -157,6 +170,19 @@ class AgentTicketActionLevel8Test < TestCase } ) + sleep 4 + tags_verify( + browser: browser2, + tags: { + 'tag1' => true, + 'tag 2' => true, + 'tag2' => false, + 'tag3' => true, + 'tag4' => true, + 'tag5' => true, + } + ) + # reload browser reload() sleep 2 @@ -172,6 +198,47 @@ class AgentTicketActionLevel8Test < TestCase 'tag5' => true, } ) + + tags_verify( + browser: browser2, + tags: { + 'tag1' => true, + 'tag 2' => true, + 'tag2' => false, + 'tag3' => true, + 'tag4' => true, + 'tag5' => true, + } + ) + + # remove tag1 + click( + css: '.content.active .tags .js-delete', + ) + sleep 4 + + # verify tags + tags_verify( + tags: { + 'tag1' => false, + 'tag 2' => true, + 'tag2' => false, + 'tag3' => true, + 'tag4' => true, + 'tag5' => true, + } + ) + tags_verify( + browser: browser2, + tags: { + 'tag1' => false, + 'tag 2' => true, + 'tag2' => false, + 'tag3' => true, + 'tag4' => true, + 'tag5' => true, + } + ) end def test_b_tags @@ -369,6 +436,19 @@ class AgentTicketActionLevel8Test < TestCase }, ) + # verify changes in second browser + browser2 = browser_instance + login( + browser: browser2, + username: 'master@example.com', + password: 'test', + url: browser_url, + ) + ticket_open_by_search( + browser: browser2, + number: ticket1[:number], + ) + click( css: '.content.active .links .js-add', ) @@ -391,6 +471,12 @@ class AgentTicketActionLevel8Test < TestCase value: ticket1[:title], ) + watch_for( + browser: browser2, + css: '.content.active .ticketLinks', + value: ticket2[:title], + ) + reload() watch_for( @@ -404,6 +490,11 @@ class AgentTicketActionLevel8Test < TestCase css: '.content.active .ticketLinks', value: ticket1[:title], ) + watch_for_disappear( + browser: browser2, + css: '.content.active .ticketLinks', + value: ticket2[:title], + ) reload() @@ -411,7 +502,11 @@ class AgentTicketActionLevel8Test < TestCase css: '.content.active .ticketLinks', value: ticket1[:title], ) - + watch_for_disappear( + browser: browser2, + css: '.content.active .ticketLinks', + value: ticket2[:title], + ) end end