Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug since switch from mechanize #31

Closed
fschulze opened this issue Jul 30, 2017 · 3 comments
Closed

Bug since switch from mechanize #31

fschulze opened this issue Jul 30, 2017 · 3 comments
Labels

Comments

@fschulze
Copy link
Contributor

The behaviour related to setting radio controls has changed in some cases.

I added a test case in master...fschulze:radio-master.

I added the same one for 4.0.4 in 4.0.4...fschulze:radio-4.0.4 to show that it works correctly with mechanize.

@fschulze
Copy link
Contributor Author

The tests in https://github.com/fschulze/zope.testbrowser/tree/radio-4.0.4 work when using the buildout and running the test script.

@mgedmin
Copy link
Member

mgedmin commented Aug 31, 2017

The failure looks like this:

**********************************************************************
File "narrative.rst", line ?, in default
Failed example:
    browser.getControl(name='radio-value-a').getControl(value='true', index=0)
Expected:
    <ItemControl name='radio-value-a' type='radio' optionValue='true' selected=False>
Got:
    <ItemControl name='radio-value-a' type='radio' optionValue='true' selected=True>
**********************************************************************

@mgedmin mgedmin added the bug label Aug 31, 2017
@mgedmin
Copy link
Member

mgedmin commented Aug 31, 2017

The problem here is that RadioItemControl.selected = True is translated into RadioListControl.value = RadioItemControl.value, which cannot disambiguate items with the same value.

We could be assigning to WebTest's Radio control's selectedIndex instead of value to avoid this issue.

mgedmin added a commit that referenced this issue Aug 31, 2017
This allows us to disambiguate multiple items that have the same value.

Fixes #31.
mgedmin added a commit that referenced this issue Sep 29, 2017
This allows us to disambiguate multiple items that have the same value.

Fixes #31.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants