winter/wn-dusk-plugin
Composer 安装命令:
composer require --dev winter/wn-dusk-plugin
包简介
Integrates Laravel Dusk browser testing into Winter CMS.
README 文档
README
Integrates Laravel Dusk browser testing into Winter CMS, providing Winter CMS and plugin developers with the tools to run automated tests on a fully functional Winter CMS instance through a virtual browser.
Note: This plugin is intended to be used for development purposes only. Configured improperly, it can allow users to circumvent authentication and sign in as any user. This plugin should be specified as a development dependency (ie.
require-dev) only.
Getting started
To install the plugin, you may install it through the Winter CMS Marketplace, or you may install it using Composer:
composer require --dev winter/wn-dusk-plugin
Then, run the migrations to ensure the plugin is enabled:
php artisan winter:up
To run the browser tests, you must install the Chrome web-driver and have the Google Chrome browser installed on the machine running the tests. The web-driver can be installed by running the following command:
php artisan dusk:chrome-driver
Running the tests
By default, the browser tests are configured to run the tests against a website served by the in-built Laravel web server. You may start this server by running the following:
php artisan serve
To start the browser tests, run:
php artisan dusk
This will execute all available browser tests in all enabled plugins on your Winter CMS installation. If you would like to run the tests for one plugin only, you may add the plugin code as an argument:
php artisan dusk Acme.Blog
As a shortcut after running the tests, you may re-run the failed tests by executing the following command:
php artisan dusk:fails
Creating browser tests for your plugin
The Dusk plugin makes it a breeze to create browser tests for your own plugin.
Browser test classes should reside in the tests/browser folder of your plugin. Each test class file should ended with Test.php to indicate it is a class of test cases, and should extend the Winter\Dusk\Classes\BrowserTestCase class.
For example, a blog plugin may wish to create a BlogTest.php file with the following content:
<?php namespace Acme\Blog\Tests\Browser; use Winter\Dusk\Classes\BrowserTestCase; class BlogTest extends BrowserTestCase { public function testPost() { // the test to run } }
Each test method in the class should be prefixed with test to denote that it is a test case.
To run the browser tests for your plugin, simply run the following:
php artisan dusk Acme.Blog
winter/wn-dusk-plugin 适用场景与选型建议
winter/wn-dusk-plugin 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 383 次下载、GitHub Stars 达 2, 最近一次更新时间为 2021 年 03 月 21 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「testing」 「browser」 「laravel」 「dusk」 「winter」 「wintercms」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 winter/wn-dusk-plugin 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 winter/wn-dusk-plugin 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 winter/wn-dusk-plugin 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Give your JS App some Backbone with Models, Views, Collections, and Events.
Testing Suite For Lumen like Laravel does.
Instrument headless chrome/chromium instances from php5.6
Selenium4 (WebDriver) driver for Mink framework
The PHP SDK for Checkmango
Clusteer is a Puppeteer wrapper written for PHP, with the super-power of parallelizing pages across multiple browser instances.
统计信息
- 总下载量: 383
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 24
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-03-21