[Feature]: Numerical Comparison Assertions for hasCount
まだ誰も着手していません。
評価
調査の方向性
まず、既存の hasCount アサーションの実装と、要素数の取得に使用されている Playwright のポーリング基盤を見つけます。比較可能なアサーションが、より大きい、より小さい、以上、以下の条件をどのように公開しているかを確認します。提案するメソッドがネイティブポーリングによるしきい値チェックをサポートし、否定した等価性チェックよりも可読性を向上させれば完了です。
索引モデルが issue の本文から書いたものです。
説明
🚀 Feature Request
Currently, assertThat(locator).hasCount(n) only supports strict equality. In many real-world testing scenarios, the exact number of elements is dynamic, and we only need to verify if the count meets a certain threshold (e.g., "at least one item is present" or "no more than 10 items").
Example
Proposed Methods: hasCountGreaterThan(int n), hasCountLessThan(int n), hasCountAtLeast(int n), hasCountAtMost(int n).
Motivation
Improved Readability: Replaces less intuitive workarounds like assertThat(locator).not().hasCount(0).
Native Polling: These checks would leverage Playwright’s built-in auto-waiting mechanism, making tests much more stable than manual polling loops.
Implementation: The implementation is straightforward as Playwright already has the infrastructure to retrieve element counts and poll for conditions. It simply requires adding comparison operators to the assertion logic.
- 主要言語
- Java
- スター
- 1.6k
- フォーク
- 298
- 平均マージ
- 3日 2時間
- マージ済み PR(30日)
- 14
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/playwright-java のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
microsoft/playwright-java#1963 · コメント 1 件 ·
-
P3-collecting-feedback
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
microsoft/playwright-java#1885 · コメント 3 件 · リアクション 4 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
microsoft/playwright-java#1881 · コメント 3 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
microsoft/playwright-java#1876 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
microsoft/playwright-java#1866 ·
microsoft/playwright-java の issue をすべて見る
似ている issue
-
Bug Java Platform: Java
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
getsentry/sentry-java#6138 · コメント 1 件 ·
-
bug needs triage p2
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
GoogleCloudPlatform/DataflowTemplates#4273 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
bug needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100