From 2d6bd8abcf54ec098360a014d7ab7143b55bcbef Mon Sep 17 00:00:00 2001
From: Thomas Steur <thomas.steur@gmail.com>
Date: Wed, 7 Oct 2015 07:23:22 +0000
Subject: [PATCH] fix test, we need to make sure to wait between clicks

---
 tests/UI/specs/UIIntegration_spec.js | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tests/UI/specs/UIIntegration_spec.js b/tests/UI/specs/UIIntegration_spec.js
index 7cb5f456b5..76b521567f 100644
--- a/tests/UI/specs/UIIntegration_spec.js
+++ b/tests/UI/specs/UIIntegration_spec.js
@@ -580,7 +580,12 @@ describe("UIIntegrationTest", function () { // TODO: Rename to Piwik?
             page.evaluate(function () {
                 $(document).ready(function () {
                     $('#date').click();
-                    $('#period_id_range').click();
+                });
+            });
+            // we need to make sure there to wait for a bit till date is opened and period selected
+            page.click('#period_id_range');
+            page.evaluate(function () {
+                $(document).ready(function () {
                     $('#inputCalendarFrom').val('2012-08-02');
                     $('#inputCalendarTo').val('2012-08-12');
                     setTimeout(function () {$('#calendarApply').click();}, 500);
-- 
GitLab