docs: project docs, scripts, deployment configs, and evidence
This commit is contained in:
@@ -0,0 +1,113 @@
|
||||
# Agent Browser Validation
|
||||
|
||||
- Date: 2026-03-24
|
||||
- Tool: `agent-browser 0.22.0`
|
||||
- Scope: verify whether newly installed `agent-browser` can extend current `frontend/admin` E2E closure beyond the existing Playwright CDP path
|
||||
|
||||
## Validation Goal
|
||||
|
||||
Determine whether `agent-browser` can:
|
||||
|
||||
- act as a stable browser automation path in the current constrained Windows environment
|
||||
- close any remaining OS-level validation gap
|
||||
- be promoted to a supported project E2E entrypoint
|
||||
|
||||
## Environment Findings
|
||||
|
||||
- PowerShell wrapper entrypoint `agent-browser.ps1` is blocked by execution policy in the current environment.
|
||||
- The native binary is callable directly:
|
||||
- `C:\Users\Admin\AppData\Roaming\npm\node_modules\agent-browser\bin\agent-browser-win32-x64.exe`
|
||||
- `agent-browser` requires its daemon socket directory to be redirected to a writable root:
|
||||
- `AGENT_BROWSER_SOCKET_DIR=C:\Users\Admin\.codex\memories\agent-browser-home\socket`
|
||||
- Official browser bootstrap path was also tested:
|
||||
- `agent-browser install`
|
||||
- result: failed to fetch Chrome for Testing version metadata from `googlechromelabs.github.io`
|
||||
- conclusion: the official first-run install path is not currently closed in this environment
|
||||
|
||||
## Execution Paths Tested
|
||||
|
||||
### 1. Native launch mode
|
||||
|
||||
Tested with:
|
||||
|
||||
- `--executable-path C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe`
|
||||
- `--executable-path C:\Users\Admin\AppData\Local\ms-playwright\chromium-1208\chrome-win64\chrome.exe`
|
||||
- crash-dialog / crashpad suppression args aligned with the existing stable browser wrapper:
|
||||
- `--noerrdialogs`
|
||||
- `--disable-breakpad`
|
||||
- `--disable-crash-reporter`
|
||||
- `--disable-crashpad-for-testing`
|
||||
- `--no-sandbox`
|
||||
- `--disable-dev-shm-usage`
|
||||
- `--headless=new`
|
||||
|
||||
Result:
|
||||
|
||||
- failed before DevTools became ready
|
||||
- representative error:
|
||||
- `Chrome exited early ... without writing DevToolsActivePort`
|
||||
- crashpad / mojo access-denied errors were still present
|
||||
- the failure reproduced both with system Edge and with Playwright cached Chromium `chrome.exe`
|
||||
|
||||
Conclusion:
|
||||
|
||||
- `agent-browser` launch mode is not currently usable as a stable browser launcher in this environment
|
||||
|
||||
### 2. External CDP connect mode
|
||||
|
||||
Tested by connecting `agent-browser` to the already stabilized external browser path started by [`frontend/admin/scripts/run-cdp-smoke.ps1`](/D:/project/frontend/admin/scripts/run-cdp-smoke.ps1).
|
||||
|
||||
Result:
|
||||
|
||||
- stable for observation steps:
|
||||
- `open`
|
||||
- `wait --load networkidle`
|
||||
- `snapshot -i`
|
||||
- `get text`
|
||||
- successful snapshot captured interactive refs on `/login`, including:
|
||||
- username textbox `@e7`
|
||||
- password textbox `@e8`
|
||||
- login button `@e6`
|
||||
- partially usable for limited in-page actions:
|
||||
- `focus @e7`: succeeded
|
||||
- `eval` against the page context: succeeded for DOM value injection
|
||||
- not stable for user-like interaction steps:
|
||||
- `fill` timed out repeatedly after successful snapshot
|
||||
- `type @e7 e2e_admin`: failed with read timeout / host not responding
|
||||
- `keyboard inserttext e2e_admin`: failed with `CDP error (Input.dispatchKeyEvent): Invalid 'text' parameter`
|
||||
- `click @e6` after successful `eval`-based field population: failed with read timeout / host not responding
|
||||
- `eval`-triggered DOM `submit.click()` returned successfully, but the subsequent `wait --url **/dashboard` still failed with read timeout / host not responding
|
||||
|
||||
Representative result:
|
||||
|
||||
- `open http://127.0.0.1:3000/login`: success
|
||||
- `snapshot -i`: success
|
||||
- `get text @e2`: success
|
||||
- `focus @e7`: success
|
||||
- `eval` to set username: success
|
||||
- `fill @e7 e2e_admin`: failed with read timeout / host not responding
|
||||
- `type @e7 e2e_admin`: failed with read timeout / host not responding
|
||||
- `keyboard inserttext e2e_admin`: failed with invalid CDP parameter
|
||||
- `click @e6`: failed with read timeout / host not responding
|
||||
- DOM-triggered login + `wait --url **/dashboard`: failed with read timeout / host not responding
|
||||
|
||||
Conclusion:
|
||||
|
||||
- in the current environment, `agent-browser` connect mode is usable for observational inspection and limited in-page diagnostics
|
||||
- it is not reliable for user-like interactive E2E execution or workflow progression
|
||||
|
||||
## Real Conclusion
|
||||
|
||||
- Installing `agent-browser` does not currently close the remaining OS-level validation gap.
|
||||
- It does not replace the existing supported E2E path.
|
||||
- Current supported browser-level E2E path remains:
|
||||
- Playwright library
|
||||
- external browser launch
|
||||
- CDP connection
|
||||
- [`npm.cmd run e2e:full:win`](/D:/project/frontend/admin/package.json)
|
||||
- `agent-browser` is currently best described as:
|
||||
- installed
|
||||
- partially usable for read-only browser inspection plus limited DOM-assisted diagnostics
|
||||
- not yet a supported interactive E2E runner
|
||||
- not evidence of full OS-level automation closure
|
||||
- not capable of supporting full simulated user-operation or OS-level validation in the current environment
|
||||
@@ -0,0 +1,57 @@
|
||||
# Playwright CDP E2E Closure
|
||||
|
||||
- Date: 2026-03-24
|
||||
- Scope: `frontend/admin` full real-browser E2E through external browser launch + Playwright CDP connection
|
||||
- Environment: Windows PowerShell, current constrained environment where `playwright test` worker spawn is blocked by `spawn EPERM`
|
||||
|
||||
## Commands Executed
|
||||
|
||||
```powershell
|
||||
cd D:\project\frontend\admin
|
||||
npm.cmd run lint
|
||||
npm.cmd run build
|
||||
npm.cmd run test:run
|
||||
npm.cmd run e2e:full:win
|
||||
1..3 | ForEach-Object { npm.cmd run e2e:full:win }
|
||||
```
|
||||
|
||||
## Validated Results
|
||||
|
||||
- `npm.cmd run lint`: passed
|
||||
- `npm.cmd run build`: passed
|
||||
- `npm.cmd run test:run`: passed
|
||||
- test files: `7`
|
||||
- tests: `24`
|
||||
- `npm.cmd run e2e:full:win`: passed
|
||||
- After browser cleanup hardening in [`frontend/admin/scripts/run-cdp-smoke.ps1`](/D:/project/frontend/admin/scripts/run-cdp-smoke.ps1), three consecutive reruns of `npm.cmd run e2e:full:win` all passed without wrapper retry
|
||||
|
||||
## Full E2E Scenarios
|
||||
|
||||
- `login-surface`
|
||||
- `auth-workflow`
|
||||
- `responsive-login`
|
||||
- `desktop-mobile-navigation`
|
||||
|
||||
## Failure Signals Enforced
|
||||
|
||||
The Playwright CDP harness treats the following as failures:
|
||||
|
||||
- console errors
|
||||
- native dialogs
|
||||
- popup pages
|
||||
- page errors
|
||||
- request failures
|
||||
- `401` responses
|
||||
- blocked `window` guard events
|
||||
|
||||
No such failure signal was observed in the successful runs above.
|
||||
|
||||
## Closure Notes
|
||||
|
||||
- Current supported E2E path is browser-level real validation, not DOM mock.
|
||||
- Current supported E2E path is `Playwright library + external browser + CDP`; it does not depend on `playwright test` runner workers.
|
||||
- This is not full OS-level automation. It does not claim coverage for native file pickers, system permission dialogs, or other desktop-level interactions.
|
||||
|
||||
## Conclusion
|
||||
|
||||
In the current constrained Windows environment, the browser-level E2E closure for `frontend/admin` is complete and reproducibly passing on the supported CDP path.
|
||||
@@ -0,0 +1,57 @@
|
||||
# Raw CDP Windows Stability Evidence
|
||||
|
||||
- Generated at: 2026-03-24 12:18:16 +08:00
|
||||
- Scope: `frontend/admin` raw CDP Windows smoke stability after `chrome-headless-shell` crash-dialog and residual-process mitigation
|
||||
|
||||
## Commands Executed
|
||||
|
||||
```powershell
|
||||
cd D:\project\frontend\admin
|
||||
npm.cmd run e2e:auth-smoke:win
|
||||
npm.cmd run e2e:smoke:win
|
||||
```
|
||||
|
||||
## Auth Smoke Result
|
||||
|
||||
- Command exit: `0`
|
||||
- `chrome-headless-shell` count before run: `76`
|
||||
- `chrome-headless-shell` count after run: `76`
|
||||
- Key output:
|
||||
- `login landing path: /users`
|
||||
- `user detail title: 用户详情`
|
||||
- `assign roles title: 分配角色 - e2e_admin`
|
||||
- `roles path: /roles`
|
||||
- `permissions title: 分配权限 - 管理员`
|
||||
- `dashboard path: /dashboard`
|
||||
- `logout path: /login`
|
||||
- `login-initial: 105ms`
|
||||
- `login-desktop: 194ms`
|
||||
- `login-tablet: 100ms`
|
||||
- `login-mobile: 90ms`
|
||||
|
||||
## Smoke Result
|
||||
|
||||
- Command exit: `0`
|
||||
- `chrome-headless-shell` count before run: `76`
|
||||
- `chrome-headless-shell` count after run: `76`
|
||||
- Key output:
|
||||
- `protected dashboard redirect: /login (from=/dashboard)`
|
||||
- `protected users redirect: /login (from=/users)`
|
||||
- `login-initial: 89ms`
|
||||
- `login-desktop: 185ms`
|
||||
- `login-tablet: 119ms`
|
||||
- `login-mobile: 88ms`
|
||||
|
||||
## Mitigation Applied
|
||||
|
||||
- `frontend/admin/scripts/run-cdp-smoke.ps1`
|
||||
- added `--noerrdialogs`
|
||||
- added `--disable-breakpad`
|
||||
- added `--disable-crash-reporter`
|
||||
- added `--disable-crashpad-for-testing`
|
||||
|
||||
## Conclusion
|
||||
|
||||
- Raw CDP Windows `smoke` and `auth smoke` both exited successfully after mitigation.
|
||||
- Current local `chrome-headless-shell` process count did not increase across either run.
|
||||
- This closes the previously observed “business flow passes but command exits non-zero because of new leaked PID” gap for the current environment.
|
||||
Reference in New Issue
Block a user