Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

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

未關閉
#22 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

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

研究方向

使用 seeNumberOfElements() 重現 Bootstrap 自訂單選按鈕範例,並將其與 seeNumberOfElementsInDOM() 進行比較;接著找出這些方法的實作以及相關的 acceptance.suite.yml 設定。完成標準是:定義 .custom-control-input 元素預期的可見性行為,並透過回歸測試涵蓋該行為,同時不破壞一般元素計數。

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

描述

Next problem with Bootstrap custom radio button after https://github.com/Codeception/module-webdriver/issues/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);
主要語言
PHP
星號
39
分支
25
PR 合併指標
30 天內沒有已合併 PR

貢獻指南

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

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

Codeception/module-webdriver 的其他 Issue

查看 Codeception/module-webdriver 的全部 Issue

相似的 Issue

更多 PHP Issue

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

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