edno / codeception-browsermob
该软件包已被废弃,不再维护。没有建议的替代软件包。
提供 BrowserMob Proxy 功能的 Codeception 扩展
0.1.1
2016-07-20 22:04 UTC
Requires
- php: ^5.5 || ^7.0
- chartjes/php-browsermob-proxy: dev-master
- codeception/codeception: ^2.2
Requires (Dev)
This package is auto-updated.
Last update: 2021-08-29 22:39:15 UTC
README
Codeception 模块,用于 BrowserMob Proxy。
路线图
- 0.1:基于 chartjes 的库 PHPBrowserMobProxy 的初始版本,对 BrowserMob Proxy 旧版 API 的支持有限,没有 Littleproxy 支持。
- 0.2:新的 PHP BrowserMob Proxy,支持完整的 REST API(Jetty 和 Littleproxy)和 代理自动配置 功能。
- 0.3:与 Codeception 模块 PhpBrowser 和 WebDriver 的完全集成。
最低要求
- Codeception 2.2
- PHP 7.2
- BrowserMob Proxy 2.0
安装
可以使用 Composer 安装该模块。
$ composer require edno/codeception-browsermob
请确保如以下 配置 中所示启用模块。
配置
在您的配置文件 .yml
中启用 BrowserMob。
module: enabled: - Codeception\Extension\BrowserMob host: 'localhost' port: 8080
参数
BrowserMob 支持以下配置参数
参数 | 类型 | 描述 |
---|---|---|
host |
字符串 | BrowserMob Proxy 主机 |
port |
整数 | BrowserMob Proxy 端口 |
autostart |
布尔值 | 自动启动新的代理实例 [默认 = false] |
whitelist |
数组 | URL 白名单
|
blacklist |
数组 | URL 黑名单
|
limits |
数组 | 通过代理的带宽限制(见 BrowserMob Proxy REST API) |
timeouts |
数组 | 代理超时(见 BrowserMob Proxy REST API) |
basicAuth |
数组 | 为以下域设置自动基本身份验证列表
|
dns |
数组 | 使用域/IP 映射的内部代理 DNS
|
retry |
整数 | 方法将重试的次数 [默认 = 0] |
示例
modules: config: Codeception\Extension\BrowserMob: host: 'localhost' port: 9090 autostart: true whitelist: code: 404 patterns: - 'http://codeception.com/' limits: downstreamKbps: 12 upstreamKbps: 12 latency: 1 timeouts: request: 10 read: 10 connection: 10 dns: 10 basicAuth: - domain: example.local options: username: myUsername password: myPassword dns: - domain: example.local ip: 127.0.0.1 - domain: wikipedia.org ip: 192.168.1.1 retry: 3
文档
模块文档可在维基百科中找到。
有关如何使用BrowserMob代理的更多信息,请参阅BrowserMob Proxy REST API 文档。