microsoft / microsoft/playwright-java
[Feature] Add custom description to assertThat and/or Locator naming
オープン
まだ誰も着手していません。
P3-collecting-feedback
- 主要言語
- Java
- スター
- 1.6k
- フォーク
- 298
- 平均マージ
- 3日 2時間
- マージ済み PR(30日)
- 14
説明
With assertJ, we can add a custom name for given asserted object, for example:
Assertions.assertThat(mansion.guests()).as("Living Guests").isEqualTo(7);
Will result in:
[Living Guests] expected:<[7]> but was<[6]>
Selenide comes with element-aliasing as well as the .because() call (that does the similar thing, but not on asserted element, but the assertion itself):
$("div >> span").as("Living Guests").shouldHaveSize(7).because("The guest count should be valid")
The playwright-java assertions would be more readable if we'd be able to do similar thing with PlaywrightAssertions.assertThat or even the Locator/Page/ApiResponse itself, e.g.:
// on assertion:
PlaywrightAssertions.assertThat(questCount).hasText("7").because("The guest count should be valid");
// on asserted object:
PlaywrightAssertions.assertThat(questCount).as("Living Guests").hasText("7");
// on Locator
Locator guestCount = page.locator("div >> span").as("Living Guests");
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず PlaywrightAssertions API と、issue で参照されている Locator、Page、ApiResponse 型を読みます。アサーションレベルとオブジェクトレベルで要求されている命名例を比較し、その後、失敗メッセージにカスタムの説明または名前を含める、一貫したサポート対象のアプローチを定義します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java, playwright
- 領域
- testing-qa
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 25/100