From 4f1bc76206c535aeefe8ba0a67726dd0ccb0f732 Mon Sep 17 00:00:00 2001 From: beliarh Date: Wed, 15 May 2024 10:18:42 +0300 Subject: [PATCH] fix extension initialization (fixes #123) --- README.md | 2 +- src/AllureCodeception.php | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 00aa2e2..9d5abdf 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/src/AllureCodeception.php b/src/AllureCodeception.php index deb0457..ba9dbf4 100644 --- a/src/AllureCodeception.php +++ b/src/AllureCodeception.php @@ -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', @@ -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;