From 4768a4e0eb400160ff53b7cb91568abfed1aa91b Mon Sep 17 00:00:00 2001
From: Arie Peterson <arie@greenhost.nl>
Date: Fri, 14 Jun 2019 12:09:59 +0200
Subject: [PATCH] Make xpath selectors in Grafana behave test more specific

---
 test/behave/features/grafana.feature | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/test/behave/features/grafana.feature b/test/behave/features/grafana.feature
index 2e66f2c14..adc2282d1 100644
--- a/test/behave/features/grafana.feature
+++ b/test/behave/features/grafana.feature
@@ -5,13 +5,13 @@ Feature: Test grafana admin login
 
 Scenario: Open grafana
   When I open the grafana URL
-  Then I wait on element "//form/div[1]/input" for 25000ms to be visible
+  Then I wait on element "//input[@name='username']" for 25000ms to be visible
   And I expect that element "#inputPassword" is visible
 
 Scenario: Login to grafana
-  Given the element "//form/div[1]/input" is visible
-  When I enter the "grafana" "username" in the inputfield "//form/div[1]/input"
+  Given the element "//input[@name='username']" is visible
+  When I enter the "grafana" "username" in the inputfield "//input[@name='username']"
   And I enter the "grafana" "password" in the inputfield "#inputPassword"
-  And I click on the button "//form/div[3]/button"
+  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
   And I expect that the title is "Home - Grafana"
-- 
GitLab