From 54a72907a72ca6fe82a14b8de56667ecf0136a49 Mon Sep 17 00:00:00 2001 From: Mantas Date: Wed, 9 May 2018 10:21:08 +0300 Subject: [PATCH] Follow up for #1990 improves test by using watch_for --- .../agent_ticket_create_cc_tokenizer_test.rb | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/test/browser/agent_ticket_create_cc_tokenizer_test.rb b/test/browser/agent_ticket_create_cc_tokenizer_test.rb index 9d2800c2f..6522b9e37 100644 --- a/test/browser/agent_ticket_create_cc_tokenizer_test.rb +++ b/test/browser/agent_ticket_create_cc_tokenizer_test.rb @@ -5,7 +5,7 @@ require 'browser_test_helper' # # Ensure that CC field when creating a new ticket is autocompleting user emails -class AgentTicketCreateResetCustomerSelectionTest < TestCase +class AgentTicketCreateCcTokenizerTest < TestCase def test_tokenizer @browser = browser_instance @@ -20,13 +20,24 @@ class AgentTicketCreateResetCustomerSelectionTest < TestCase css: 'a[href="#ticket/create"]' ) - @browser.find_element(:css, 'li[data-type=email-out]').click + email_out_css = '.content.active li[data-type=email-out]' + + watch_for( + css: email_out_css + ) + + click(css: email_out_css) + + watch_for( + css: '.content.active input[name=cc]', + displayed: true + ) elem = @browser.find_element(:name, 'cc') elem.send_keys 'test@example.com' elem.send_keys :enter - exists( + watch_for( css: '.token-label', value: 'test@example.com' )