From 03a72e548043f4f8c3d7ee3d2310a39bf6d1bbfe Mon Sep 17 00:00:00 2001 From: Anna Sidwell Date: Tue, 20 Aug 2019 00:30:13 +0200 Subject: [PATCH] Improve reliability of integration tests --- ojusomap/tests.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ojusomap/tests.py b/ojusomap/tests.py index f35ced5..e28f016 100644 --- a/ojusomap/tests.py +++ b/ojusomap/tests.py @@ -95,9 +95,11 @@ class MapTest(SeleniumTest): def place_marker(self): # click the zoom out button enough to bring up the thing to draw marker then use it. # the headless browser needs time between each click or it does not show the draw-marker control. - for i in range(0, 15): - self.sl.find_element_by_class_name("leaflet-control-zoom-in").click() + zoom_in = self.sl.find_element_by_class_name("leaflet-control-zoom-in") + for i in range(0, 30): + zoom_in.click() time.sleep(0.2) + self.sl.find_element_by_class_name("leaflet-draw-draw-marker").click() self.sl.find_element_by_id("id_location-map").click() @@ -202,6 +204,11 @@ class MapTest(SeleniumTest): ) self.sl.find_element_by_css_selector(".leaflet-marker-icon").click() + WebDriverWait(self.sl, 5).until( + visibility_of_element_located( + (By.CSS_SELECTOR, ".leaflet-popup-content a.btn") + ) + ) details_link = self.sl.find_element_by_css_selector( ".leaflet-popup-content a.btn" )