Playwright Agent healer
https://www.youtube.com/watch?v=ABKjVyh1iX4 那我在visual code 內用opencode.用這指令 npx playwright init-agents --loop=opencode 之後要做什模步驟才可以測試playwright agent healer 功能 執行 npx playwright init-agents --loop=opencode 後,如果你想在 Visual Studio Code (VS Code) 內測試 Playwright 的 Healer(自動修復)功能 ,你需要透過 OpenCode 提供的客戶端/擴充功能 或終端機來驅動這個代理環境。 以下是完整的測試步驟: 步驟一:確保你有一個「會失敗」的測試案例 Healer 的核心功能是診斷並修復失敗的測試。你必須在 tests/ 資料夾下,準備一個因為網頁改版、網頁元素變動(例如 Selector 改變)而 必然會執行失敗 的 Playwright 測試檔案(如 tests/failed-demo.spec.ts )。 [ 1 , 2 , 3 ] 步驟二:安裝並啟動 OpenCode 工具 由於你指定了 --loop=opencode ,你不能直接使用 VS Code 原生的 Copilot 面板,而是需要透過 OpenCode 的介面: [, 2 ] 請確認已下載並安裝 OpenCode 的獨立應用程式,或其對應的 VS Code 擴充外掛。 在該環境中開啟你目前的 Playwright 專案資料夾。 [ 1 , 2 ] 步驟三:提供 Healer 代理設定檔 檢查你的專案根目錄,初始化後應該會生成一個 agents/ (或對應 OpenCode 的設定)資料夾,裡面包含三個 Markdown 代理定義檔: [ 1 , 2 ] playwright-test-planner.agent.md playwright-test-generator.agent.md playwright-test-healer.agent.md [ 1 ] 這些檔案包含了 OpenCode 的 AI 讀取 MCP 工具時所需的指令與權限(請勿刪除或隨意更名)。 [ 1 , 2 ] 步驟四:在 OpenCode Chat 中切換並下達...