#30975: Replace get_select_option with native select_by_value
------------------------------------------------+--------------------------
Reporter: Johannes Hoppe | Owner: nobody
Type: Cleanup/optimization | Status: assigned
Component: Testing framework | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+--------------------------
We have our own method called
`django.contrib.admin.tests.AdminSeleniumTestCase.get_select_option` which
does the very same thing as
`selenium.webdriver.support.select.Select.select_by_value`.
We could replace it with something like:
{{{
def select_option(self, select_tag_css_selector, value):
from selenium.webdriver.support.ui import Select
select =
Select(self.selenium.find_element_by_css_selector(select_tag_css_selector))
select.select_by_value(value)
}}}
This would avoid looping over the DOM-tree as it's done in the current
implementation.
Furthermore, it can avoid errors when a select-tag is outside the current
viewport.
--
Ticket URL: <https://code.djangoproject.com/ticket/30975>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/052.7f1b8989ab49c20540e872c076d63a84%40djangoproject.com.