summaryrefslogtreecommitdiff
path: root/ishtar_common/tests.py
diff options
context:
space:
mode:
authorQuentin André <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
commitc1f12a9f4b6d724b6db3bed8e429118288933584 (patch)
tree28e14ae9fae4437a633aba1103feb2f8e8d469a6 /ishtar_common/tests.py
parent3411f82f63aed68ca5037e5088608b25573eab3e (diff)
downloadIshtar-c1f12a9f4b6d724b6db3bed8e429118288933584.tar.bz2
Ishtar-c1f12a9f4b6d724b6db3bed8e429118288933584.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 b7c0a674e..8aef93b32 100644
--- a/ishtar_common/tests.py
+++ b/ishtar_common/tests.py
@@ -3714,6 +3714,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: