This Bundle provides ability to test your application using Model Based Testing techique.
The major features are:
- Allow to test your application even though the application is not implemented yet.
- Automatically generate test cases when a task is created.
- Automatically execute those test cases to test your application.
- Automatically reduce reproduce path when a bug is found.
- Automatically report the bug when the reproduce path is reduced.
All you have to do:
- Define models to describe your application.
- Define subjects to interact with your application.
- Create tasks based on your need. e.g.:
- Test the whole application to make sure there are no bugs in the application.
- Test only models that have a tag to make sure the part of your application is still working while developing a feature.
- Test a model to make sure a bug that has been fixed is not regressed.
- Manage bugs that has been found. e.g. mark a bug has been fixed.
- You don't have to maintains test cases that has been generated automatically, instead, you may need to maintains models and subjects.
- PHP 7.3 / 7.4
- Symfony 5.0
- See also the
require
section of composer.json
Before testing your application, you need to create new symfony project to use this bundle:
$ composer create-project symfony/skeleton my-project
Install lastest version of this bundle:
$ composer require tienvx/mbt-bundle "^1.16"
In order to save screenshots of bug report, we need to configure file system:
flysystem:
storages:
# Name of the storage is matter
mbt.storage:
adapter: 'local'
options:
directory: '%kernel.project_dir%/var/storage/screenshots'
Model is the way to describe part your application. Subject is the way to tell this bundle to interact with your application.
You can run the tests with:
$ php tests/app/bin/console cache:clear # Only if you added new code
$ vendor/bin/phpunit
$ php-cs-fixer fix --diff --dry-run
For the usage guide and reference, see docs
- Symfony - The web framework, and its components
- League's flysystem - Screenshot storage
- Doctrine - Database storage and object mapping
- A Star - PHP A* search algorithm
Pull requests are welcome, please send pull requests.
If you found any bug, please report issues.
Please read CODE_OF_CONDUCT.md for details on our code of conduct, and CONTRIBUTING.md for the process for submitting pull requests to us.
- Tien Vo - Initial work - tienvx
See also the list of contributors who participated in this project.
This package is available under the MIT license.