summaryrefslogtreecommitdiff
path: root/archaeological_operations/tests.py
diff options
context:
space:
mode:
authorQuentinAndre <quentin.andre@imt-atlantique.net>2021-08-25 16:19:11 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2022-07-08 09:58:48 +0200
commit6be165ad3a5f7d4a1b7622c095a4996857ecb114 (patch)
tree28e14ae9fae4437a633aba1103feb2f8e8d469a6 /archaeological_operations/tests.py
parent82893c90a90eec6718de7bed10962f68712a41a6 (diff)
downloadIshtar-6be165ad3a5f7d4a1b7622c095a4996857ecb114.tar.bz2
Ishtar-6be165ad3a5f7d4a1b7622c095a4996857ecb114.zip
factorization of access_from_dropdown for tests
Diffstat (limited to 'archaeological_operations/tests.py')
-rw-r--r--archaeological_operations/tests.py22
1 files changed, 2 insertions, 20 deletions
diff --git a/archaeological_operations/tests.py b/archaeological_operations/tests.py
index 9d835aa93..085897dea 100644
--- a/archaeological_operations/tests.py
+++ b/archaeological_operations/tests.py
@@ -4394,30 +4394,12 @@ class SeleniumTestsOperations(SeleniumTests):
def test_geo_items(self):
pks, geojsons = self.pks_and_geojson()
- self.WebDriverWait(self.selenium, self.waiting_time).until(
- lambda driver: driver.find_element_by_xpath(
- '//a[@class="nav-link dropdown-toggle"][@id="dropdown-menu-main"]'
- )
- )
- dropdown = self.selenium.find_element_by_xpath(
- '//a[@class="nav-link dropdown-toggle"][@id="dropdown-menu-main"]'
- )
- dropdown.click()
- self.selenium.find_element_by_xpath(
- '//div[@class="dropdown-menu show"]/a[@href="/operation_search/"]'
- ).click()
+ self.access_from_dropdown('operation')
ope = models.Operation.objects.get(pk=pks["Poly"])
slug_pk_poly = ope.SLUG + "-" + str(ope.pk)
self._test_operation(2, slug_pk_poly, copy.deepcopy(geojsons), "Poly")
- dropdown = self.selenium.find_element_by_xpath(
- '//a[@class="nav-link dropdown-toggle"][@id="dropdown-menu-main"]'
- )
- self.scroll(dropdown)
- dropdown.click()
- self.selenium.find_element_by_xpath(
- '//div[@class="dropdown-menu show"]/a[@href="/operation_search/"]'
- ).click()
+ self.access_from_dropdown('operation')
ope = models.Operation.objects.get(pk=pks["Pt"])
slug_pk_pt = ope.SLUG + "-" + str(ope.pk)
self._test_operation(1, slug_pk_pt, copy.deepcopy(geojsons), "Pt")