qadept/codeception-qaapi
Composer 安装命令:
composer require qadept/codeception-qaapi
包简介
Codeceprion module to work with QA API
README 文档
README
What is QaApi
QaApi is an API for a QA department. This API can get or change an internal state of a system during manual or automated testing.
Example of Test Case
You created a new feature for your webshop. It sends a reminder to the customer email in 1 day if he gave up his cart.
How does tester have to test this case? Right, he has to create a cart and wait 1 day.
But if we have no that time, tester will go to developer and ask him to change a creation time of the cart in database back on 23 hours 55 minutes. Then the feature will be tested in 5 minutes, and we can release it.
At this time we solved our problem, but:
-
tester will interrupt a developer every time when he needs to change something in database
-
tester can't write automated tests for such cases (unless he has a knowledge of the project source code and has an access to it)
QaApi solves the both problems
Developer just needs to write one API method which can change a creation time of a cart. Then tester can use it for manual and automated testing:
-
PHP client for API will be automatically generated to use it for automated tests
-
if your company use QAdept service, tester can use it manually from Operations tab
What benefits do you have using this approach?
- Testing of difficult test cases is much easier.
- It helps testers with manual and automated testing.
- It increases productivity by splitting up testers' and developers' work.
- Testers don't need to know anything about the project source code.
- It allows company to don't share the project source code with testers.
How to install
-
Install QaApi package:
composer require qadept/codeception-qaapi
-
Add QaApi module to a suite file. Its content should look like:
class_name: FunctionalTester modules: enabled: - \WebShop\Helper\Functional - WebDriver: url: 'http://myproject.local' browser: phantomjs window_size: 1280x960 - Asserts - \WebShop\Helper\QaApi: url: 'http://myproject.local/qaapi' api_key: my_secret_key
Here "url" is a base URL for API, "api_key" is a key for authorization.
-
Create a qaapi.json file in the directory with tests (the same directory where you have codeception.yml file). This file is using Swagger Specification and will be used for automatical generation of PHP API Client.
-
Generate PHP API Client and helper classes:
./vendor/bin/codecept qaapi:generate -c projects/WebShop
./vendor/bin/codecept build -c projects/WebShop
qadept/codeception-qaapi 适用场景与选型建议
qadept/codeception-qaapi 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 54 次下载、GitHub Stars 达 1, 最近一次更新时间为 2016 年 08 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 qadept/codeception-qaapi 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 qadept/codeception-qaapi 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 54
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 9
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-08-22