oprudkyi/codeception-events-scripting
Composer 安装命令:
composer require oprudkyi/codeception-events-scripting
包简介
The Codeception extension for automatically running shell scripts on codeception events
关键字:
README 文档
README
oprudkyi/codeception-events-scripting The Codeception extension for automatically running shell scripts on codeception events.
About
Run shell scripts on codeception's events - before/after tests/suites (like db seeding, stopping-running additional software etc.) Inspired by Phantoman extension for Codeception, though allow to run anything in more generic way.
Minimum Requirements
- Codeception 2.1.0
- PHP 5.5
Installation
This project can be installed via Composer. To get the latest version, simply add the following line to the require block of your composer.json file:
{
"require-dev": {
"oprudkyi/codeception-events-scripting": "*"
}
}
You'll then need to run composer install or composer update to download the
package and have the autoloader updated.
Or run the following command:
composer require oprudkyi/codeception-events-scripting --dev
Configuration
Enable extension in the codeception.yml and write commands. Next events are supported:
- BeforeAll - run before tests on every "codecept run"
- AfterAll - run after all tests
- BeforeSuite - run before each suite (use 'suites' array to run only for selected suites)
- AfterSuite - run after each suite (use 'suites' array to run only for selected suites)
supported next attributes:
- command - command line to run (for one-liners you can write command directly)
- description - echoed before command
- params - additional params for command
- ignoreErrors - don't break testing if command fails (failed or retval != 0)
- suites - single name or array of suites to run command for (applied to base name, like 'acceptance' as well to long name 'acceptance (phantom, firefox)')
- environments - single name or array of environments
- platforms - single name or array of platforms (uses
PHP_OSconstant, i.e. the platform where PHP was built, check here for details)
extensions: enabled: - Codeception\Extension\EventsScripting config: Codeception\Extension\EventsScripting: BeforeAll: - command: echo "Before All" - command: echo "Before All with Description" description: Description of command - echo "Before All single line" - command: echo params: "Before All Params" description: Before All with Params - command: "false" description: BeforeAll. fail on run but ignore errors ignoreErrors: true AfterAll: - command: echo "After All" - command: uname description: Platform *nx-like platforms: [darwin, linux, bsd, unix] - command: ver description: Platform Windows platforms: windows BeforeSuite: - command: echo "Before acceptance suite" suites: ['acceptance'] - command: echo "Before any suite" - command: echo "Before acceptance suite, phantom environment" suites: ['acceptance'] environments: phantom - command: echo "Before acceptance suite, phantom,chrome environments" suites: ['acceptance'] environments: ['phantom', 'chrome'] AfterSuite: - command: echo "After acceptance suite" suites: 'acceptance' - command: echo "After any suite"
Real example (start/stop mailcatcher and seed db):
Codeception\Extension\EventsScripting: BeforeAll: - command: ./artisan db:seed-test --env=testing description: Reset db and seed BeforeSuite: - command: GEM_HOME=vendor/ruby vendor/ruby/bin/mailcatcher --ip 127.0.0.1 --smtp-port 11031 --http-port 11091 suites: 'acceptance' description: Start mailcatcher AfterSuite: - command: curl -s -X DELETE http://127.0.0.1:11091 suites: 'acceptance' description: Stop mailcatcher ignoreErrors: true
Testing
cd sample composer install -n --prefer-source cd ../test composer install -n --prefer-source ./vendor/bin/codecept run
Contribute
This package is (yet) under development and refactoring but is ready for production. Please, feel free to comment, contribute and help. I will be happy to get some help to deliver tests.
License
Codeception's events scripting is licensed under The MIT License (MIT).
oprudkyi/codeception-events-scripting 适用场景与选型建议
oprudkyi/codeception-events-scripting 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 58.41k 次下载、GitHub Stars 达 12, 最近一次更新时间为 2016 年 04 月 25 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「shell」 「extension」 「codeception」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 oprudkyi/codeception-events-scripting 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 oprudkyi/codeception-events-scripting 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 oprudkyi/codeception-events-scripting 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Connection 'Db' codeception module to 'Yii2' module database settings
Mailtrap module for Codeception
A custom URL rule class for Yii 2 which allows to create translated URL rules
AMWSCAN (Antimalware Scanner) is a php antimalware/antivirus scanner console script written in php for scan your project. This can work on php projects and a lot of others platform.
Shell command module for PHP.
PHP library for the MUMSYS project
统计信息
- 总下载量: 58.41k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 12
- 点击次数: 11
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-04-25