allure-framework / allure-codeception
Allure Codeception integration
Installs: 9 591 913
Dependents: 8
Suggesters: 0
Security: 0
Stars: 51
Watchers: 13
Forks: 44
Open Issues: 3
Requires
- php: ^8
- ext-json: *
- allure-framework/allure-php-commons: ^2.3.1
- codeception/codeception: ^5.0.3
Requires (Dev)
- psalm/plugin-phpunit: ^0.19.0
- remorhaz/php-json-data: ^0.5.3
- remorhaz/php-json-path: ^0.7.7
- squizlabs/php_codesniffer: ^3.7.2
- vimeo/psalm: ^5.12
- dev-main
- v2.4.0
- v2.3.0
- v2.2.0
- v2.1.0
- v2.0.2
- v2.0.1
- v2.0.0
- v2.0.0-rc.1
- v1.x-dev
- 1.5.2
- 1.5.1
- 1.5.0
- 1.4.5
- 1.4.4
- 1.4.3
- 1.4.2
- 1.4.1
- 1.4.0
- 1.3.0
- 1.2.7
- 1.2.6
- 1.2.5
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.1
- 1.1.0
- 1.0.0
- dev-dependabot/composer/remorhaz/php-json-data-tw-0.7.0
- dev-dependabot/composer/remorhaz/php-json-path-tw-0.8.1
This package is auto-updated.
Last update: 2024-12-09 17:01:53 UTC
README
This is an official Codeception adapter for Allure Framework.
What is this for?
The main purpose of this adapter is to accumulate information about your tests and write it out to a set of XML files: one for each test class. This adapter only generates XML files containing information about tests. See wiki section on how to generate report.
Example project
Example project is located at: https://github.com/allure-examples/allure-codeception-example
Installation and Usage
In order to use this adapter you need to add a new dependency to your composer.json file:
{
"require": {
"php": "^8",
"allure-framework/allure-codeception": "^2"
}
}
To enable this adapter in Codeception tests simply put it in "enabled" extensions section of codeception.yml:
extensions: enabled: - Qameta\Allure\Codeception\AllureCodeception config: Qameta\Allure\Codeception\AllureCodeception: outputDirectory: allure-results linkTemplates: issue: https://example.org/issues/%s setupHook: My\SetupHook
outputDirectory
is used to store Allure results and will be calculated
relatively to Codeception output directory (also known as paths: log
in
codeception.yml) unless you specify an absolute path. You can traverse up using
..
as usual. outputDirectory
defaults to allure-results
.
linkTemplates
is used to process links and generate URLs for them. You can put
here an sprintf()
-like template or a name of class to be constructed; such class
must implement Qameta\Allure\Setup\LinkTemplateInterface
.
setupHook
allows to execute some bootstrapping code during initialization. You can
put here a name of the class that implements magic __invoke()
method - and that method
will be called. For example, it can be used to ignore unnecessary docblock annotations:
<?php namespace My; use Doctrine\Common\Annotations\AnnotationReader; class SetupHook { public function __invoke(): void { AnnotationReader::addGlobalIgnoredName('annotationToIgnore'); } }
To generate report from your favourite terminal, install allure-cli and run following command (assuming you're in project root and using default configuration):
allure generate -o ./build/allure-report ./build/allure-results
Report will be generated in build/allure-report
.
Main features
See respective PHPUnit section.