summaryrefslogtreecommitdiff
path: root/ishtar_common/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>2021-11-16 17:04:41 +0100
commit10b70e48f0bbf8b37a9073749b530ab3180c399d (patch)
treedcd66e8c1f5c3dab014b20df6888f075ab85a483 /ishtar_common/tests.py
parent0010a4e72303661b0285f9ef2186a8623f81b193 (diff)
downloadIshtar-10b70e48f0bbf8b37a9073749b530ab3180c399d.tar.bz2
Ishtar-10b70e48f0bbf8b37a9073749b530ab3180c399d.zip
factorization of access_from_dropdown for tests
Diffstat (limited to 'ishtar_common/tests.py')
-rw-r--r--ishtar_common/tests.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/ishtar_common/tests.py b/ishtar_common/tests.py
index 2077a3781..2049b7828 100644
--- a/ishtar_common/tests.py
+++ b/ishtar_common/tests.py
@@ -3634,6 +3634,25 @@ class SeleniumTests(StaticLiveServerTestCase):
element,
)
+ def access_from_dropdown(self, slug):
+ if slug == 'contextrecord':
+ slug = 'record'
+ if slug == 'basefind':
+ slug = 'find'
+ 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"]'
+ )
+ self.scroll(dropdown)
+ dropdown.click()
+ self.selenium.find_element_by_xpath(
+ '//div[@class="dropdown-menu show"]/a[@href="/' + slug + '_search/"]'
+ ).click()
+
def assertNotInDOM(self, xpath):
self.selenium.implicitly_wait(self.waiting_time / 5)
try: