cobrateam/splinter

Cannot set content of the proper Select element with Django (2.x) Admin with fieldsets (spl 0.11.0))

Open

#728 opened on Nov 6, 2019

View on GitHub
 (0 comments) (0 reactions) (0 assignees)Python (509 forks)auto 404
NeedsInvestigationdjangohelp wanted

Repository metrics

Stars
 (2,754 stars)
PR merge metrics
 (PR metrics pending)

Description

# fails! probably Splinter 0.11.0 error
# selEl.select(opt.value) <============= FAILS, will set the 1-st select in fieldset, regardless we have in selEl only the 2nd one

ie. in code bellow we cannot select 'impact'. Regardless only 'impact' is selected, .select() changes always 'criticity'.

this replacement directly with webdriver works well:
    from selenium.webdriver.support.ui import Select
    select = Select(self.br.driver.find_element_by_name(selEl.first['name']))
    select.select_by_value(opt.value)  # or .select_by_visible_text('Banana')

class VyjimkyAdmin(admin.ModelAdmin):
    form = VyjimkyForm
    fieldsets = [
        (_("Vyjimky"), {
            'fields': ("vyjimka_id",
                       "name",
                       "reason",
                       ("criticity", "impact", "scope"))
        }),

Contributor guide