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

selectOption() not working with Bootrap's radio-custom radiobuttons #21

Open
ThomasLandauer opened this issue Sep 21, 2020 · 1 comment

Comments

@ThomasLandauer
Copy link
Member

I have a Bootstrap custom radio button:

<div class="custom-control custom-radio">
    <input type="radio" id="form_foo_0" name="form[foo]" value="Whatever" class="custom-control-input">
    <label for="form_foo_0" class="radio-custom custom-control-label required">Whatever</label>
</div>

When I do this in an acceptance test:

$I->selectOption('input[name="form[foo]"]', 'Whatever:');

or

$I->click(['css' => '#form_foo_0']);

...I'm getting:

[Facebook\WebDriver\Exception\ElementClickInterceptedException] element click intercepted:
Element <input type="radio" id="form_foo_0" name="form[foo]" value="Whatever" class="custom-control-input"> is not clickable at point (44, 1171).
Other element would receive the click:
<label for="form_foo_0" class="radio-custom custom-control-label required">...</label>
(Session info: chrome=85.0.4183.83)

The workaround I'm using now is to click the label:

$I->click(['css' => 'label[for="form_foo_0"]']);

Due to the popularity of Bootstrap I'm wondering if an out-of-the-box solution would be better in this case.

P.S.: I don't know why I have the class radio-custom on the <label> - it's created by Symfony's Bootstrap form theme

@ThomasLandauer
Copy link
Member Author

ThomasLandauer commented Sep 22, 2020

Same for checkOption()/uncheckOption() with a .checkbox-custom checkbox

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

No branches or pull requests

1 participant