site5/phantoman
Composer 安装命令:
composer require site5/phantoman
包简介
The Codeception extension for automatically starting and stopping PhantomJS when running tests.
README 文档
README
The Codeception extension for automatically starting and stopping PhantomJS when running tests.
Minimum Requirements
- Codeception 2.2.7
- PHP 5.4
Installation using Composer
$ composer require site5/phantoman
Be sure to enable the extension in codeception.yml as shown in
configuration below.
Recommended Additional Packages
PhantomJS Installer via Composer
It is highly recommended that you use the PhantomJS
Installer package which will
install PhantomJS locally to your project in vendor/bin. Please follow the
installation
instructions
provided.
Phantoman uses vendor/bin/phantomjs by default. If any other installation of
PhantomJS is used, please set the path as shown in the configuration below.
Configuration
By default Phantoman will use the path vendor/bin/phantomjs and port 4444.
Enabling and configuration can be done in codeception.yml or in your suite config file.
Enabling Phantoman with defaults
extensions: enabled: - Codeception\Extension\Phantoman
Enabling Phantoman with alternate settings
extensions: enabled: - Codeception\Extension\Phantoman config: Codeception\Extension\Phantoman: path: '/usr/bin/phantomjs' port: 4445 suites: ['acceptance']
Enabling Phantoman in the acceptance suite except on the ci environment
extensions: enabled: - Codeception\Extension\Phantoman: suites: ['acceptance'] env: ci: extensions: enabled: - Codeception\Extension\Phantoman: suites: []
Available options
Options set in the Phantoman configuration are mapped to PhantomJS CLI options. The currently supported options are listed below.
Basic
path: {path}- Full path to the PhantomJS binary.
- Default:
vendor/bin/phantomjs
port: {port}- Webdriver port to start PhantomJS with.
- Default:
4444
debug: {true|false}- Display debug output while Phantoman runs
- Default:
false
Proxy Support
proxy: {address:port}- Sets the proxy server.
proxyType: {[http|socks5|none]}- Specifies the proxy type.
proxyAuth: {username:password}- Provides authentication information for the proxy.
Other
suites: {array|string}- If omitted, PhantomJS is started for all suites.
- Specify an array of suites or a single suite name.
webSecurity: {true|false}- Enables web security
ignoreSslErrors: {true|false}- Ignores errors in the SSL validation.
- Defaults to
false
sslProtocol: {sslv3|sslv2|tlsv1|any}- Sets the SSL protocol for secure connections
- Defaults to
sslv3
sslCertificatesPath: {path}- Sets the location for custom CA certificates (if none set, uses system default).
remoteDebuggerPort: {port}- Starts PhantomJS in a debug harness and listens on the specified port
remoteDebuggerAutorun: {true|false}- Runs the script in the debugger immediately
- Defaults to
false
cookiesFile: {file path}- Sets the file name to store the persistent cookies
diskCache: {true|false}- Enabled disk cache
- Defaults to
false
maxDiskCacheSize: {number}- Limit the size of the disk cache in KB
loadImages: {true|false}- Loads all inlined images
- Defaults to
true
localStoragePath: {file path}- The path to save LocalStorage content and WebSQL content
localStorageQuota: {number}- Maximum size to allow for data in local storage in KB
localToRemoteUrlAccess: {true|false}- Allows local content to access remote URL
- Defaults to
false
outputEncoding: {encoding}- Sets the encoding for the terminal output
- Default is
utf8
scriptEncoding: {encoding}- Sets the encoding used for starting the script
- Default is
utf8
silent: {true|false}- Suppresses messages about starting and stopping the server
- Default is
false
webdriverLoglevel: {ERROR|WARN|INFO|DEBUG)}- WebDriver Logging Level
- Defaults to
INFO
webdriverLogfile: {path}- File where to write the WebDriver’s Log
Usage
Once installed and enabled, running your tests with php codecept run will
automatically start the PhantomJS server and wait for it to be accessible before
proceeding with the tests.
Starting PhantomJS Server.
Waiting for the PhantomJS server to be reachable..
PhantomJS server now accessible.
Once the tests are complete, PhantomJS will be shut down.
Stopping PhantomJS Server.
Contributing
This repository makes use of EditorConfig to ensure code style consistency across editors. Please be sure to either have an EditorConfig plugin installed for your desire editor or ensure that all indenting is 4 space indenting with linux line endings.
site5/phantoman 适用场景与选型建议
site5/phantoman 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.1M 次下载、GitHub Stars 达 48, 最近一次更新时间为 2014 年 07 月 25 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「extension」 「codeception」 「headless」 「phantomjs」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 site5/phantoman 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 site5/phantoman 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 site5/phantoman 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Connection 'Db' codeception module to 'Yii2' module database settings
Mailtrap module for Codeception
This extension provides integration with solr to output content from TYPO3 in JSON format.
A custom URL rule class for Yii 2 which allows to create translated URL rules
Instrument headless chrome/chromium instances from php5.6
The Yii2 extension uses jQuery jquery.carousel-1.1.min.js and makes image carousel from php array of structure defined.
统计信息
- 总下载量: 1.1M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 49
- 点击次数: 24
- 依赖项目数: 15
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-07-25