Follow up for #1990 improves test by using watch_for

This commit is contained in:
Mantas 2018-05-09 10:21:08 +03:00
parent 2662c17bad
commit 54a72907a7

View file

@ -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'
)