Improve reliability of integration tests

This commit is contained in:
Anna Sidwell 2019-08-20 00:30:13 +02:00
parent dcb8f4beec
commit 03a72e5480

View File

@ -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"
)