Skip to content

Commit

Permalink
Merge pull request #1 from beliarh0503/fix-issue-123
Browse files Browse the repository at this point in the history
fix extension initialization (fixes allure-framework#123)
  • Loading branch information
remorhaz authored May 16, 2024
2 parents 876f7f0 + 4f1bc76 commit 3a06466
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ extensions:
outputDirectory: allure-results
linkTemplates:
issue: https://example.org/issues/%s
setipHook: My\SetupHook
setupHook: My\SetupHook
```
`outputDirectory` is used to store Allure results and will be calculated
Expand Down
14 changes: 14 additions & 0 deletions src/AllureCodeception.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ final class AllureCodeception extends Extension
private const DEFAULT_RESULTS_DIRECTORY = 'allure-results';

protected static array $events = [
Events::MODULE_INIT => 'moduleInit',
Events::SUITE_BEFORE => 'suiteBefore',
Events::SUITE_AFTER => 'suiteAfter',
Events::TEST_START => 'testStart',
Expand All @@ -70,6 +71,19 @@ final class AllureCodeception extends Extension
public function _initialize(): void
{
parent::_initialize();
$this->reconfigure();
}

/**
* @throws ConfigurationException
*/
public function moduleInit(): void
{
$this->reconfigure();
}

private function reconfigure(): void
{
QametaAllure::reset();
$this->testLifecycle = null;
$this->threadDetector = null;
Expand Down

0 comments on commit 3a06466

Please sign in to comment.