Playwright Network HAR Recorder by agentskillexchange/skills
npx skills add https://github.com/agentskillexchange/skills --skill 'Playwright Network HAR Recorder'使用 Playwright 的 routeFromHAR API 录制和回放 HTTP 存档(HAR)文件,为测试环境提供确定性支持。支持选择性录制、响应修改和 API 模拟生成。
Playwright Network HAR 录制器利用 Playwright 内置的 routeFromHAR 和 recordHar API,捕获并回放网络流量为 HTTP 存档(HAR)文件。通过用录制的响应替换实时 API 调用,实现了确定性的测试环境。
录制模式捕获所有网络流量,并支持通过 URL 模式、内容类型或请求方法进行可配置的过滤。HAR 文件包含请求/响应头、正文、时序数据以及 TLS 证书信息。敏感数据(如身份验证令牌、API 密钥和个人身份信息字段)可通过可配置的模式自动脱敏。
回放模式使用 routeFromHAR 拦截匹配的请求并提供录制的响应,并为未匹配的请求提供回退策略(直通、中止或自定义响应)。响应修改功能支持动态更新录制的数据——注入测试特定的值、模拟错误响应或调整时间戳以防止数据过时问题。
API 模拟生成功能将 HAR 录制转换为独立的模拟服务器配置,兼容 MSW(Mock Service Worker)、WireMock 和 Playwright 的原生路由处理器。该技能包含 HAR 文件比较工具,用于检测录制之间的 API 契约变更,适用于消费者驱动的契约测试工作流。
npx skills add agentskillexchange/skills --skill playwright-network-har-recorder
npx skills add agentskillexchange/skills --skill playwright-network-har-recorder -a claude-code
npx skills add agentskillexchange/skills --skill playwright-network-har-recorder -a cursor
npx skills add agentskillexchange/skills --skill playwright-network-har-recorder -a codex
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
clawhub install playwright-network-har-recorder
每周安装次数
–
代码仓库
GitHub 星标数
1
首次出现时间
–
安全审计
Records and replays HTTP Archive (HAR) files using Playwright routeFromHAR API for deterministic test environments. Supports selective recording, response modification, and API mock generation.
The Playwright Network HAR Recorder captures and replays network traffic as HTTP Archive (HAR) files using Playwright’s built-in routeFromHAR and recordHar APIs. This enables deterministic test environments by replacing live API calls with recorded responses.
Recording mode captures all network traffic with configurable filters by URL pattern, content type, or request method. The HAR file includes request/response headers, bodies, timing data, and TLS certificate information. Sensitive data can be automatically redacted using configurable patterns for auth tokens, API keys, and PII fields.
Replay mode uses routeFromHAR to intercept matching requests and serve recorded responses, with fallback strategies for unmatched requests (pass-through, abort, or custom response). Response modification enables dynamic updates to recorded data — injecting test-specific values, simulating error responses, or adjusting timestamps to prevent stale data issues.
API mock generation converts HAR recordings into standalone mock server configurations compatible with MSW (Mock Service Worker), WireMock, and Playwright’s native route handlers. The skill includes HAR file comparison tools for detecting API contract changes between recordings, useful for consumer-driven contract testing workflows.
npx skills add agentskillexchange/skills --skill playwright-network-har-recorder
npx skills add agentskillexchange/skills --skill playwright-network-har-recorder -a claude-code
npx skills add agentskillexchange/skills --skill playwright-network-har-recorder -a cursor
npx skills add agentskillexchange/skills --skill playwright-network-har-recorder -a codex
clawhub install playwright-network-har-recorder
Weekly Installs
–
Repository
GitHub Stars
1
First Seen
–
Security Audits
通过 LiteLLM 代理让 Claude Code 对接 GitHub Copilot 运行 | 高级变通方案指南
31,600 周安装