Codeception / Codeception/module-webdriver

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

未關閉
#21 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
PHP
星號
39
分支
25
PR 合併指標
30 天內沒有已合併 PR

描述

I have a [Bootstrap custom radio button](https://getbootstrap.com/docs/4.5/components/forms/#radios):
```html



Whatever

```
When I do this in an acceptance test:
```php
$I->selectOption('input[name="form[foo]"]', 'Whatever:');
```
or
```php
$I->click(['css' => '#form_foo_0']);
```
...I'm getting:
> [Facebook\WebDriver\Exception\ElementClickInterceptedException] element click intercepted:
Element \ is not clickable at point (44, 1171).
Other element would receive the click:
\...\
(Session info: chrome=85.0.4183.83)

The workaround I'm using now is to click the *label:*
```php
$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 `` - it's created by [Symfony's Bootstrap form theme](https://symfony.com/doc/current/form/bootstrap4.html#custom-forms)

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

從報告中提到的 WebDriver 模組進入點開始:selectOption() 和 click(),並使用 Bootstrap 的 custom-control-input 單選按鈕及其 label 重現該故障。比較現有的 label workaround 與遭攔截的 input 點擊,然後確認預期的 option 已被選取,且不會破壞一般的單選按鈕互動。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
bootstrap, php
領域
testing-qa
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。