3131import adagios .settings
3232import adagios .utils
3333import simplejson as json
34+ import adagios .seleniumtests
3435
3536try :
3637 from selenium .webdriver .common .by import By
@@ -179,14 +180,15 @@ def test_get(self):
179180 self .assertTrue ('packetloss' in result [0 ]['metrics' ])
180181
181182
182- class SeleniumStatusTestCase (adagios .utils .SeleniumTestCase ):
183+ class SeleniumStatusTestCase (adagios .seleniumtests .SeleniumTestCase ):
183184 def test_network_parents (self ):
184185 """Status Overview, Network Parents should show an integer"""
185- self .driver .get (self .live_server_url + "/status" )
186+ for driver in self .drivers :
187+ driver .get (self .live_server_url + "/status" )
186188
187- # Second link is Network Parents in overview
188- self .assertEqual (self . driver .find_elements (By .XPATH ,
189- "//a[@href='/status/parents']" )[1 ].text .isdigit (), True )
189+ # Second link is Network Parents in overview
190+ self .assertEqual (driver .find_elements (By .XPATH ,
191+ "//a[@href='/status/parents']" )[1 ].text .isdigit (), True )
190192
191193 def test_services_select_all (self ):
192194 """Loads services list and tries to select everything
@@ -197,34 +199,35 @@ def test_services_select_all(self):
197199 Look for statustable rows
198200 Assert that all rows are checked"""
199201
200- self .driver .get (self .live_server_url + "/status/services" )
202+ for driver in self .drivers :
203+ driver .get (self .live_server_url + "/status/services" )
201204
202- self . driver .find_element_by_xpath ("//input[@class='select_many']" ).click ()
203- self . driver .find_element_by_xpath ("//a[@class='select_all']" ).click ()
205+ driver .find_element_by_xpath ("//input[@class='select_many']" ).click ()
206+ driver .find_element_by_xpath ("//a[@class='select_all']" ).click ()
204207
205- # Get all statustable rows
206- status_table_rows = self . driver .find_element_by_xpath (
207- "//table[contains(@class, 'statustable')]"
208- ).find_elements (By .XPATH , "//tbody/tr[contains(@class, 'mainrow')]" )
208+ # Get all statustable rows
209+ status_table_rows = driver .find_element_by_xpath (
210+ "//table[contains(@class, 'statustable')]"
211+ ).find_elements (By .XPATH , "//tbody/tr[contains(@class, 'mainrow')]" )
209212
210- # Sub-select non-selected
211- for row in status_table_rows :
212- self .assertTrue ('row_selected' in row .get_attribute ('class' ),
213- "Non selected row found after selecting all: " + \
214- row .text )
213+ # Sub-select non-selected
214+ for row in status_table_rows :
215+ self .assertTrue ('row_selected' in row .get_attribute ('class' ),
216+ "Non selected row found after selecting all: " + \
217+ row .text )
215218
216219 def test_status_overview_top_alert_producers (self ):
217220 """Check the top alert producers part of status overview"""
221+ for driver in self .drivers :
222+ driver .get (self .live_server_url + "/status" )
218223
219- self .driver .get (self .live_server_url + "/status" )
224+ top_alert_table_rows = driver .find_elements (By .XPATH ,
225+ "//table[@id='top_alert_producers']/tbody/tr"
226+ )
220227
221- top_alert_table_rows = self .driver .find_elements (By .XPATH ,
222- "//table[@id='top_alert_producers']/tbody/tr"
223- )
228+ count = 0
229+ for row in top_alert_table_rows :
230+ if 'display' not in row .get_attribute ('style' ):
231+ count += 1
224232
225- count = 0
226- for row in top_alert_table_rows :
227- if 'display' not in row .get_attribute ('style' ):
228- count += 1
229-
230- self .assertTrue (count <= 3 , "Top alert producers returns too many rows" )
233+ self .assertTrue (count <= 3 , "Top alert producers returns too many rows" )
0 commit comments