Codeception / Codeception/module-webdriver

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

Đang mở
#22 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
PHP
Star
39
Fork
25
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Next problem with [Bootstrap custom radio button](https://getbootstrap.com/docs/4.5/components/forms/#radios) after https://github.com/Codeception/module-webdriver/issues/21

`seeNumberOfElements()` doesn't count those radiobuttons:
```html

```
This is probably because of `z-index:-1` in Bootstrap's CSS:
```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()`](https://codeception.com/docs/modules/WebDriver#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:
```php
$I->seeNumberOfElements(['css' => 'div#foobar label'], 7);
```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.