0
0
mirror of https://github.com/django/django.git synced 2024-11-29 14:46:18 +01:00

Refs #33725 -- Replaced deprecated find_element_by_css_selector() with find_elements(By.CSS_SELECTOR, …).

Follow up to 90dcf27114 and
2ccc0b22db.
This commit is contained in:
Mariusz Felisiak 2022-05-23 06:06:37 +02:00 committed by GitHub
parent f825536b5e
commit 1733c888f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -148,13 +148,13 @@ class SeleniumTests(AdminSeleniumTestCase):
self.assertEqual(toggle_button.get_attribute("aria-label"), "Toggle navigation")
for link in self.selenium.find_elements(By.CSS_SELECTOR, "#nav-sidebar a"):
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")
toggle_button.click()
# Hidden sidebar is not reachable via keyboard navigation.
for link in self.selenium.find_elements(By.CSS_SELECTOR, "#nav-sidebar a"):
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")
main_element = self.selenium.find_element(By.CSS_SELECTOR, "#main")
self.assertNotIn("shifted", main_element.get_attribute("class").split())
@ -192,12 +192,12 @@ class SeleniumTests(AdminSeleniumTestCase):
# Hidden sidebar is not reachable via keyboard navigation.
for link in self.selenium.find_elements(By.CSS_SELECTOR, "#nav-sidebar a"):
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")
toggle_button.click()
for link in self.selenium.find_elements(By.CSS_SELECTOR, "#nav-sidebar a"):
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(
self.selenium.execute_script(