[4.1.x] Refs #33725 -- Replaced deprecated find_element_by_css_selector() with find_elements(By.CSS_SELECTOR, …).
Follow up to90dcf27114
and2ccc0b22db
. Backport of1733c888f4
from main
This commit is contained in:
parent
170793f0b0
commit
9fc56af0fb
|
@ -148,13 +148,13 @@ class SeleniumTests(AdminSeleniumTestCase):
|
||||||
self.assertEqual(toggle_button.get_attribute("aria-label"), "Toggle navigation")
|
self.assertEqual(toggle_button.get_attribute("aria-label"), "Toggle navigation")
|
||||||
for link in self.selenium.find_elements(By.CSS_SELECTOR, "#nav-sidebar a"):
|
for link in self.selenium.find_elements(By.CSS_SELECTOR, "#nav-sidebar a"):
|
||||||
self.assertEqual(link.get_attribute("tabIndex"), "0")
|
self.assertEqual(link.get_attribute("tabIndex"), "0")
|
||||||
filter_input = self.selenium.find_element_by_css_selector("#nav-filter")
|
filter_input = self.selenium.find_element(By.CSS_SELECTOR, "#nav-filter")
|
||||||
self.assertEqual(filter_input.get_attribute("tabIndex"), "0")
|
self.assertEqual(filter_input.get_attribute("tabIndex"), "0")
|
||||||
toggle_button.click()
|
toggle_button.click()
|
||||||
# Hidden sidebar is not reachable via keyboard navigation.
|
# Hidden sidebar is not reachable via keyboard navigation.
|
||||||
for link in self.selenium.find_elements(By.CSS_SELECTOR, "#nav-sidebar a"):
|
for link in self.selenium.find_elements(By.CSS_SELECTOR, "#nav-sidebar a"):
|
||||||
self.assertEqual(link.get_attribute("tabIndex"), "-1")
|
self.assertEqual(link.get_attribute("tabIndex"), "-1")
|
||||||
filter_input = self.selenium.find_element_by_css_selector("#nav-filter")
|
filter_input = self.selenium.find_element(By.CSS_SELECTOR, "#nav-filter")
|
||||||
self.assertEqual(filter_input.get_attribute("tabIndex"), "-1")
|
self.assertEqual(filter_input.get_attribute("tabIndex"), "-1")
|
||||||
main_element = self.selenium.find_element(By.CSS_SELECTOR, "#main")
|
main_element = self.selenium.find_element(By.CSS_SELECTOR, "#main")
|
||||||
self.assertNotIn("shifted", main_element.get_attribute("class").split())
|
self.assertNotIn("shifted", main_element.get_attribute("class").split())
|
||||||
|
@ -192,12 +192,12 @@ class SeleniumTests(AdminSeleniumTestCase):
|
||||||
# Hidden sidebar is not reachable via keyboard navigation.
|
# Hidden sidebar is not reachable via keyboard navigation.
|
||||||
for link in self.selenium.find_elements(By.CSS_SELECTOR, "#nav-sidebar a"):
|
for link in self.selenium.find_elements(By.CSS_SELECTOR, "#nav-sidebar a"):
|
||||||
self.assertEqual(link.get_attribute("tabIndex"), "-1")
|
self.assertEqual(link.get_attribute("tabIndex"), "-1")
|
||||||
filter_input = self.selenium.find_element_by_css_selector("#nav-filter")
|
filter_input = self.selenium.find_element(By.CSS_SELECTOR, "#nav-filter")
|
||||||
self.assertEqual(filter_input.get_attribute("tabIndex"), "-1")
|
self.assertEqual(filter_input.get_attribute("tabIndex"), "-1")
|
||||||
toggle_button.click()
|
toggle_button.click()
|
||||||
for link in self.selenium.find_elements(By.CSS_SELECTOR, "#nav-sidebar a"):
|
for link in self.selenium.find_elements(By.CSS_SELECTOR, "#nav-sidebar a"):
|
||||||
self.assertEqual(link.get_attribute("tabIndex"), "0")
|
self.assertEqual(link.get_attribute("tabIndex"), "0")
|
||||||
filter_input = self.selenium.find_element_by_css_selector("#nav-filter")
|
filter_input = self.selenium.find_element(By.CSS_SELECTOR, "#nav-filter")
|
||||||
self.assertEqual(filter_input.get_attribute("tabIndex"), "0")
|
self.assertEqual(filter_input.get_attribute("tabIndex"), "0")
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
self.selenium.execute_script(
|
self.selenium.execute_script(
|
||||||
|
|
Loading…
Reference in New Issue