From e245ed8f27d85ffbb65d75987d795a9a2b20530e Mon Sep 17 00:00:00 2001
From: Varac <varac@varac.net>
Date: Fri, 20 Dec 2019 22:11:31 +0100
Subject: [PATCH] Make behave grafana test more resilient

Apparently firefox geckodriver renders the grafana home page in a different
order than chromedriver. So we wait for an element which gets rendered at the
very end.

Closes: #463
---
 test/behave/features/grafana.feature | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/test/behave/features/grafana.feature b/test/behave/features/grafana.feature
index e37fdfecc..c64b1d506 100644
--- a/test/behave/features/grafana.feature
+++ b/test/behave/features/grafana.feature
@@ -6,12 +6,15 @@ Feature: Test grafana admin login
 Scenario: Open grafana
   When I open the grafana URL
   Then I wait on element "//input[@name='user']" for 25000ms to be visible
+  And I expect that the title is "Grafana"
   And I expect that element "#inputPassword" is visible
+  And I expect that the path is "/login"
 
 Scenario: Login to grafana
   Given the element "//input[@name='user']" is visible
   When I enter the "grafana" "username" in the inputfield "//input[@name='user']"
   And I enter the "grafana" "password" in the inputfield "#inputPassword"
   And I click on the button "//div[@id='login-view']//button[@type='submit']"
-  Then I wait on element "/html/body/grafana-app/sidemenu/a" for 25000ms to be visible
+  Then I wait on element "/html/body/grafana-app/div/div/div/react-container/div/div[2]/div/div[1]/div/div/div[2]/div/div/div[1]/div/div[2]/div" for 25000ms to be visible
+  And I expect that the path is "/"
   And I expect that the title is "Home - Grafana"
-- 
GitLab