Refs #24179 -- Fixed selenium tests for offset of admin selector boxes in fieldset.

Regression in be63c78760.
This commit is contained in:
Mariusz Felisiak 2022-09-07 12:02:08 +02:00 committed by GitHub
parent 42cd8c390d
commit a2e580acf6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 6 deletions

View File

@ -5875,13 +5875,17 @@ class SeleniumTests(AdminSeleniumTestCase):
url = self.live_server_url + reverse("admin7:admin_views_pizza_add") url = self.live_server_url + reverse("admin7:admin_views_pizza_add")
self.selenium.get(url) self.selenium.get(url)
self.selenium.find_elements(By.LINK_TEXT, "Show")[0].click() self.selenium.find_elements(By.LINK_TEXT, "Show")[0].click()
filter_box = self.selenium.find_element(By.ID, "id_toppings_filter") from_filter_box = self.selenium.find_element(By.ID, "id_toppings_filter")
from_box = self.selenium.find_element(By.ID, "id_toppings_from") from_box = self.selenium.find_element(By.ID, "id_toppings_from")
to_filter_box = self.selenium.find_element(By.ID, "id_toppings_filter_selected")
to_box = self.selenium.find_element(By.ID, "id_toppings_to") to_box = self.selenium.find_element(By.ID, "id_toppings_to")
self.assertEqual( self.assertEqual(
to_box.get_property("offsetHeight"),
( (
filter_box.get_property("offsetHeight") to_filter_box.get_property("offsetHeight")
+ to_box.get_property("offsetHeight")
),
(
from_filter_box.get_property("offsetHeight")
+ from_box.get_property("offsetHeight") + from_box.get_property("offsetHeight")
), ),
) )
@ -5896,13 +5900,21 @@ class SeleniumTests(AdminSeleniumTestCase):
) )
url = self.live_server_url + reverse("admin7:admin_views_question_add") url = self.live_server_url + reverse("admin7:admin_views_question_add")
self.selenium.get(url) self.selenium.get(url)
filter_box = self.selenium.find_element(By.ID, "id_related_questions_filter") from_filter_box = self.selenium.find_element(
By.ID, "id_related_questions_filter"
)
from_box = self.selenium.find_element(By.ID, "id_related_questions_from") from_box = self.selenium.find_element(By.ID, "id_related_questions_from")
to_filter_box = self.selenium.find_element(
By.ID, "id_related_questions_filter_selected"
)
to_box = self.selenium.find_element(By.ID, "id_related_questions_to") to_box = self.selenium.find_element(By.ID, "id_related_questions_to")
self.assertEqual( self.assertEqual(
to_box.get_property("offsetHeight"),
( (
filter_box.get_property("offsetHeight") to_filter_box.get_property("offsetHeight")
+ to_box.get_property("offsetHeight")
),
(
from_filter_box.get_property("offsetHeight")
+ from_box.get_property("offsetHeight") + from_box.get_property("offsetHeight")
), ),
) )