|
14 | 14 | use Magento\FunctionalTestingFramework\Util\TestGenerator;
|
15 | 15 | use Yandex\Allure\Adapter\Model\Status;
|
16 | 16 | use Yandex\Allure\Adapter\Model\Step;
|
| 17 | +use Yandex\Allure\Adapter\Allure; |
17 | 18 | use Yandex\Allure\Codeception\AllureCodeception;
|
18 | 19 | use Yandex\Allure\Adapter\Event\StepStartedEvent;
|
19 | 20 | use Yandex\Allure\Adapter\Event\StepFinishedEvent;
|
@@ -82,7 +83,7 @@ public function suiteBefore(SuiteEvent $suiteEvent)
|
82 | 83 |
|
83 | 84 | call_user_func(\Closure::bind(
|
84 | 85 | function () use ($suite, $suiteName) {
|
85 |
| - $suite->name = $suiteName; |
| 86 | + $suite->setName($suiteName); |
86 | 87 | },
|
87 | 88 | null,
|
88 | 89 | $suite
|
@@ -249,11 +250,8 @@ public function testError(FailEvent $failEvent)
|
249 | 250 |
|
250 | 251 | /**
|
251 | 252 | * Override of parent method, polls stepStorage for testcase and formats it according to actionGroup nesting.
|
252 |
| - * |
253 | 253 | * @param TestEvent $testEvent
|
254 |
| - * |
255 | 254 | * @throws \Yandex\Allure\Adapter\AllureException
|
256 |
| - * |
257 | 255 | * @return void
|
258 | 256 | */
|
259 | 257 | public function testEnd(TestEvent $testEvent)
|
@@ -317,15 +315,26 @@ function () use ($rootStep, $formattedSteps) {
|
317 | 315 |
|
318 | 316 | $this->getLifecycle()->getStepStorage()->put($rootStep);
|
319 | 317 |
|
| 318 | + $this->addAttachmentEvent($testEvent); |
| 319 | + |
| 320 | + $this->getLifecycle()->fire(new TestCaseFinishedEvent()); |
| 321 | + } |
| 322 | + |
| 323 | + /** |
| 324 | + * Fire add attachment event |
| 325 | + * @param TestEvent $testEvent |
| 326 | + * @throws \Yandex\Allure\Adapter\AllureException |
| 327 | + * @return void |
| 328 | + */ |
| 329 | + private function addAttachmentEvent(TestEvent $testEvent) |
| 330 | + { |
320 | 331 | // attachments supported since Codeception 3.0
|
321 | 332 | if (version_compare(Codecept::VERSION, '3.0.0') > -1 && $testEvent->getTest() instanceof Cest) {
|
322 | 333 | $artifacts = $testEvent->getTest()->getMetadata()->getReports();
|
323 | 334 | foreach ($artifacts as $name => $artifact) {
|
324 | 335 | Allure::lifecycle()->fire(new AddAttachmentEvent($artifact, $name, null));
|
325 | 336 | }
|
326 | 337 | }
|
327 |
| - |
328 |
| - $this->getLifecycle()->fire(new TestCaseFinishedEvent()); |
329 | 338 | }
|
330 | 339 |
|
331 | 340 | /**
|
|
0 commit comments