dev-master
9999999-devCodeceprion module to work with QA API
MIT
The Requires
by Oleg Polosin
1.0.0
1.0.0.0Codeceprion module to work with QA API
MIT
The Requires
by Oleg Polosin
Codeceprion module to work with QA API
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., (*1)
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., (*2)
How does tester have to test this case? Right, he has to create a cart and wait 1 day., (*3)
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., (*4)
At this time we solved our problem, but:, (*5)
tester will interrupt a developer every time when he needs to change something in database, (*6)
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), (*7)
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:, (*8)
PHP client for API will be automatically generated to use it for automated tests, (*9)
if your company use QAdept service, tester can use it manually from Operations tab, (*10)
Install QaApi package:, (*11)
composer require qadept/codeception-qaapi
Add QaApi module to a suite file. Its content should look like:, (*12)
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., (*13)
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., (*14)
Generate PHP API Client and helper classes:, (*15)
./vendor/bin/codecept qaapi:generate -c projects/WebShop
./vendor/bin/codecept build -c projects/WebShop
Codeceprion module to work with QA API
MIT
Codeceprion module to work with QA API
MIT