[Feature]: OptionsFactory that has access to test instance fields
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- java
- 領域
- testing-qa
調査の方向性
まず、@UsePlaywright OptionsFactory の統合を追跡し、テストインスタンスとの関係でどのように初期化されるかを確認します。注入された EmbeddedServer を使用する例を確認し、インスタンスフィールドにアクセスするために必要なライフサイクルを特定します。Options が実行中のテストの値を使用でき、既存の @UsePlaywright の動作が引き続きサポートされれば完了です。
索引モデルが issue の本文から書いたものです。
説明
🚀 Feature Request
I'd like the ability to populate Options for use with @UsePlaywright with values that are determined by the running test, not just statically.
The OptionsFactory approach to customizing @UsePlaywright has a big gap - it can't access instance fields of the test. A non-static inner class doesn't work as it requires the outer class as a constructor argument.
Example
@UsePlaywright
@MicronautTest
class MyTest {
@Inject
EmbeddedServer server;
Options getOptions() {
return new Options().setBaseUrl(server.getUrl())
}
@Test
void myTest(Page page) {
}
}
Motivation
I'm trying to use Playwright with a fake server (Spring MockMVC, Micronaut EmbeddedServer, etc). These approaches all inject a server into an instance field of the test class, and one retrieves the base URL from that server. However, OptionsFactory is initialized outside of the test instance scope, and so can't make use of that injected server.
- 主要言語
- 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日 初心者へのやさしさ 48/100
microsoft/playwright-java#1876 · コメント 1 件 ·
-
P3-collecting-feedback
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
microsoft/playwright-java#1875 ·
-
難易度 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 件 ·
-
[Studio][Bug] Bulk-deleting a full page of alert rules steps the page back while more rules remain オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
apache/rocketmq-dashboard#4654 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100