microsoft / microsoft/playwright-java
[Feature]: Support for Playwright Test Agents (Planner, Generator, Healer) in Java
まだ誰も着手していません。
- 主要言語
- Java
- スター
- 1.6k
- フォーク
- 298
- 平均マージ
- 3日 2時間
- マージ済み PR(30日)
- 14
説明
🚀 Feature Request
Description
Playwright v1.56+ introduced the Agentic Workflow (planner, generator, and healer) which has significantly improved the efficiency of test authoring and maintenance for Node.js users. However, these tools are currently not accessible to teams using the Java bindings.
As a Java user, I would like to leverage the AI-powered Healer Agent to automatically repair failing tests by inspecting the UI and updating locators, just as it is currently possible with npx playwright init-agents --loop=vscode.
Motivation
Many enterprise environments rely on Java for their test automation infrastructure. Currently, Java users have to:
Manually debug and fix locators.
Use third-party proxies (like Healenium) which require additional infrastructure.
Maintain separate Node.js environments just to utilize the AI agents.
Bringing parity to the Java library would allow us to integrate self-healing directly into our JUnit/TestNG workflows.
Proposed Implementation
CLI Support: Add agent initialization to the Playwright Java CLI (e.g., mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="init-agents").
Healer Integration: Allow the Healer to analyze Java test failures and suggest/apply patches to .java source files or Page Object Models.
Documentation: Provide a guide on how to configure the agentic loop within a Maven/Gradle project.
Example Use Case
When a locator in a Page Object fails:
Java
// Page Object
private final Locator submitButton;
public LoginPage(Page page) {
this.submitButton = page.locator("#old-id"); // This ID changed to #new-id
}
The Healer Agent should detect the TimeoutError, scan the DOM, identify the new ID, and suggest the fix directly in the console or IDE.
Example
No response
Motivation
Playwright has it for Javascript/Typscript (which I played with on my own and thought it was cool). But the test automation project that I am working was written with Java using the Selenium library. I added Playwright to the project due to 1) able to inject API responses and 2) able to execute using for Safari/Webkit (due to security the automation scripts have to set the user-agent value that Safari does not allow us to do). This would be able another cool feature.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、Playwright の Java CLI エントリポイントである com.microsoft.playwright.CLI と、Java Maven/Gradle プロジェクトからそれを呼び出す方法を確認します。エージェントの初期化、Java テストの失敗処理、ソースファイルへのパッチ適用、ドキュメントについて、想定されるスコープを明確にします。完了条件には、合意された実装範囲と、サポート対象の workflow の検証を含める必要があります。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java
- 領域
- cli, testing-qa
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 静か
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 30/100