diff --git a/test/browser/agent_ticket_attachment_test.rb b/test/browser/agent_ticket_attachment_test.rb index 20318e49d..d199c0d64 100644 --- a/test/browser/agent_ticket_attachment_test.rb +++ b/test/browser/agent_ticket_attachment_test.rb @@ -49,13 +49,20 @@ class AgentTicketAttachmentTest < TestCase Rails.root.join('test', 'data', 'upload', 'upload2.jpg')], ) + # upload might take a while + watch_for( + css: '.content.active .newTicket .attachments', + value: 'upload1.txt', + ) + watch_for( + css: '.content.active .newTicket .attachments', + value: 'upload2.jpg', + ) + # submit form click(css: '.content.active .js-submit') sleep 5 - # no warning - #alert = @browser.switch_to.alert - # check if ticket is shown and attachment exists location_check(url: '#ticket/zoom/') sleep 2 @@ -95,6 +102,12 @@ class AgentTicketAttachmentTest < TestCase files: [Rails.root.join('test', 'data', 'upload', 'upload1.txt')], ) + # upload might take a while + watch_for( + css: '.content.active .article-add .attachments', + value: 'upload1.txt', + ) + # submit form click(css: '.content.active .js-submit') sleep 2 @@ -137,6 +150,16 @@ class AgentTicketAttachmentTest < TestCase Rails.root.join('test', 'data', 'upload', 'upload2.jpg')], ) + # upload might take a while + watch_for( + css: '.content.active .article-add .attachments', + value: 'upload1.txt', + ) + watch_for( + css: '.content.active .article-add .attachments', + value: 'upload2.jpg', + ) + # submit form click(css: '.content.active .js-submit') sleep 2