silverstripe/mink-facebook-web-driver
Composer 安装命令:
composer require --dev silverstripe/mink-facebook-web-driver
包简介
Mink driver for facebook's webdriver
README 文档
README
Currently forked from [https://github.com/minkphp/MinkSelenium2Driver/] and updated to use the facebook php webdriver.
See [minkphp#254] for the status of selenium 3 support.
Major updates include:
- Switch to using facebook/webdriver
- Selenium optional, can use chromedriver (or other jsonwire protocol servers instead)
- Default to
chromeinstead offirefox - Update minimum php version to 5.6
Using the Facebook WebDriver with behat
Subclass Behat\MinkExtension\ServiceContainer\MinkExtension and add the new driver factory.
<?php namespace SilverStripe\BehatExtension; use Behat\MinkExtension\ServiceContainer\MinkExtension as BaseMinkExtension; use SilverStripe\MinkFacebookWebDriver\FacebookFactory; class MinkExtension extends BaseMinkExtension { public function __construct() { parent::__construct(); $this->registerDriverFactory(new FacebookFactory()); } }
Add this extension to your behat.yml (see below)
Running chromedriver instead of selenium
Make sure you install chromedriver and have the service running
$ brew install chromedriver
$ chromedriver
Starting ChromeDriver 2.34.522932 (4140ab217e1ca1bec0c4b4d1b148f3361eb3a03e) on port 9515
Only local connections are allowed.
Set the wb_host to this server instead (substitute SilverStripe\BehatExtension\MinkExtension
for your class).
default: suites: [] extensions: SilverStripe\BehatExtension\MinkExtension: default_session: facebook_web_driver javascript_session: facebook_web_driver facebook_web_driver: browser: chrome wd_host: "http://127.0.0.1:9515" #chromedriver port
Setting timeouts
There are three types of timeout that can be set:
| type | description |
|---|---|
| implicit | Specify the amount of time the driver should wait when searching for an element if it is not immediately present. |
| script | Set the amount of time to wait for an asynchronous script to finish execution before throwing an error. |
| page | Set the amount of time to wait for a page load to complete before throwing an error. |
The values are in milliseconds.
Warning
The wiki advises against using implicit waits - only use that if you're still experiencing unexpected timeouts after setting a value for both script and page.
You can set timeouts in behat.yml like so:
default: suites: [] extensions: SilverStripe\BehatExtension\MinkExtension: #... other stuff here facebook_web_driver: #... other stuff here timeouts: # wait 5 minutes before timing our for a page load page: 300000
Common problems
System.InvalidOperationException : unknown error: call function result missing 'value': Update chromedriver to latest version
Maintainers
- Damian Mooyman tractorcow
Credit to original maintainers of MinkSelenium2Driver
- Christophe Coevoet stof
- Pete Otaqui pete-otaqui
License
MIT License
Copyright (c) 2012 Pete Otaqui pete@otaqui.com.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
silverstripe/mink-facebook-web-driver 适用场景与选型建议
silverstripe/mink-facebook-web-driver 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 538.01k 次下载、GitHub Stars 达 11, 最近一次更新时间为 2018 年 04 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「javascript」 「testing」 「browser」 「ajax」 「webdriver」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 silverstripe/mink-facebook-web-driver 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 silverstripe/mink-facebook-web-driver 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 silverstripe/mink-facebook-web-driver 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Give your JS App some Backbone with Models, Views, Collections, and Events.
Generates a Blade directive exporting all of your named Laravel routes. Also provides a nice route() helper function in JavaScript.
Testing Suite For Lumen like Laravel does.
Caching and compression for Twig assets (JavaScript and CSS).
A pretty nice way to expose your translation messages to your JavaScript.
Instrument headless chrome/chromium instances from php5.6
统计信息
- 总下载量: 538.01k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 11
- 点击次数: 29
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-04-11