dmore/behat-chrome-extension
最新稳定版本:1.4.1
Composer 安装命令:
composer require dmore/behat-chrome-extension
包简介
Behat extension for controlling Chrome without Selenium
README 文档
README
Behat extension for controlling chrome without the overhead of selenium.
It communicates directly with chrome over HTTP and WebSockets, which allows it to work at least twice as fast as chrome with selenium.
For chrome 59+ it supports headless mode, eliminating the need to install a display server, and the overhead that comes with it.
This driver is tested and benchmarked against a behat suite of 1800 scenarios and 19000 steps. It can successfully run it in less than 18 minutes with chrome 60 headless.
The same suite running against chrome 58 with xvfb and selenium takes ~60 minutes.
Installation:
composer require dmore/behat-chrome-extension
Requirements:
- Google chrome or chromium running with remote debugging
Example:
google-chrome-stable --remote-debugging-address=0.0.0.0 --remote-debugging-port=9222
or headless (59+):
google-chrome-unstable --disable-gpu --headless --remote-debugging-address=0.0.0.0 --remote-debugging-port=9222
The official docker image includes chrome 60 running headless.
See https://gitlab.com/DMore/behat-chrome-skeleton for a fully working example.
Usage:
default:
extensions:
DMore\ChromeExtension\Behat\ServiceContainer\ChromeExtension: ~
Behat\MinkExtension:
browser_name: chrome
base_url: http://localhost
sessions:
default:
chrome:
api_url: "http://localhost:9222"
Configuration
The following optional configuration settings are available
validate_certificate
Default: true
Set to false to ignore invalid ssl certificates.
socket_timeout
Default: 10
Timeout in seconds before the HTTP or WebSocket connection to the chrome browser is considered dead.
download_behavior
Default: falls back to browser configuration
Set to 'allow' to allow downloads.
dom_wait_timeout
Default: 3000
How many milliseconds we should wait for DOM to be ready after each action/transition
download_path
Default: /tmp
Set to a directory path where you would like files to be downloaded. Requires download_behavior: allow
Example:
default:
extensions:
DMore\ChromeExtension\Behat\ServiceContainer\ChromeExtension: ~
Behat\MinkExtension:
browser_name: chrome
base_url: http://localhost
sessions:
default:
chrome:
api_url: "http://localhost:9222"
download_behavior: allow
download_path: /download
validate_certificate: false
Contributing
You are encouraged to fork this repository and contribute your own improvements.
dmore/behat-chrome-extension 适用场景与选型建议
dmore/behat-chrome-extension 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 12.63M 次下载、GitHub Stars 达 26, 最近一次更新时间为 2026 年 01 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「Behat」 「driver」 「headless」 「chrome」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 dmore/behat-chrome-extension 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 dmore/behat-chrome-extension 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 dmore/behat-chrome-extension 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Behat Context for testing Symfony Api
A Behat Extension that allows custom bootstrapping
Environment processor and contexts autoloader
Provides access to magento2 object manager from behat and allows to change magento config settings temporarly
This extension provides integration with solr to output content from TYPO3 in JSON format.
log the behat execution into json result
统计信息
- 总下载量: 12.63M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 33
- 点击次数: 20
- 依赖项目数: 390
- 推荐数: 3
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-04