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

seeNumberOfElements() doesn't count <input>s with Bootstrap's .custom-control-input class #22

Open
ThomasLandauer opened this issue Sep 21, 2020 · 0 comments

Comments

@ThomasLandauer
Copy link
Member

Next problem with Bootstrap custom radio button after #21

seeNumberOfElements() doesn't count those radiobuttons:

<input type="radio" class="custom-control-input">

This is probably because of z-index:-1 in Bootstrap's CSS:

.custom-control-input{position:absolute;left:0;z-index:-1;width:1rem;height:1.22rem;opacity:0}

Background: When using Bootstrap's custom radiobuttons, the standard browser widget is replaced by some other widget (SVG?) for nicer graphics.

I'm filing this here mainly to see if somebody else encounters it. A possible solution could be to set a configuration parameter in acceptance.suite.yml to switch the concerned methods' behavior to be compatible with Bootstrap.

In my case I can't look at the page's source code (what I'm guessing that e.g. seeNumberOfElementsInDOM() is doing), since I'm showing/hiding some radiobuttons with JavaScript, and I need to assert their visibility. My workaround: Count the labels instead:

$I->seeNumberOfElements(['css' => 'div#foobar label'], 7);
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