From 8172b177337d983080fca25b6280127ffcae3457 Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Fri, 6 Jul 2018 09:14:53 +0200 Subject: [PATCH] Test stabilization: Once in a while uploads take longer than expected. --- test/browser/agent_ticket_attachment_test.rb | 29 ++++++++++++++++++-- 1 file changed, 26 insertions(+), 3 deletions(-) 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